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
header
x-api-key<token>Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.
application/json- body
accountId*stringId of the connected account whose posts to sync.
Length
1 <= lengthurl?stringURL of a single post to find. Omit both url and postId to refresh recent posts instead.
Format
uripostId?stringPlatform id of a single post to find. Use it instead of url.
Length
1 <= lengthSync result
application/json- response
synced*found?booleanWhether 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" } ]}