GET/v1/accounts
List connected social accounts with status, follower counts, and token expiry.
POST/v1/posts
Create a post. targets = account IDs; media = media IDs or public URLs (JPEG images, MP4/MOV video). post_type: feed (1 image), reel (1 video, optional share_to_feed), story (1 item, no caption shown), carousel (2–10 items) — omitted, it's inferred (stories never inferred). Omit schedule_at to publish now; a future ISO 8601 time schedules it.
curl -X POST https://<your-api-url>/v1/posts \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8f3c1e2a" \
-d '{
"targets": ["<account_id>"],
"caption": "Fall drop is live — link in bio.",
"media": ["https://cdn.example.com/fall-drop.jpg"],
"schedule_at": "2026-08-04T18:30:00Z"
}'GET/v1/posts
List posts, newest first. Query params: status (draft|scheduled|publishing|published|partly|failed|cancelled), limit (1–100, default 20), cursor. The response includes next_cursor when more pages exist — pass it back as cursor.
GET/v1/posts/:id
Fetch one post with its per-target delivery timeline: status, Instagram post ID, permalink, and the exact error code/message when a target failed.
PATCH/v1/posts/:id
Edit a draft or scheduled post — caption and/or schedule_at. Posts that started publishing can't be edited.
DELETE/v1/posts/:id
Cancel a draft or scheduled post before it publishes.
POST/v1/media
Ingest media from a public URL into Relay's storage and get a reusable media ID. JPEG images up to 8MB (Instagram limit; 4:5–1.91:1 aspect for feed/carousel), MP4/MOV video up to 100MB.
curl -X POST https://<your-api-url>/v1/media \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://cdn.example.com/fall-drop.jpg" }'