/posts
posts:create, posts:write (eski uyumluluk), posts:publish (publish_now only)
Header'lar
Authorization
*API key. Format: Bearer xpl_live_...
Idempotency-Key
*Unique value of 1-255 characters to safely retry the same write request.
Content-Type
Use application/json when sending JSON body.
Body
accountId
Backward-compatible account id for legacy X-only clients.
workspaceId
The Social Set's workspace id in the new contract.
socialSetId
Social Set id from the GET /social-sets response.
publishTargets
At least one target. Each item includes socialAccountId, platform, and optional textOverride, mediaRefs, and mediaMetadata.
text
*Shared post text. Each target is validated against its own platform limit; textOverride supplies target-specific text. URLs are not allowed.
mode
*draft, scheduled veya publish_now.
scheduledAt
Mandatory ISO date for mode=scheduled. It must be in the future. It is automatically assigned for publish_now.
title
Optional title. Default API Post.
mediaRefs
Media references or public storage URLs from the XPlanner storage bucket.
mediaMetadata
Media metadata fields such as altText in the same order as mediaRefs. Alt text is maximum 1000 characters.
Mode values
draft
Creates an unscheduled draft. scheduledAt is not required and nothing is sent to a publish target.
scheduled
Adds a post to the broadcast queue for a future time in the scheduledAt field. scheduledAt is mandatory and must be in the future.
publish_now
posts:publish requires scope. The request is accepted immediately and the sharing job is placed in the broadcast queue.
Instant publishing limits
POST /posts
It is the endpoint write limit applied to the post creation endpoint.
publish_now
An additional limit applied to push requests of the same API key.
Sosyal Set
An additional limit applied to instant publish requests for the same Social Set.
Media rules
mediaRefs
Media references or public storage URLs from the XPlanner storage bucket are accepted.
X
Up to four images or one GIF; a GIF cannot be mixed with other media.
Image/GIF carousels and single videos are validated against LinkedIn limits.
Threads
Image and video carousels are supported; GIF is not accepted as a publish target.
mediaMetadata
Metadata fields such as alt text are sent in the same order as mediaRefs. Alt text is maximum 1000 characters.
Cevaplar
A draft or scheduled post has been created.
The publish_now request has been accepted and placed in the publication queue.
Scope, abonelik veya kota engeli.
cURL
curl -X POST https://api.xplanner.co/v1/posts \ -H "Authorization: Bearer $XPLANNER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: post-001" \ -d '{ "workspaceId": "wrk_123", "socialSetId": "set_123", "mode": "scheduled", "scheduledAt": "2026-08-20T09:00:00.000Z", "title": "Haftalık güncelleme", "text": "Bu hafta ürün tarafında şunları çözdük...", "publishTargets": [ { "socialAccountId": "social_x_123", "platform": "x" }, { "socialAccountId": "social_linkedin_123", "platform": "linkedin", "textOverride": "LinkedIn için ayrıntılı haftalık ürün güncellemesi..." }, { "socialAccountId": "social_threads_123", "platform": "threads" } ] }'Cevap
{ "data": { "id": "post_123", "workspaceId": "wrk_123", "socialSetId": "set_123", "accountId": "acc_123", "status": "scheduled", "title": "Haftalık güncelleme", "text": "Bu hafta ürün tarafında şunları çözdük...", "scheduledAt": "2026-05-20T09:00:00.000Z", "media": [], "mediaRefs": [], "mediaMetadata": [], "xPostId": null, "publishTargets": [ { "platform": "x", "socialAccountId": "social_x_123", "status": "pending" }, { "platform": "linkedin", "socialAccountId": "social_linkedin_123", "status": "pending" }, { "platform": "threads", "socialAccountId": "social_threads_123", "status": "pending" } ], "createdAt": "2026-08-12T09:00:00.000Z", "updatedAt": "2026-08-12T09:00:00.000Z" }, "requestId": "req_123"}