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.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthThe cancelled or deleted post
application/json- response
id*stringgroupId*|Shared by the posts one Create Post request made. Null for posts published outside Onepostly.
accountId*stringplatform*|The platform id. New platforms can be added, so handle a value you do not know.
source*stringexternal for a post the account published outside Onepostly.
"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.
date-timemetrics*|Lifetime metrics, or null before the first reading.
createdAt*stringdate-timeupdatedAt*stringdate-timeimport { 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);{ "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"}Update Post
Edits a scheduled post. Only the fields you send change, and the result is checked like a new post. Editing a post that shares its group with posts on other accounts gives it a groupId of its own.
Sync Account Posts
Finds posts the account published on the platform, outside Onepostly, and adds them to your posts with source external. Send url or platformPostId to find one post, or neither to sync the account's 20 most recent posts.