Accounts

List Account Media

Lists the account's posts on the platform, newest first, for X, Instagram, Facebook, Threads, TikTok, YouTube and Bluesky. The first page also includes the account's recent posts published through Onepostly. A count or length the platform does not report is null. Instagram also lists active stories with kind stories.

GET
/v1/accounts/{id}/media

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer

Items per page. Defaults to 20. Maximum 20.

Range1 <= value <= 20
Default20
cursor?string

The nextCursor of the previous page. Omit it for the first page.

Length1 <= length
kind?string

What to list. Defaults to media. stories is Instagram only.

Value in"media""stories"

Response Body

Media

application/json
  1. response
data*array<>
nextCursor*|

Cursor for the next page, or null on the last page.

hasMore*boolean

True when another page follows this one.

Example Request
import { Configuration, AccountsApi } from "@onepostly/sdk";const accountsApi = new AccountsApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await accountsApi.listAccountMedia({  id: "acc_YOUR_X_ACCOUNT_ID",});console.log(response);
Example Response
{  "data": [    {      "id": "1900912345678901234",      "title": "Watch the 90-second walkthrough. https://t.co/Xk4p9QmZ2v",      "description": "Watch the 90-second walkthrough. https://t.co/Xk4p9QmZ2v",      "coverUrl": "https://pbs.twimg.com/amplify_video_thumb/1900912345678901234/img/Qm3nX8kP2rT5vW7y.jpg",      "url": "https://x.com/yourbrand/status/1900912345678901234",      "createdAt": "2027-03-14T16:30:12.000Z",      "durationSec": 90,      "metrics": {        "likes": 86,        "comments": 9,        "shares": 14,        "views": 5210      }    },    {      "id": "1900893456789012345",      "title": "Ship day in 4 frames. https://t.co/Rb7nL2wQ8s",      "description": "Ship day in 4 frames. https://t.co/Rb7nL2wQ8s",      "coverUrl": "https://pbs.twimg.com/media/GkT3bQxWcAAz9Lp.jpg",      "url": "https://x.com/yourbrand/status/1900893456789012345",      "createdAt": "2027-03-14T11:05:47.000Z",      "durationSec": null,      "metrics": {        "likes": 42,        "comments": 3,        "shares": 5,        "views": 2318      }    }  ],  "nextCursor": "7140dibdnow9c7btw4b0ld1ak2pzz6c1c2zuh0xb5c9yd",  "hasMore": true}