POST/social-posts/bulk-delete

Deletes up to 100 social posts in one request.

https://api.postfa.st/Auth: pf-api-keyRate limit: 200 requests per hour

Removes posts from PostFast only

Deletes posts in any status, like DELETE /social-posts/{id}. It removes the posts, their schedules and their analytics from PostFast, and their media files once nothing else in PostFast uses them. PostFast never calls the social platform, so a post that is already published stays live there. A scheduled post that has not published yet will not publish.

Returns 200, not 201

This POST creates nothing, so it answers 200 OK (the Social Inbox POST routes answer 201 Created). One call counts as one request against this endpoint's own rate limit, separate from DELETE /social-posts/{id}.

Delete everything that matches a filter

GET /social-posts pages by offset, so deleting while you walk the pages shifts later posts onto pages you have already read, and they get skipped. Re-read page=0 with the same filter and delete what it returns until it comes back empty.

This loop stops on any error, including a 429: wait Retry-After seconds and run it again.

// Every scheduled post on one account.
// Always re-read page 0: deleting shifts later pages.
const API = 'https://api.postfa.st';
const headers = { 'pf-api-key': 'YOUR_API_KEY' };
// An account id from GET /social-media/my-social-accounts
const accountId = '550e8400-e29b-41d4-a716-446655440001';

while (true) {
  const params = new URLSearchParams({
    socialMediaIds: accountId,
    statuses: 'SCHEDULED',
    limit: '50'
  });
  const page = await fetch(`${API}/social-posts?${params}`, { headers });
  const { data } = await page.json();
  if (!data?.length) break; // nothing left to delete (or an error)

  const result = await fetch(`${API}/social-posts/bulk-delete`, {
    method: 'POST',
    headers: { ...headers, 'Content-Type': 'application/json' },
    body: JSON.stringify({ ids: data.map((post) => post.id) })
  }).then((r) => r.json());
  // Nothing deletable left (or an error): stop, don't spin
  if (!result.deletedIds?.length) break;
}

Request body

idsstring[] (UUID)required

The ids of the posts to delete: 1 to 100, each a UUID v4 (post ids come from GET /social-posts). An empty array returns 400 (At least one id is required), more than 100 returns 400 (ids cannot exceed 100 entries), and a non-UUID returns 400 (Each id must be a valid UUID).

Response

200 OK Lists which ids were deleted and which were not found. Each id appears once, even if you sent it twice.

deletedIdsstring[]optional

The posts that were deleted.

notFoundIdsstring[]optional

Ids that do not exist or belong to another workspace. Both cases get the same answer, so nothing about other workspaces is revealed. Repeating a call with the same ids is harmless: they all come back here.