Quickstart
Connect a social account and publish your first post in five steps.
Postkey is one REST API for posting to X, Instagram, Facebook, TikTok, LinkedIn, YouTube, YouTube Shorts, Pinterest and Google Business. You connect accounts once, then publish or schedule to any of them with the same request.
X opens first, around 1 Dec 2026. LinkedIn is next, then the other networks as each one approves our app. This guide uses X so you can run every step on day one. See Platforms.
Base URL
https://api.postkey.dev/v1Every request sends your project key in the x-access-key header. See Authentication.
Create a profile (optional)
A profile is a label for one of your clients or brands. It keeps their accounts together. Skip this if you only post for yourself.
curl -X POST https://api.postkey.dev/v1/profiles \
-H "x-access-key: $POSTKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Acme Co" }'{ "id": "prof_acme", "name": "Acme Co", "createdAt": "2026-11-30T10:00:00Z" }Get a connect link
Ask for a connect URL for one platform and send your user to it. They sign in on the network's own screen and approve access.
curl "https://api.postkey.dev/v1/connect/twitter?profileId=prof_acme&redirectUri=https%3A%2F%2Fyourapp.com%2Fconnected" \
-H "x-access-key: $POSTKEY_API_KEY"{ "url": "https://x.com/i/oauth2/authorize?client_id=…&state=…" }When they finish, Postkey stores the tokens, keeps them fresh and sends the user back to your redirectUri.
Get the account id
curl "https://api.postkey.dev/v1/connect/integrations?profileId=prof_acme" \
-H "x-access-key: $POSTKEY_API_KEY"{
"success": true,
"total": 1,
"integrations": [
{
"id": "int_x_789",
"platform": "twitter",
"username": "acmeco",
"displayName": "Acme Co",
"profileId": "prof_acme",
"appId": null,
"byok": false,
"authStatus": "active",
"createdAt": "2026-11-30T10:04:12Z"
}
]
}The id is the accountId you post with.
Publish
curl -X POST https://api.postkey.dev/v1/posts \
-H "x-access-key: $POSTKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Hello world!",
"platforms": [
{ "platform": "twitter", "accountId": "int_x_789" }
],
"publishNow": true
}'{
"success": true,
"postId": "post_8f21c",
"status": "published",
"platforms": [
{ "platform": "twitter", "accountId": "int_x_789", "success": true, "platformPostUrl": "https://x.com/acme/status/…" }
]
}This post costs 5 credits, because X charges per post (50 if the text has a link). Most other networks cost 1. See Credit usage.
Post to several accounts at once by adding more items to platforms. Each one gets its own result, and if one fails the others still go out. See Publishing.
Schedule
Swap publishNow for a time and a time zone.
{
"content": "Doors open at 9. See you there.",
"platforms": [{ "platform": "twitter", "accountId": "int_x_789" }],
"scheduledFor": "2026-12-01T09:00:00",
"timezone": "America/New_York"
}See Scheduling to list, move or cancel scheduled posts.
Next steps
- Get told when posts finish: Webhooks
- Upload your own files: Media upload
- What each call costs: Credit usage
- Every endpoint and field: API reference