Posts
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.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthapplication/json- body
text?stringReplaces the post text. The account's platform limit applies. A longer text returns VALIDATION_ERROR.
length <= 63206mediaKind?stringWhat the media is. Omit it to keep the current kind, or to have it worked out again from new media.
"text""image""multi_image""video""reel""document""stories"media?array<>Replaces the media files, in order.
items <= 35thread?array<>Replaces the thread. Send an empty list to remove it.
items <= 25scheduledFor?stringNew local date and time to publish, such as 2027-03-15T09:00:00, without Z or an offset. It must be at least a minute ahead. Omit it to keep the current schedule.
1 <= length <= 32timezone?stringIANA timezone of scheduledFor, such as America/New_York. Omit it to keep the post's timezone.
1 <= length <= 64options?Options under the post's platform key, as in Create Post, such as tiktok for a TikTok post. Only the options you send change. Send null to remove one. A key of another platform returns VALIDATION_ERROR.
Updated 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.updatePost({ id: "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73", updatePostBody: { "scheduledFor": "2027-03-16T09:00:00", "options": { "instagram": { "firstComment": "Register at the link in our profile." } } },});console.log(response);{ "id": "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73", "groupId": "grp_7d2e5b1a9c4f4a68b3e07f1c2d9a6e45", "accountId": "acc_YOUR_INSTAGRAM_ACCOUNT_ID", "platform": "instagram", "source": "onepostly", "status": "scheduled", "text": "Join our product webinar next week.", "mediaKind": "text", "media": [], "thread": [], "scheduledFor": "2027-03-16T09:00:00", "timezone": "America/New_York", "options": { "instagram": { "firstComment": "Register at the link in our profile." } }, "platformPostId": null, "url": null, "error": null, "publishedAt": null, "metrics": null, "createdAt": "2027-03-15T09:00:00.000Z", "updatedAt": "2027-03-15T10:00:00.000Z"}