POST/v1/posts

Create post

Create a draft, schedule for later, or publish immediately to one or more connected accounts.

Request

bashยทcURL
curl -X POST "https://YOUR_PROJECT.supabase.co/functions/v1/public-api/v1/posts" \
  -H "Authorization: Bearer px_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{   "caption": "Hello from the API ๐Ÿ‘‹ #postaxis",   "media": ["user-uuid/api/slide-1.png"],   "social_accounts": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],   "scheduled_at": "2026-06-22T14:00:00Z",   "is_draft": false }'

Body

NameTypeDescription
captionstringPost text. Alias: `body`.
mediastring[]Storage paths from the upload step (`media_id` values). Order is preserved for carousels.
social_accountsrequiredstring[]Account UUIDs from `GET /v1/social-accounts`.
scheduled_atstring | nullISO 8601 UTC datetime, e.g. `2026-06-22T14:00:00Z`. Omit for immediate publish.
is_draftboolean`true` saves a draft and does not publish.
jsonยทExample body
{
  "caption": "Hello from the API ๐Ÿ‘‹ #postaxis",
  "media": ["user-uuid/api/slide-1.png"],
  "social_accounts": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
  "scheduled_at": "2026-06-22T14:00:00Z",
  "is_draft": false
}

Response

jsonยท200 OK
{
  "id": "post-uuid",
  "status": "scheduled",
  "caption": "Hello from the API ๐Ÿ‘‹ #postaxis",
  "media": ["https://โ€ฆ/storage/v1/object/public/images/โ€ฆ"],
  "social_accounts": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
  "scheduled_at": "2026-06-22T14:00:00Z",
  "is_draft": false
}