# Quickstart

:::tip[Using an AI assistant?]
You don't need any of this: [connect the MCP server](/agents/mcp/) and ask it to schedule the post.
:::

1. **Create a key.** In PostFlow, open **Settings → Integrations → API & MCP**, name the key (`n8n`, `my-script`), keep
   **Full access** selected and create it. Copy it now: it's shown once.

   ```sh
   export POSTFLOW_API_KEY=pf_...
   ```

2. **Check the workspace.** `/me` returns its name, time zone and plan.

   ```sh
   curl https://postflow.biz.id/api/v1/me \
     -H "Authorization: Bearer $POSTFLOW_API_KEY"
   ```

   ```json
   {
     "workspace": { "id": "ws_…", "name": "Kopi Senja", "timezone": "Asia/Jakarta", "approvalRequired": false },
     "subscription": { "status": "active", "plan": "Starter", "endsAt": "2026-11-30T16:59:59.000Z" },
     "limits": { "workspaces": 1, "socialAccounts": 3, "postsPerMonth": 60, "members": 1, "storageBytes": 2147483648 },
     "member": { "id": "u_…", "name": "Rani", "role": "owner" },
     "credential": { "type": "api_key", "name": "my-script", "scope": "write" }
   }
   ```

3. **List the accounts.** Each one lists the content types it can publish.

   ```sh
   curl https://postflow.biz.id/api/v1/accounts \
     -H "Authorization: Bearer $POSTFLOW_API_KEY"
   ```

   ```json
   [
     { "id": "acc_ig", "platform": "instagram", "name": "Kopi Senja", "username": "kopisenja", "avatarUrl": null,
       "status": "active", "error": null, "contentTypes": ["ig_image", "ig_carousel", "ig_reel", "ig_story"] }
   ]
   ```

4. **Bring in a photo.** PostFlow downloads it from a public `https://` URL and returns its id. (Or
   [upload the bytes](/guides/media/#upload-a-file).)

   ```sh
   curl https://postflow.biz.id/api/v1/media \
     -H "Authorization: Bearer $POSTFLOW_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "url": "https://example.com/promo-oktober.jpg" }'
   ```

5. **Schedule the post.** One target per account, with a content type that account supports. Check it first with
   [`POST /posts/validate`](/api/operations/validatepost/) if you like: same body.

   ```sh
   curl https://postflow.biz.id/api/v1/posts \
     -H "Authorization: Bearer $POSTFLOW_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "caption": "Es kopi gula aren, diskon 20% sampai Minggu ☕",
       "mediaIds": ["MEDIA_ID"],
       "targets": [{ "socialAccountId": "acc_ig", "contentType": "ig_image", "options": { "firstComment": "#kopi #promo" } }],
       "action": "schedule",
       "scheduledAt": "2026-11-03T09:00:00+07:00"
     }'
   ```

   The response is the post with `status: "scheduled"`. It's on the PostFlow calendar right away.

## Next

- Not sure about the time? Send `"useNextSlot": true` instead of `scheduledAt` to use the [queue](/guides/posts/#queue-slots).
- Get told when it goes live: add a [webhook](/guides/webhooks/) for `post.published`.
- Everything a post can carry: [Creating and scheduling posts](/guides/posts/).