Docs menuQuickstart

Quickstart

1. Create a key

Create a key in Postory: Settings → API keys. It is shown once; keep it in an environment variable.

2. Check the key

Check it: the answer names your account and what the key may do.

Terminal
curl https://postory.io/api/v1/me \
  -H "Authorization: Bearer $POSTORY_API_KEY"

3. List your accounts

List the accounts you connected; each has a connection_id:

Terminal
curl https://postory.io/api/v1/accounts \
  -H "Authorization: Bearer $POSTORY_API_KEY"

4. Save your first draft

Terminal
curl https://postory.io/api/v1/posts \
  -H "Authorization: Bearer $POSTORY_API_KEY" \
  -H "Idempotency-Key: <unique-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [{"text": "Hello from the Postory API"}],
    "mode": "draft",
    "connection_ids": ["<connection_id from accounts>"]
  }'

One connection_id is enough; several make one draft for each account.

Next: read Post modes to schedule, queue or publish it, or the API reference for every call.