Skip to main content
DELETE
/
public
/
v1
/
posts
/
:id
Delete Post
curl --request DELETE \
  --url https://api.example.com/public/v1/posts/:id
{
  "401": {},
  "403": {},
  "404": {},
  "success": true,
  "message": "<string>"
}

Overview

Delete a post by its ID. This removes the post from the schedule and cancels any pending publications. Note that this endpoint deletes the entire post group (all platforms) associated with the post ID.
Deleting a post by ID will remove all posts in the same group across all platforms. If you posted to Twitter, LinkedIn, and Facebook simultaneously, deleting one will delete all three.

Request

Path Parameters

id
string
required
The unique post identifier returned when the post was created.You can get post IDs from the /posts list endpoint.

Response

Returns a success message when the post is deleted.
success
boolean
Indicates whether the deletion was successful
message
string
Confirmation message

Examples

curl -X DELETE https://api.postiz.com/public/v1/posts/post-123 \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Delete by Group ID

You can also delete posts by their group ID using the alternative endpoint:
DELETE /public/v1/posts/group/:group
This is useful when you want to explicitly delete all posts in a group:
curl -X DELETE https://api.postiz.com/public/v1/posts/group/group-abc \
  -H "Authorization: YOUR_API_KEY"

Workflow Example

Delete posts after listing them:
import Postiz from '@postiz/node';

const postiz = new Postiz('YOUR_API_KEY');

// Get all posts
const result = await postiz.postList({
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-12-31T23:59:59Z'
});

// Filter failed posts
const failedPosts = result.posts.filter(post => 
  post.status === 'failed'
);

// Delete all failed posts
for (const post of failedPosts) {
  await postiz.deletePost(post.id);
  console.log(`Deleted failed post: ${post.id}`);
}

Bulk Delete

Delete multiple posts efficiently:
async function deleteMultiplePosts(postIds) {
  const postiz = new Postiz('YOUR_API_KEY');
  
  const results = await Promise.allSettled(
    postIds.map(id => postiz.deletePost(id))
  );
  
  const successful = results.filter(r => r.status === 'fulfilled').length;
  const failed = results.filter(r => r.status === 'rejected').length;
  
  console.log(`Deleted ${successful} posts, ${failed} failed`);
  
  return results;
}

// Delete multiple posts
await deleteMultiplePosts([
  'post-123',
  'post-124',
  'post-125'
]);

Error Responses

401
Unauthorized
Invalid or missing API key
{
  "msg": "Invalid API key"
}
404
Not Found
Post ID not found or already deleted
{
  "statusCode": 404,
  "message": "Post not found",
  "error": "Not Found"
}
403
Forbidden
Post belongs to a different organization
{
  "statusCode": 403,
  "message": "Access denied",
  "error": "Forbidden"
}

Behavior Notes

Deleting a scheduled post cancels its publication. The post will not be sent to the social media platform.
You cannot delete posts that have already been published to social media platforms. The API only manages scheduled and draft posts.
Draft posts can be deleted at any time without affecting published content.
When you delete a post by ID, all posts in the same group are deleted. This includes posts scheduled for different platforms.

Safety Considerations

Deletion is permanent. There is no way to recover deleted posts. Always confirm the post ID before deletion.

Safe Deletion Pattern

const postiz = new Postiz('YOUR_API_KEY');

// 1. Get the post details first
const posts = await postiz.postList({
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-12-31T23:59:59Z'
});

const postToDelete = posts.posts.find(p => p.id === 'post-123');

// 2. Confirm it's the right post
if (postToDelete) {
  console.log('Deleting post:', postToDelete.content);
  console.log('Platforms:', postToDelete.integration.name);
  
  // 3. Delete
  await postiz.deletePost(postToDelete.id);
  console.log('Post deleted');
} else {
  console.log('Post not found');
}

Next Steps

List Posts

Get post IDs before deletion

Create Post

Schedule a new post

Build docs developers (and LLMs) love