Posts

List Posts

Lists the workspace's posts, newest first by default. Results are paginated.

GET
/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.

Query Parameters

limit?integer

Number of posts per page. Defaults to 20.

Range1 <= value <= 100
page?integer

Page to return, starting at 1. Defaults to 1.

Range1 <= value
status?string

Comma-separated post statuses to include, such as scheduled,published. Omit to include every status.

platform?string

Only posts with at least one destination on this platform.

Length1 <= length
accountId?string

Only posts with at least one destination on this account.

Length1 <= length
dateAfter?string

Start of the date range, as an ISO 8601 time. A post's date is its scheduled time, or its creation time when it has none.

Formatdate-time
dateBefore?string

End of the date range, as an ISO 8601 time.

Formatdate-time
sort?string

Sort order. Defaults to created_desc. Metric sorts rank posts by lifetime totals across destinations and return only posts with metrics.

Value in"created_desc""created_asc""scheduled_desc""scheduled_asc""status""platform""metric:engagement""metric:likes""metric:comments""metric:shares""metric:views""metric:impressions""metric:reach""metric:saves"

Response Body

Posts

application/json
  1. response
posts*array<>
total*number

Total posts that match the filters, across all pages.

page*integer

Page number of this response, starting at 1.

hasMore*boolean

True when more posts follow this page. Request the next page to get them.

facets*

Post counts per status and per platform for the current filters.

Example Request
import { Configuration, PostsApi } from "@onepostly/sdk";const postsApi = new PostsApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await postsApi.listPosts({  limit: 20,  page: 2,  platform: "instagram",});console.log(response);
Example Response
{  "posts": [    {      "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"    }  ],  "total": 0,  "page": 1,  "hasMore": true,  "facets": {    "status": [      {        "status": "string",        "count": 0      }    ],    "platform": [      {        "platform": "string",        "count": 0      }    ]  }}