Posts

Create Post

Creates a post for one or more connected accounts. Returns 202 when it publishes now and 201 when it is scheduled.

POST
/v1/posts

Authorization

headerx-api-key<token>

Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.

Request Body

application/json
  1. body
text?string
Lengthlength <= 63206
Default""
threadItems?array<>

X, Threads and Bluesky only. Replies published under the post, in order.

Items1 <= items <= 25
mediaUrls?array<>
Itemsitems <= 35
Default[]
mediaKind*MediaKind
Value in"text""image""multi-image""video""reel""document""stories"
scheduledFor?string

Local date and time to publish, such as 2027-03-15T09:00:00, without Z or an offset. Omit to publish now.

Length1 <= length <= 32
timezone?string

IANA timezone for scheduledFor, such as America/New_York. Defaults to UTC.

Length1 <= length <= 64
destinations*array<>
Items1 <= items <= 50

Response Body

Post scheduled

application/json
  1. response
post*
Example Request
import { Configuration, PostsApi } from "@onepostly/sdk";const postsApi = new PostsApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await postsApi.createPost({  createPostBody: {    "text": "Ship day",    "mediaUrls": [      "https://cdn.onepostly.com/media/product.jpg"    ],    "mediaKind": "image",    "destinations": [      {        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5"      }    ]  },});console.log(response);
Example Response
{  "post": {    "id": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",    "text": "Ship day",    "mediaUrls": [      "https://cdn.onepostly.com/media/product.jpg"    ],    "mediaKind": "image",    "status": "draft",    "scheduledFor": "2027-03-15T09:00:00",    "timezone": "America/New_York",    "destinations": [      {        "id": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",        "platform": "x",        "status": "draft",        "externalPostId": "17895695668004550",        "externalUrl": "https://x.com/you/status/17895695668004550",        "errorCode": "string",        "errorMessage": "string",        "publishedAt": "2026-08-25T10:00:00.000Z",        "metrics": {          "impressions": 0,          "reach": 0,          "likes": 0,          "comments": 0,          "shares": 0,          "saves": 0,          "plays": 0,          "engagement": 0        }      }    ],    "createdAt": "2026-08-25T10:00:00.000Z",    "updatedAt": "2026-08-25T10:00:00.000Z"  }}