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.

PATCH
/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

Request Body

application/json
  1. body
text?string

Replaces the post text. The account's platform limit applies. A longer text returns VALIDATION_ERROR.

Lengthlength <= 63206
mediaKind?string

What the media is. Omit it to keep the current kind, or to have it worked out again from new media.

Value in"text""image""multi_image""video""reel""document""stories"
media?array<>

Replaces the media files, in order.

Itemsitems <= 35
thread?array<>

Replaces the thread. Send an empty list to remove it.

Itemsitems <= 25
scheduledFor?string

New 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.

Length1 <= length <= 32
timezone?string

IANA timezone of scheduledFor, such as America/New_York. Omit it to keep the post's timezone.

Length1 <= length <= 64
options?

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.

Response Body

Updated 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.updatePost({  id: "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73",  updatePostBody: {    "scheduledFor": "2027-03-16T09:00:00",    "options": {      "instagram": {        "firstComment": "Register at the link in our profile."      }    }  },});console.log(response);
Example 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"}