Pages in API reference

Posts

Unpublish a post

POST/api/posts/:postId/unpublish

Take a published post down from the platforms: every account where it is published, or only the given accountIds (from platformPosts[].accountId).

  • Each account's result is in platformPosts: deleted, or still published with notice saying why (UNPUBLISH_NOT_SUPPORTED on Instagram and TikTok, which have no delete API; the platform's own refusal otherwise, such as Telegram's 48-hour limit for bots).
  • The post becomes deleted once no account has it; it stays readable in Ampost.
  • YouTube deletes count in the channel's daily budget of edits and deletes (10, 3 on Free; notice RATE_LIMITED past it).
  • Call platforms_list for unpublish.supported per platform.
  • Deleting from X costs X units like a post.
  • To discard a post that is not published yet, use posts_delete. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION when no given account has it published.
Key scope
posts:write
MCP tool
posts_unpublish

Headers

  • Authorizationstringrequired

    Bearer <API key>. Create a key in the dashboard under API keys.

Path parameters

  • postIdstringrequired

    Post id (UUID): id from posts_list or posts_create

Body

  • accountIdsstring[]

    Accounts to delete the post from (platformPosts[].accountId). Default: every account where it is published.

Errors return { error: { code, message } }; every code is in Error codes.