XPlanner

Docs

Create post

Creates a draft, plans for the future, or instantly queues the post for publication with publish_now mode.


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

The XPlanner account ID to which the post will be linked.

text

*
string

Post text. Standard X accounts can use up to 280 weighted characters; X Premium/verified accounts can use up to 25,000 characters. 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 unplanned draft. scheduledAt is not required and the post is not forwarded to X.

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.

X hesabı

5/10 dk

It is an additional account-based limit applied to instant broadcast requests for the same X account.

Media rules

mediaRefs

storage

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

görsel

en fazla 4

A maximum of 4 images can be added to the post.

GIF

tek dosya

A single GIF can be used in GIF posts and cannot be mixed with images.

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 '{    "accountId": "acc_123",    "mode": "scheduled",    "scheduledAt": "2026-05-20T09:00:00.000Z",    "title": "Haftalık güncelleme",    "text": "Bu hafta ürün tarafında şunları çözdük..."  }'

Cevap

{  "data": {    "id": "post_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,    "createdAt": "2026-05-15T09:00:00.000Z",    "updatedAt": "2026-05-15T09:00:00.000Z"  },  "requestId": "req_123"}