Deletes multiple posts based on the provided list of post IDs. This operation is useful for clearing up large numbers of posts efficiently.
Note:
1.The maximum number of posts that can be deleted in a single request is '50'.
2.However, It will only get deleted in Leadway database but still it is recommended to be cautious of this operation.
POST https://services.leadconnectorhq.com/social-media-posting/{locationId}/posts/bulk-deleteAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
postIds | string[] | No | Requested Results |
Responses
201 - Posts deleted successfully
success(boolean, required): Success or Failure Example:TruestatusCode(number, required): Status Code Example:201message(string, required): Message Example:Posts Deleted Successfullyresults(object, required): Message and deleted count
{
"success": true,
"statusCode": 201,
"message": "Posts Deleted Successfully",
"results": {
"message": "Posts deleted successfully",
"deletedCount": 10
}
}400 - Cannot delete more than 50 posts at a time.
{}404 - No posts found with the given IDs.
422 - Unprocessable Entity
{}500 - An error occurred while trying to delete the posts. Please try again later.
Example
curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/bulk-delete' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"postIds": [
"662791ee3f216822d7da0c8c"
]
}'const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/bulk-delete', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"postIds": ["662791ee3f216822d7da0c8c"]}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/bulk-delete',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"postIds": ["662791ee3f216822d7da0c8c"]},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/bulk-delete');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'postIds': ['662791ee3f216822d7da0c8c']}),
]);
$data = json_decode(curl_exec($ch), true);