Skip to main content
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-delete

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Body

postIds
string[]
Requested Results

Respuestas

success
boolean
default:"True"
required
Success or Failure
statusCode
number
default:"201"
required
Status Code
message
string
default:"Posts Deleted Successfully"
required
Message
results
object
required
Message and deleted count
{
  "success": true,
  "statusCode": 201,
  "message": "Posts Deleted Successfully",
  "results": {
    "message": "Posts deleted successfully",
    "deletedCount": 10
  }
}
{}
{}
{}

Ejemplo

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);