Get started

Quickstart

From zero to a live post in four steps. Every call uses your API key as a Bearer token.

1. Get an API key

Create a key from the API Keys page in your dashboard. It's shown once โ€” save it somewhere safe. Then check it works:

# Validate your key
curl https://api.postlake.dev/v1/me \
  -H "Authorization: Bearer YOUR_API_KEY"

2. See your connected accounts

Connect your social accounts in the dashboard first. Then list them โ€” each has an id like acc_โ€ฆ and a platform:

curl https://api.postlake.dev/v1/social-accounts \
  -H "Authorization: Bearer YOUR_API_KEY"

3. Publish a post

One call publishes to every account you list. Give it text and the account ids:

curl -X POST https://api.postlake.dev/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello from PostLake ๐Ÿ‘‹",
    "accounts": ["acc_123", "acc_456"]
  }'

The response is the same shape for every platform โ€” one post id, and a target per account telling you exactly what happened and where:

{
  "id": "post_a1b2c3",
  "state": "published",
  "targets": [
    { "platform": "bluesky", "state": "published", "url": "https://bsky.app/โ€ฆ" },
    { "platform": "threads", "state": "published", "url": "https://threads.net/โ€ฆ" }
  ]
}
One target can fail (e.g. over a character limit) while the others succeed โ€” you see it per-target, and you're only charged for targets that actually publish.

4. Add an image

Upload the media, then reference the returned id in your post. Full detail in Media & images.

# upload returns { "id": "med_โ€ฆ" }
curl -X POST https://api.postlake.dev/v1/media \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg

What's next