Posts

Delete Post

Cancels a post that has not been published yet, or deletes a published post from the platform, all posts of its thread included. The post stays in Onepostly with status cancelled or deleted. Deleting an X post is charged to the wallet.

DELETE
/v1/posts/{id}

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length

Response Body

The cancelled or deleted post

application/json
  1. response
id*string
groupId*|

Shared by the posts one Create Post request made. Null for posts published outside Onepostly.

accountId*string
platform*|

The platform id. New platforms can be added, so handle a value you do not know.

source*string

external for a post the account published outside Onepostly.

Value in"onepostly""external"
status*|

scheduled waits for scheduledFor. publishing is on its way to the platform. published, failed, cancelled and deleted are final. New values can be added, so handle a value you do not know.

text*|

The post's text. Null for posts published outside Onepostly.

mediaKind*|

What the post is. An Instagram video post reads reel, because Instagram publishes it as a reel.

media*array<>

The post's media files, in order.

thread*array<>

Replies published under the first post, in order.

scheduledFor*|

Local date and time of the schedule in timezone. Null when not scheduled.

timezone*|

IANA timezone of scheduledFor. Null when not scheduled.

options*

The platform options the post was created with, under the post's platform key as in Create Post. Only that one key is present. Empty when the post has no options, such as a post made outside Onepostly. New platforms can be added, so ignore a key you do not know.

platformPostId*|

The platform's own id for the post. Null until it is published.

url*|

Public link to the post on the platform.

error*|

Why the post failed. Null otherwise.

publishedAt*|

When the post went live on the platform. Null until then.

Formatdate-time
metrics*|

Lifetime metrics, or null before the first reading.

createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
import { Configuration, PostsApi } from "@onepostly/sdk";const postsApi = new PostsApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await postsApi.deletePost({  id: "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73",});console.log(response);
Example Response
{  "id": "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73",  "groupId": "grp_7d2e5b1a9c4f4a68b3e07f1c2d9a6e45",  "accountId": "acc_YOUR_FACEBOOK_ACCOUNT_ID",  "platform": "facebook",  "source": "onepostly",  "status": "deleted",  "text": "New release notes are up.",  "mediaKind": "text",  "media": [],  "thread": [],  "scheduledFor": null,  "timezone": null,  "options": {},  "platformPostId": "104987654321098_122134567890123456",  "url": "https://www.facebook.com/yourbrand/posts/pfbid02Xk8c7rFqZJ1nT5sV9wYbLmQe3hGdR6uAoPiK4zCxN2",  "error": null,  "publishedAt": "2027-03-15T09:00:04.000Z",  "metrics": {    "impressions": 1234,    "reach": 987,    "likes": 123,    "comments": 12,    "shares": 4,    "saves": null,    "views": 456,    "engagement": 139  },  "createdAt": "2027-03-15T09:00:00.000Z",  "updatedAt": "2027-03-16T09:00:00.000Z"}