Skip to main content
DELETE
/
v1
/
posts
curl -X DELETE "https://api.infinipost.co/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postIds": ["post_abc123", "post_def456"]
  }'
{
  "deleted": ["post_abc123", "post_def456"],
  "failed": [],
  "deletedAt": "2024-04-21T20:20:00Z"
}
Only posts with a status of generated or pending_render can be deleted. Posts that have already been posted cannot be deleted.

Request Body

postIds
array
required
Array of post IDs to delete. You can delete a single post or multiple posts in one request.

Response

deleted
array
Array of post IDs that were successfully deleted.
failed
array
Array of objects for any post IDs that could not be deleted, with a reason for each.
deletedAt
string
ISO 8601 timestamp of when the deletion was processed.
curl -X DELETE "https://api.infinipost.co/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postIds": ["post_abc123", "post_def456"]
  }'
{
  "deleted": ["post_abc123", "post_def456"],
  "failed": [],
  "deletedAt": "2024-04-21T20:20:00Z"
}

Error Responses

Unauthorized
{
  "error": {
    "code": "unauthenticated",
    "message": "Invalid or missing API key"
  }
}
Missing Required Fields
{
  "error": {
    "code": "missing_required_fields",
    "message": "postIds is required and must be a non-empty array"
  }
}
Server Error
{
  "error": {
    "code": "internal",
    "message": "An unexpected error occurred"
  }
}