Posts

Sync External Posts

Fetches posts that an account published directly on the platform, outside Onepostly. Pass url or postId to find one post, or omit both to refresh the account's recent posts.

POST
/v1/posts/sync-external

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
accountId*string

Id of the connected account whose posts to sync.

Length1 <= length
url?string

URL of a single post to find. Omit both url and postId to refresh recent posts instead.

Formaturi
postId?string

Platform id of a single post to find. Use it instead of url.

Length1 <= length

Response Body

Sync result

application/json
  1. response
synced*
found?boolean

Whether the post was found. Present only when url or postId is sent.

post?|

The post that was found, or null. Present only when url or postId is sent.

posts?array<>

The account's recent posts. Present only when url and postId are omitted.

Example Request
import { Configuration, PostsApi } from "@onepostly/sdk";const postsApi = new PostsApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await postsApi.syncExternal({  syncExternalBody: {    "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5"  },});console.log(response);
Example Response
{  "synced": {    "postsFound": 1,    "postsSynced": 1,    "skipped": false  },  "found": true,  "post": {    "id": "e8f9a0b1-c2d3-4e5f-8a6b-c7d8e9f0a1b2",    "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",    "platform": "threads",    "externalPostId": "DbNQAb8ABC1",    "externalUrl": "https://www.threads.com/@you/post/DbNQAb8ABC1",    "mediaKind": "text",    "publishedAt": "2026-08-25T10:00:00.000Z",    "syncedAt": "2026-08-25T10:00:00.000Z",    "analyticsStatus": "ready"  },  "posts": [    {      "id": "e8f9a0b1-c2d3-4e5f-8a6b-c7d8e9f0a1b2",      "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",      "platform": "threads",      "externalPostId": "DbNQAb8ABC1",      "externalUrl": "https://www.threads.com/@you/post/DbNQAb8ABC1",      "mediaKind": "text",      "publishedAt": "2026-08-25T10:00:00.000Z",      "syncedAt": "2026-08-25T10:00:00.000Z",      "analyticsStatus": "ready"    }  ]}