Get started
Quickstart
Create an API key, connect X, and schedule your first post.
You need a PostPiper account and a connected X account. Publishing and scheduling through the API currently support X only.
Base URL: https://api.postpiper.ai/v1
1. Create an API key
Open API Keys, create a key, and copy it. Store the full key now; it is shown only once.
Set it in your terminal for the requests below:
export POSTPIPER_API_KEY="<your-api-key>"Keep this key private. Requests use it in the Authorization: Bearer header.
2. Connect an account
Go to Accounts and connect X. Account connection happens in the dashboard.
3. Get the account ID
List your connected X accounts. Copy the id from the response.
curl -H "Authorization: Bearer $POSTPIPER_API_KEY" \
"https://api.postpiper.ai/v1/accounts?platform=x"An empty list means you need to connect an account first.
4. Create a draft
Replace <account-uuid> with your account ID. Save the returned post.id.
curl -X POST "https://api.postpiper.ai/v1/posts" \
-H "Authorization: Bearer $POSTPIPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_id":"<account-uuid>","content":"Hello from PostPiper"}'The response is a draft. It has not been published yet.
5. Schedule the post
Replace <post-uuid> and choose a future time with a time zone.
curl -X POST "https://api.postpiper.ai/v1/posts/<post-uuid>/schedule" \
-H "Authorization: Bearer $POSTPIPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduled_at":"2030-10-13T09:00:00+08:00"}'Use your own future date. The response stores the time in UTC.
6. Check the status
Fetch the post to see its current status and scheduled time.
curl -H "Authorization: Bearer $POSTPIPER_API_KEY" \
"https://api.postpiper.ai/v1/posts/<post-uuid>"Look for status: "scheduled". After publishing, the status becomes published.