Endpoints

Edit, delete, and cancel posts

Update draft content, remove drafts permanently, or cancel scheduled posts that have not yet published.

Edit a post

PATCH /api/v1/posts/:id updates a post. Only editable fields are content and social_account_ids. Scheduled posts can be edited as long as they have not yet published; the worker reads the latest state at publish time.

curl -X PATCH "$SOCIALSPOOL_BASE_URL/api/v1/posts/post_01HZ..." \
  -H "Authorization: Bearer $SOCIALSPOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "Updated content for this post"}'

Restrictions by post status:

  • draft: content and social_account_ids are editable.
  • scheduled: content and social_account_ids are editable. The worker reads latest state at publish time.
  • publishing, published, failed, canceled: not editable.
Delete a draft

DELETE /api/v1/posts/:id permanently removes a draft post. Only posts with draft status can be deleted. Scheduled or published posts must be canceled first.

curl -X DELETE "$SOCIALSPOOL_BASE_URL/api/v1/posts/post_01HZ..." \
  -H "Authorization: Bearer $SOCIALSPOOL_API_KEY"

A successful delete returns 204 No Content.

Cancel a scheduled post

POST /api/v1/posts/:id/cancel cancels a scheduled post before the worker publishes it. The cancel route removes pending pg-boss jobs and marks all targets as canceled. If a target is already published, it remains published.

curl -X POST "$SOCIALSPOOL_BASE_URL/api/v1/posts/post_01HZ.../cancel" \
  -H "Authorization: Bearer $SOCIALSPOOL_API_KEY"

Cancel conditions:

  • The post must have at least one target with scheduled or publishing status.
  • Already-published targets are unaffected.
  • Canceled posts cannot be rescheduled. Create a new post instead.