Quickstart
Five steps from a fresh API key to a scheduled post.
Every request below runs against the live API. The dry run in step 3 is free and persists nothing, so you can walk the whole flow safely.
Create a scoped API key
In Settings → API Keys, create
a key with the posts:write scope. The secret shows once, so copy it now.
export XREPLY_API_KEY="<your-api-key>"Find your account IDs
Call GET /social_accounts to list the channels you've connected and grab
their IDs. (This needs the accounts:read scope on your key.)
curl https://api.xreplyai.com/api/v1/social_accounts \
-H "Authorization: Bearer $XREPLY_API_KEY"Dry-run the post
Send POST /posts with dry_run: true to validate content, limits, and
scheduling, without anything going live.
curl -X POST https://api.xreplyai.com/api/v1/posts \
-H "Authorization: Bearer $XREPLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true,
"social_account_ids": [123],
"post_contents": [{ "platform": "twitter", "body": "Hello from the XreplyAI API 👋" }],
"use_next_slot": true
}'The response carries dry_run: true. The post was validated end to end but
not persisted.
Queue it for the next slot
Drop dry_run and keep use_next_slot: true to schedule the post at the
next open slot on your posting schedule.
curl -X POST https://api.xreplyai.com/api/v1/posts \
-H "Authorization: Bearer $XREPLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"social_account_ids": [123],
"post_contents": [{ "platform": "twitter", "body": "Hello from the XreplyAI API 👋" }],
"use_next_slot": true
}'Read it back
Call GET /posts to confirm it's queued. Once published, each account in
post_accounts carries a permalink to the live post.
curl "https://api.xreplyai.com/api/v1/posts?status=scheduled" \
-H "Authorization: Bearer $XREPLY_API_KEY"Where to go next
- Scheduling: drafts, exact times, queue slots, recurrence, and dry runs
- Platforms: platform keys, character limits, and what each platform supports
- Media: attaching images, video, and documents
- API Reference: every endpoint with an interactive playground