XPlanner

Docs

Create post

Creates drafts, schedules, or queues publishing with shared or platform-specific text and media for X, LinkedIn, and Threads targets.


POST

/posts

posts:create, posts:write (eski uyumluluk), posts:publish (publish_now only)

Header'lar

Authorization

*
string

API key. Format: Bearer xpl_live_...

Idempotency-Key

*
string

Unique value of 1-255 characters to safely retry the same write request.

Content-Type

string

Use application/json when sending JSON body.

Body

accountId

string

Backward-compatible account id for legacy X-only clients.

workspaceId

string

The Social Set's workspace id in the new contract.

socialSetId

string

Social Set id from the GET /social-sets response.

publishTargets

object[]

At least one target. Each item includes socialAccountId, platform, and optional textOverride, mediaRefs, and mediaMetadata.

text

*
string

Shared post text. Each target is validated against its own platform limit; textOverride supplies target-specific text. URLs are not allowed.

mode

*
string

draft, scheduled veya publish_now.

scheduledAt

string

Mandatory ISO date for mode=scheduled. It must be in the future. It is automatically assigned for publish_now.

title

string

Optional title. Default API Post.

mediaRefs

string[]

Media references or public storage URLs from the XPlanner storage bucket.

mediaMetadata

object[]

Media metadata fields such as altText in the same order as mediaRefs. Alt text is maximum 1000 characters.

Mode values

draft

201

Creates an unscheduled draft. scheduledAt is not required and nothing is sent to a publish target.

scheduled

201

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

202

posts:publish requires scope. The request is accepted immediately and the sharing job is placed in the broadcast queue.

Instant publishing limits

POST /posts

10/dk
120/saat

It is the endpoint write limit applied to the post creation endpoint.

publish_now

3/dk
30/saat

An additional limit applied to push requests of the same API key.

Sosyal Set

5/10 dk

An additional limit applied to instant publish requests for the same Social Set.

Media rules

mediaRefs

storage

Media references or public storage URLs from the XPlanner storage bucket are accepted.

X

platform kuralı

Up to four images or one GIF; a GIF cannot be mixed with other media.

LinkedIn

platform kuralı

Image/GIF carousels and single videos are validated against LinkedIn limits.

Threads

platform kuralı

Image and video carousels are supported; GIF is not accepted as a publish target.

mediaMetadata

same row

Metadata fields such as alt text are sent in the same order as mediaRefs. Alt text is maximum 1000 characters.

Cevaplar

201

A draft or scheduled post has been created.

202

The publish_now request has been accepted and placed in the publication queue.

403

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"}