Posts
Sync Account Posts
Finds posts the account published on the platform, outside Onepostly, and adds them to your posts with source external. Send url or platformPostId to find one post, or neither to sync the account's 20 most recent posts.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthIdempotency-Key?stringA unique key, such as a UUID, that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the first response instead of acting again. A 429 or 5xx response is not kept, so a retry with the same key runs again.
1 <= length <= 255application/json- body
url?stringLink to one post on the platform.
uriplatformPostId?stringThe platform's id for one post.
1 <= lengthSynced posts
application/json- response
data*array<>The account's recent posts, or the one post that was found. Empty when a url or platformPostId matched nothing among the 20 most recent posts.
skipped*booleantrue when the account was synced in the last 15 seconds, so only posts Onepostly already knows are returned.
import { Configuration, PostsApi } from "@onepostly/sdk";const postsApi = new PostsApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await postsApi.syncAccountPosts({ id: "acc_YOUR_THREADS_ACCOUNT_ID", syncAccountPostsBody: { "url": "https://www.threads.com/@yourbrand/post/DbNQAb8ABC1" },});console.log(response);{ "data": [ { "id": "pst_3c8a2d6e91b44f7a8e250d6b4c1f9a73", "groupId": null, "accountId": "acc_YOUR_THREADS_ACCOUNT_ID", "platform": "threads", "source": "external", "status": "published", "text": null, "mediaKind": "text", "media": [], "thread": [], "scheduledFor": null, "timezone": null, "options": {}, "platformPostId": "18047285913046723", "url": "https://www.threads.com/@yourbrand/post/DbNQAb8ABC1", "error": null, "publishedAt": "2027-03-14T18:30:00.000Z", "metrics": null, "createdAt": "2027-03-15T10:00:00.000Z", "updatedAt": "2027-03-15T10:00:00.000Z" } ], "skipped": false}