REST API
rly_live_ keys. The growth API (apps, today’s plan, opportunities, Studio, calendar, analytics, experiments, webhooks) takes workspace keys (rly_ws_, Settings → Developers) and has its own reference, generated from its contract: https://api.relay.lantean.tech/v1/docs (OpenAPI 3.1 at https://api.relay.lantean.tech/v1/openapi.json).Base URL & versioning
https://api.relay.lantean.tech/v1
All endpoints live under the /v1 prefix and take and return application/json. Changes within v1 are additive: new fields may appear in responses, new optional request fields may be accepted. Parse responses tolerantly and ignore unknown keys.
snake_case; GET /v1/accounts returns camelCase because it serializes database columns directly. Both are shown verbatim below.Authentication
Every request carries an API key as a bearer token. Create keys in the dashboard under API keys; the full value is displayed once, at creation.
Authorization: Bearer rly_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Keys look like
rly_live_plus 32 random base62 characters (~190 bits of entropy). - Only a SHA-256 hash of the key is stored. Relay cannot show you a key again — rotate by creating a new one and revoking the old.
- One key authorizes both this API and the MCP server, and inherits every account its owner has connected.
- Revocation is immediate. Each key records a
lastUsedAttimestamp so you can spot keys that are safe to retire. - Send the key in the header only — never in a query string, where it would land in logs and referrers.
A missing, malformed, revoked, or unknown key returns 401 with a WWW-Authenticate: Bearer header:
{ "error": "Missing or malformed API key" } // no Bearer prefix, or not rly_live_*
{ "error": "Invalid API key" } // well-formed but unknown or revokedRate limits
| Scope | Limit | Response when exceeded |
|---|---|---|
| Per API key | 120 requests / minute | 429 with Retry-After |
| Per user (all keys combined) | 300 requests / minute | 429 with Retry-After |
| Failed auth per IP | 30 attempts / minute | 429 with Retry-After |
On the MCP endpoint, every JSON-RPC message in a batched request counts against these budgets individually — a batch of 20 tool calls costs 20, and batches are capped at 20 messages per request.
HTTP/1.1 429 Too Many Requests
Retry-After: 37
{ "error": "Rate limit exceeded (120 requests/minute per API key)" }Limits use a fixed 60-second window, so a burst straddling a window boundary can briefly pass up to twice the limit — treat the number as a floor, not a precise budget. Back off for the number of seconds in Retry-After rather than retrying immediately.
POST /v1/uploads is charged against a second, separate budget: 512 MB per minute per user, on top of the request counts above. Counting requests alone would let an endpoint that takes 90 MB a call move tens of gigabytes a minute. Exceeding it returns the same 429 and Retry-After contract with its own message, so match on the status rather than the text:
HTTP/1.1 429 Too Many Requests
Retry-After: 41
{ "error": "Upload limit exceeded (512MB/minute per user)" }A video sent in parts (POST /v1/uploads/sessions) is charged its whole size once, when its session starts, against a budget of its own: 8192 MB an hour per user. Its parts aren't charged again.
Idempotency
POST /v1/posts and POST /v1/media accept an Idempotency-Key header so a retry after a timeout can't create a duplicate post or a second copy of an asset. (Replies and DMs need none here: they are a person's to send, and every API key is refused.)
Idempotency-Key: fall-drop-2026-08-04
- Keys are scoped to (your account, endpoint, key) and remembered for 24 hours.
- A replayed request returns the original response body and status, plus
Idempotency-Replayed: true. - Only successful responses are stored. A request that failed validation can be corrected and retried with the same key.
- Maximum length is 255 characters; longer keys are rejected with
400. - Two genuinely simultaneous requests with the same key may both execute — the window is milliseconds wide. Serialize retries rather than firing them in parallel.
- Use a key derived from your own domain object (campaign ID, content hash), not a random UUID generated per attempt — a fresh UUID per retry defeats the mechanism.
POST /v1/posts/:id/retryandDELETE /v1/posts/:idignore the header — their status guards make an accidental duplicate a safe400(the post is already scheduled or cancelled), not a second execution.POST /v1/uploadsignores it too, for a different reason: replays are remembered for 24 hours but a staged file is deleted within the hour, so a replay would hand back a URL that has already 404'd. Re-upload instead — a duplicate staged file costs nothing and expires on its own.
Pagination
GET /v1/posts is cursor-paginated. Pass limit (1–100, default 20) and read next_cursor from the response; when it is null you have the last page.
curl "https://api.relay.lantean.tech/v1/posts?status=scheduled&limit=50" \ -H "Authorization: Bearer $RELAY_API_KEY" # then, while next_cursor is not null: curl "https://api.relay.lantean.tech/v1/posts?status=scheduled&limit=50&cursor=MjAyNi0wNy0zMFQxMTo0..." \ -H "Authorization: Bearer $RELAY_API_KEY"
The cursor is an opaque keyset over (created_at, id) descending — stable while posts are being created, unlike offset paging. Treat it as an opaque string; a cursor you didn't get from a previous page is rejected with 400.
Errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | Validation or domain error — bad post type for the media, unknown account ID, un-editable post, unsupported media format. | Fix the request. Safe to retry with the same idempotency key. |
| 401 | Missing, malformed, unknown, or revoked API key. | Check the header; rotate the key if it was revoked. |
| 404 | No such post or media file, or it belongs to another account. | Do not retry. |
| 411 | POST /v1/uploads only — no Content-Length. It is required so the upload byte budget can be charged before the body is read. | Send the exact body size and retry. |
| 413 | POST /v1/uploads only — the body is over the cap for its type (8 MB image, 90 MB video: what one request carries). POST /v1/uploads/sessions — the video is over 2 GB. | Do not retry as it is. Send a video up to 2 GB in parts (POST /v1/uploads/sessions) or as a public URL; compress or re-encode anything bigger. |
| 429 | Rate limited. | Sleep for Retry-After seconds, then retry. |
| 5xx | Transient server-side failure. | Retry with backoff and the same idempotency key. |
Two error body shapes
Domain errors — the ones you'll actually read — are a message, and a code when the refusal has one a client can act on:
{ "error": "Feed posts take exactly one image — use post_type 'reel' for a single video or 'carousel' for multiple items" }
{
"error": "cover_frame_ms and tiktok.cover_timestamp_ms disagree — tiktok.cover_timestamp_ms is cover_frame_ms’s old name: send cover_frame_ms alone",
"code": "cover_frame_conflict"
}| code | Meaning |
|---|---|
| alt_text_conflict | alt_text and description (its old name) were both sent and differ. |
| cover_image_unused | cover_image was set, but no target takes a cover image (an Instagram Reel, a YouTube video). |
| cover_image_not_jpeg | cover_image is not a JPEG image. |
| cover_frame_unused | cover_frame_ms was set, but no target takes a frame (an Instagram Reel, a TikTok Direct Post video). |
| cover_frame_out_of_range | cover_frame_ms is at or past the end of the video. |
| cover_frame_conflict | cover_frame_ms and the deprecated tiktok.cover_timestamp_ms were both sent and differ. |
| instagram_caption | The caption has more than 30 hashtags or 20 @mentions, which Instagram refuses. |
| instagram_video_length | A Reel outside 3 seconds to 15 minutes, or a story video outside 3 to 60 seconds. |
| subtitles_need_video | subtitles were set on a post without a video. |
| video_too_large | A video bigger than a target’s platform takes: over 300 MB for an Instagram Reel or carousel, 100 MB for a story, 1 GB for Threads. |
| instagram_trial_reels_only | instagram.trial_graduation on a post that is not a Reel. |
| instagram_trial_share_to_feed | A trial Reel with share_to_feed true: a trial goes to non-followers first. |
| instagram_ai_label_story | instagram.ai_generated on a story, which Instagram labels nowhere. |
| instagram_comments_off_story | instagram.comments_off on a story, which has no comments. |
| instagram_comments_permission | instagram.comments_off on a post to an account that did not allow Relay to manage comments (canComment false). Drafts may wait for the reconnect. |
| tiktok_photo_cover_range | tiktok.photo_cover_index is not one of the post’s images (it counts from 0). |
Requests that fail schema validation before reaching the handler (a missing required field, a caption over 2,200 characters, a non-ISO timestamp) return the validator's own output instead, where error.message is a JSON-encoded string of issues:
{
"success": false,
"error": {
"name": "ZodError",
"message": "[{\"code\":\"too_small\",\"minimum\":1,\"path\":[\"caption\"],\"message\":\"Too small: expected string to have >=1 characters\"}]"
}
}Handle both: read error when it is a string, otherwise parse error.message.
Publish-time failures are not HTTP errors
Creating a post only queues it. Anything a platform rejects later — a revoked token, a video that fails transcoding, a quota ceiling — surfaces on the post's per-target timeline, not on the original HTTP call. Poll GET /v1/posts/:id and read targets[].error; the codes are listed in the failure references for Instagram, TikTok, YouTube and Threads.
Endpoints
/v1/accountscurl https://api.relay.lantean.tech/v1/accounts \ -H "Authorization: Bearer $RELAY_API_KEY"
{
"accounts": [
{
"id": "9d1f2c34-5b6a-4c8d-9e0f-1a2b3c4d5e6f",
"platform": "instagram",
"username": "northlight.co",
"displayName": "Northlight",
"status": "connected",
"tokenExpiresAt": "2026-09-21T10:02:11.000Z",
"connectedAt": "2026-07-23T10:02:11.000Z",
"followersCount": 12840,
"mediaCount": 318,
"statsSyncedAt": "2026-07-30T05:30:00.000Z",
"canComment": true,
"canDirectPost": false,
"canUpload": false,
"canReadInsights": true,
"canMessage": false,
"canListVideos": false
}
]
}platform is instagram, tiktok, youtube or threads. status is connected, expiring, reconnect_required, or disconnected. Only the first two can be used as post targets. Follower and media counts refresh once a day (on YouTube, followersCount is the channel's subscribers, null when it hides them; on Threads it needs canReadInsights, and mediaCount is always null). canComment says whether an Instagram account allows first comments, or a Threads account lets Relay manage replies (a thread's further posts, choosing who can reply, hiding replies); canDirectPost says whether the account allowed TikTok direct posting, YouTube uploads or Threads publishing, and canUpload (TikTok only) sending to the TikTok inbox. canReadInsights (Instagram and Threads), canMessage (Instagram) and canListVideos (TikTok's video list, YouTube's channel read; always true on Threads) gate the account management endpoints; a false flag is fixed by reconnecting the account in the dashboard.
On YouTube, tokenExpiresAt is when the connection ends unless Relay can refresh it. Google's own access tokens last an hour and Relay renews them as it goes, so this date moves forward with every refresh (to about six months out) and a healthy channel stays connected.
/v1/accounts/:id/tiktok/creator-info{
"creator": {
"username": "northlight.co",
"nickname": "Northlight",
"avatar_url": "https://p16-sign.tiktokcdn.com/…",
"privacy_level_options": ["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"],
"comment_disabled": false,
"duet_disabled": false,
"stitch_disabled": true,
"max_video_post_duration_sec": 600,
"can_post": true,
"cannot_post_reason": null,
"audit_pending": false
}
}A disabled interaction is forced off on every post. can_post is false when TikTok is not accepting posts from the account right now — usually its daily cap — with the reason in cannot_post_reason. audit_pending is true until TikTok has audited Relay’s app: until then privacy_level_options holds only SELF_ONLY, and a Direct Post goes out only as that (an inbox upload isn’t affected). A Direct Post made with a key is saved as a draft whatever its privacy, for the creator to choose in Relay’s composer, so the audit never refuses your request. See TikTok settings.
/v1/accounts/:id/youtube/channel-info{
"channel": {
"account_id": "5b9e…",
"channel_id": "UCq8…",
"title": "Northlight",
"handle": "northlight",
"url": "https://www.youtube.com/channel/UCq8…",
"avatar_url": "https://yt3.ggpht.com/…",
"subscriber_count": 2310,
"video_count": 64,
"long_uploads": "eligible",
"made_for_kids_default": false
}
}long_uploads says whether the channel may upload videos over 15 minutes: allowed, eligible (once its owner verifies it at youtube.com/verify) or disallowed. subscriber_count is null when the channel hides it. made_for_kids_default is the channel's own audience setting; every post still says its own made_for_kids. See YouTube settings.
/v1/posts| Field | Type | Description |
|---|---|---|
| targets | string[] required | Account IDs to post to (from accounts_list), up to 10 Example: ["9d1f…"] |
| caption | string required | Caption text, 1–2200 characters (ignored for stories). On YouTube it is the video's description, unless youtube.description is set. On Threads it is the post's text, unless threads.text is set: at most 500 characters by Threads' count, where an emoji counts as several, and at most 5 links Example: "Fall drop is live — link in bio." |
| post_type | string? | feed | carousel | reel | story | text — inferred from media when omitted (stories never inferred). text is a post with no media, which only Threads takes: every target must be a Threads account, and a Threads-only post with no media is inferred as text Example: reel |
| media | (string | object)[] | Media IDs or public URLs (JPEG images, MP4/MOV videos) — up to 20 when an Instagram account is targeted, up to 35 images for a TikTok-only photo post, up to 20 images and videos (a carousel) when only Threads accounts are, exactly one video when a YouTube account is. Required unless draft is true or every target is a Threads account: Threads alone takes a text-only post (omit media, or post_type text). To set a file’s alt text, pass { id, alt_text } or { url, alt_text } instead of a bare string — exactly one of id or url; alt_text (1–1000 characters, null clears it) is the file’s own, sent to Instagram on images and to Threads. caption on an entry is a deprecated per-slide caption: kept, posted nowhere Example: ["https://cdn.example.com/fall.jpg", { "id": "a1b2…", "alt_text": "A sand-coloured jumper on a beach." }] |
| share_to_feed | boolean? | Reels only: also show the reel on the profile grid (Instagram defaults to true) Example: false |
| first_comment | string? | Text posted as a comment on the post the moment it goes live, 1–2200 characters — the usual home for a hashtag block you want out of the caption. Posted once per Instagram target account (TikTok, YouTube and Threads targets get none through Relay, so it needs at least one Instagram target). Not valid on stories, which have no comments. Threads posts have no first comment — add it as the next post in the thread instead (threads.thread) Example: "#fallcollection #newin #slowfashion" |
| cover_image | string? | The video's cover image: a media ID or a public https URL (stored like a media entry), JPEG only. An Instagram Reel's cover, and a YouTube video's thumbnail (YouTube shows it on verified channels). Refused when no target uses one: TikTok takes a frame, not an image (cover_frame_ms), and Threads picks its own Example: "a1b2…" |
| cover_frame_ms | number? | The cover frame, in milliseconds into the video, before its end: a TikTok video's cover (Direct Posts; an inbox upload takes none), and an Instagram Reel's when there is no cover_image. YouTube takes a thumbnail image instead. Refused when no target uses one Example: 2000 |
| object? | Instagram settings, applied to every Instagram target; all optional and off when left out: { ai_generated (true adds Instagram’s "AI info" label; feed posts, Reels and carousels, not stories), trial_graduation: manual | performance (a trial Reel, shown to non-followers first: manual = the user graduates it in Instagram, performance = Instagram graduates it if it performs well; Reels only, and not with share_to_feed true), comments_off (true turns comments off right after it publishes, after any first comment; not on stories, and the account needs can_comment) } Example: { "ai_generated": true, "comments_off": true } | |
| tiktok | object? | TikTok settings, required when any target is a TikTok account: { mode: "direct" | "inbox" (default direct), privacy_level: PUBLIC_TO_EVERYONE | MUTUAL_FOLLOW_FRIENDS | FOLLOWER_OF_CREATOR | SELF_ONLY (required for direct, no default; only SELF_ONLY while tiktok_creator_info says audit_pending), allow_comment, allow_duet, allow_stitch (all default false; duet/stitch are video only), brand_organic (promotes your own brand), brand_content (paid partnership — never SELF_ONLY), is_aigc, caption (TikTok-only caption override), title (photo posts, ≤90), cover_timestamp_ms (video; deprecated, the same as the post’s cover_frame_ms), photo_cover_index (photo: which image is the cover, from 0, below the number of images), auto_add_music (photo) } Example: { "privacy_level": "PUBLIC_TO_EVERYONE", "allow_comment": true } |
| youtube | object? | YouTube settings, for a post with any YouTube target (such a post is always saved as a draft for the user to upload from Relay): { title (1–100 characters, no < or >), privacy_status: public | unlisted | private, made_for_kids (true/false) — YouTube needs all three and none has a default, so ask the user, and leave out what they have not decided (they finish it in Relay’s composer; the preview page publishes only once all three are set); description (the video description instead of the caption, up to 5000 bytes, no < or >), category_id (a YouTube category id, default "22", People & Blogs), tags (at most 100, no <, > or comma inside one; 500 characters in all, commas between tags included, and a tag with a space counts 2 more for the quotes YouTube adds), notify_subscribers (tell the subscribers, default true), contains_synthetic_media (a realistic person, place or event that was altered or generated, default false) } Example: { "title": "Fall drop, in 40 seconds", "privacy_status": "public", "made_for_kids": false } |
| threads | object? | Threads settings, applied to every Threads target; all optional: { text (the Threads text instead of the caption, 1–500 characters by Threads’ count, where an emoji counts as several: its UTF-8 bytes, so 😀 is 4), reply_control: everyone | accounts_you_follow | mentioned_only | followers_only | parent_post_author_only (who may reply, default everyone), topic_tag (the post’s one topic, 1–50 characters with no “.” or “&”, without the #), link_attachment (a public http(s) URL Threads shows as a link preview card; text-only posts only), thread (up to 9 more text posts, each 1–500 characters counted the same way, published in order, each a reply to the one before; needs the account’s can_comment, see accounts_list) }. The text and each thread post may hold at most 5 different links, link_attachment included. Threads has no first comment: add it to thread instead Example: { "reply_control": "followers_only", "topic_tag": "Running", "thread": ["Part two.", "Part three."] } |
| subtitles | object? | A video’s subtitles: { srt (the SubRip file’s text: numbered cues, each a timing line like 00:00:01,000 --> 00:00:04,000 and its text; up to 1MB), language (a BCP-47 tag such as en, pt-BR or es-419 — required, no default), name (optional, up to 150 characters: the track’s name YouTube shows beside the language) }. Only a post with a video takes them (subtitles_need_video otherwise). YouTube gets them as the video’s caption track after the upload (400 of Relay’s shared daily YouTube units; the channel must have granted Relay the captions permission); Instagram, TikTok and Threads take no caption files, so Relay keeps them for the user to download from the post’s page Example: { "srt": "1\n00:00:00,500 --> 00:00:03,000\nThree sets, one minute each.\n", "language": "en" } |
| schedule_at | string? | ISO 8601 timestamp with offset, in the future — omit to publish now. A time more than five minutes in the past is refused Example: "2026-08-04T18:30:00Z" |
| link_parent_id | string? | Links this post to a parent post (a post ID from posts_list), e.g. Shorts and Reels cut from a long video. Its text (caption, first_comment, tiktok.caption, youtube.description, threads.text and thread) may then hold {{link:parent}}, which Relay fills in with the parent’s link when this post goes out, or {{link:<ref>}} for a sibling (another child of the same parent; <ref> is the first 8 characters of its post ID). Add :youtube, :instagram, :tiktok or :threads to pick that account’s link; without it YouTube’s comes first, then Instagram’s, Threads’ and TikTok’s. A line whose link isn’t live yet when the post goes out is left out whole. One level only: a parent is never itself a child Example: "3f0c…" |
| schedule_after_parent_min | number? | With link_parent_id: publish this many minutes after the parent goes live (0–43200), instead of at schedule_at (pass one or the other). The post waits for the parent, so its {{link:parent}} is always filled in Example: 120 |
Media entries are either media IDs from POST /v1/media or public https URLs, which Relay fetches and stores on the spot — including the short-lived URLs handed back by POST /v1/uploads, which is how you post a file you hold locally. Order is preserved — the first item is the carousel cover.
Alt text: to describe a file for people who can’t see it, replace the bare string with { "id": "…", "alt_text": "…" } for a stored media ID or { "url": "…", "alt_text": "…" } for a public link — exactly one of id or url, and the alt text is 1–1,000 characters. Alt text belongs to the file, not the post: it is written to the file (the same as PATCH /v1/media/:id), so it goes out with every post that uses it, and null clears it. Instagram gets it on a feed post’s image and on each image of a carousel (never on Reels, stories or videos); Threads gets it on every item. Mix bare strings and objects freely.
Per-slide captions are deprecated: an entry may still carry a caption (1–2,200 characters, carousels only), which Relay keeps and shows, but Instagram shows no per-slide caption and Relay posts it nowhere. Use alt_text to describe an image, and the post’s own caption for the words.
Cover: cover_image is a media ID or public URL (a JPEG), stored like a media entry: an Instagram Reel’s cover and a YouTube video’s thumbnail. cover_frame_ms is a frame of the video, in milliseconds from the start and before its end: a TikTok Direct Post video’s cover, and an Instagram Reel’s when there is no cover_image. Neither has a default. TikTok takes no cover image, YouTube no frame, an inbox upload neither, and Threads picks its own frame; a cover no target uses is refused (cover_image_unused, cover_frame_unused). The old tiktok.cover_timestamp_ms is still read as cover_frame_ms. A frame saved that way before cover_frame_ms existed is TikTok’s only: Instagram doesn’t get it as a Reel’s cover until cover_frame_ms is sent again.
Instagram settings: the optional instagram object sets ai_generated (Instagram’s “AI info” label; not on stories), trial_graduation (manual or performance: a trial Reel, shown to people who don’t follow the account first; Reels only, and not with share_to_feed: true) and comments_off (turned off right after it publishes, after any first comment; not on stories, and the account needs canComment). See Instagram settings.
Type inference: omit post_type and Relay derives it from the media — one image is a feed post, one video is a reel, two or more is a carousel, and no media at all, on a post to Threads accounts alone, is a text post. Stories are never inferred; ask for them explicitly.
Scheduling: omit schedule_at to publish on the next scheduler tick (under a minute). A timestamp more than five minutes in the past is refused with a 400, so a wrong date or timezone can't publish a post early. Posts created through this API come back with status scheduled, with two exceptions that wait for a person: a post with a YouTube account, and one with a TikTok account in direct mode, are saved as draft, to be finished in Relay's composer if anything is missing and published from the post's preview page.
YouTube: a YouTube account takes exactly one MP4 or MOV video, and the post needs a youtube object with a title, a privacy_status and made_for_kids — no defaults, so ask the person. The caption becomes the video's description unless youtube.description is set. YouTube requires the person to see its upload notice and confirm before anything is uploaded, so the post is saved as a draft whatever schedule_at says. See Agents and drafts.
Threads: a post to Threads accounts alone may have no media (a text post); otherwise one image, one video up to 5 minutes, or a carousel of 2–20 images and videos. The caption is the Threads text unless threads.text is set, and Threads takes at most 500 characters by its own count — an emoji counts as its UTF-8 bytes, so 😀 is 4 — with at most 5 links. The optional threads object sets who can reply, a topic, a link preview card and further posts that make a thread; a post with a Threads account takes no first_comment. Nothing holds a Threads post as a draft: it is scheduled like an Instagram post. See Threads settings.
Subtitles: a video post may carry subtitles, a SubRip (.srt) file with its language and an optional name. YouTube gets it as the video’s captions; the other platforms take no subtitle files, so it is kept on the post to download. See GET /v1/posts/:id/subtitles.
Linked posts: pass link_parent_id to make a post a child of another (a Short cut from a long video), and write {{link:parent}} on a line of its own where the parent’s link goes, or {{link:<ref>}} for a sibling (the first 8 characters of its id, its link_ref), optionally with :youtube, :instagram, :tiktok or :threads. Relay fills each in with the live link when the post goes out, and leaves the line out when that post isn’t live yet. schedule_after_parent_min (instead of schedule_at) sends it that many minutes after the parent goes live, so its link is always there. One level only: a parent is never itself a child.
curl -X POST https://api.relay.lantean.tech/v1/posts \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: fall-drop-2026-08-04" \
-d '{
"targets": ["9d1f2c34-5b6a-4c8d-9e0f-1a2b3c4d5e6f"],
"caption": "Fall drop is live — link in bio.",
"media": ["https://cdn.example.com/fall-drop.jpg"],
"schedule_at": "2026-08-04T18:30:00Z"
}'{
"post": {
"id": "3f0c8a71-2d64-4b18-9a55-7c2e11d0f4ab",
"caption": "Fall drop is live — link in bio.",
"status": "scheduled",
"post_type": "feed",
"share_to_feed": null,
"first_comment": null,
"cover_image": null,
"cover_frame_ms": null,
"instagram": null,
"tiktok": null,
"youtube": null,
"threads": null,
"schedule_at": "2026-08-04T18:30:00.000Z",
"published_at": null,
"source": "api",
"created_at": "2026-07-30T12:41:09.220Z",
"media": [
{
"id": "a1b2c3d4-0000-4a1b-8c2d-3e4f5a6b7c8d",
"url": "https://media.relay.lantean.tech/users/…/a1b2….jpg",
"kind": "image",
"content_type": "image/jpeg",
"size_bytes": 412903,
"width": 1080,
"height": 1350,
"duration_ms": null,
"poster_url": null,
"name": "fall-drop.jpg",
"alt_text": null,
"description": null,
"created_at": "2026-07-30T12:41:08.911Z",
"caption": null
}
],
"targets": [
{
"id": "b7e1…",
"account_id": "9d1f2c34-5b6a-4c8d-9e0f-1a2b3c4d5e6f",
"username": "northlight.co",
"platform": "instagram",
"status": "pending",
"platform_post_id": null,
"permalink": null,
"published_at": null,
"error": null,
"first_comment_status": null,
"followups": []
}
]
}
}More examples
{
"targets": ["9d1f…"],
"caption": "Behind the drop.",
"post_type": "reel",
"media": ["https://cdn.example.com/behind.mp4"],
"share_to_feed": false
}{
"targets": ["9d1f…"],
"caption": "Every colourway.",
"media": ["a1b2c3d4-…", "e5f6a7b8-…", "c9d0e1f2-…"]
}{
"targets": ["9d1f…"],
"caption": "Every colourway.",
"media": [
{ "id": "a1b2c3d4-…", "alt_text": "A sand-coloured jumper folded on a wooden table." },
{ "url": "https://cdn.example.com/slate.jpg", "alt_text": "The same jumper in slate grey." },
"c9d0e1f2-…"
]
}{
"targets": ["9d1f…"],
"caption": "Made with our new studio tools.",
"post_type": "reel",
"media": ["https://cdn.example.com/drop.mp4"],
"cover_image": "https://cdn.example.com/drop-cover.jpg",
"instagram": { "ai_generated": true, "comments_off": true }
}{
"targets": ["9d1f…"],
"caption": "Testing a new hook.",
"post_type": "reel",
"media": ["e5f6a7b8-…"],
"cover_frame_ms": 2000,
"instagram": { "trial_graduation": "performance" }
}{
"targets": ["9d1f…"],
"caption": "internal note — not shown",
"post_type": "story",
"media": ["https://cdn.example.com/story.jpg"]
}{
"targets": ["9d1f…", "4a7b…"],
"caption": "Same drop, two brands.",
"media": ["a1b2c3d4-…"]
}{
"targets": ["5b9e…"],
"caption": "Every colourway, one drop.",
"media": ["https://cdn.example.com/fall-vertical.mp4"],
"youtube": {
"title": "Fall drop, in 40 seconds",
"privacy_status": "public",
"made_for_kids": false
}
}{
"targets": ["4e8b…"],
"caption": "Streaks are back. Pick up where you left off.",
"threads": {
"reply_control": "followers_only",
"topic_tag": "Running",
"thread": [
"Miss a day and your streak pauses instead of resetting.",
"Turn it on in Settings → Streaks."
]
}
}/v1/posts| Query param | Type | Description |
|---|---|---|
| status | string? | draft | scheduled | publishing | published | partly | failed | cancelled |
| limit | number? | 1–100, default 20 |
| cursor | string? | next_cursor from a previous page |
{
"posts": [ /* post objects, newest first */ ],
"next_cursor": "MjAyNi0wNy0zMFQxMTo0Mzoy…"
}/v1/posts/:id{
"post": {
"id": "3f0c8a71-…",
"status": "partly",
"post_type": "feed",
"published_at": "2026-08-04T18:30:42.180Z",
"targets": [
{
"account_id": "9d1f…",
"username": "northlight.co",
"status": "published",
"platform_post_id": "17912345678901234",
"permalink": "https://www.instagram.com/p/C9xY…/",
"published_at": "2026-08-04T18:30:42.180Z",
"error": null
},
{
"account_id": "4a7b…",
"username": "northlight.eu",
"status": "failed",
"platform_post_id": null,
"permalink": null,
"published_at": null,
"error": {
"code": "auth_reconnect_required",
"message": "Instagram authorization expired or was revoked — reconnect the account"
}
}
]
}
}Returns 404 with { "error": "Post not found" } for an unknown ID or one owned by a different account.
/v1/posts/:idcurl -X PATCH https://api.relay.lantean.tech/v1/posts/3f0c8a71-… \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "schedule_at": "2026-08-05T09:00:00Z" }'Only draft and scheduled posts can be edited — once the scheduler claims a post it is frozen, and you get 400 with Only draft/scheduled posts can be edited. Media, per-slide captions, and targets are immutable on this API — caption here is the post's own caption, not a carousel slide's. To change any of them, cancel and create a new post instead (the dashboard can edit them directly). A file’s alt text is the file’s own: change it with PATCH /v1/media/:id. instagram, youtube and threads each replace the whole object, and tiktok does too, except that a caption or photo_cover_index left out keeps the stored one (null clears it). null removes first_comment, cover_image, cover_frame_ms, instagram or subtitles; a field left out stays as it is, and a subtitles object replaces the stored file. The edited post is held to every target’s rules again. Editing a post with a YouTube account, or a TikTok Direct Post, makes it a draft again, for a person to publish in Relay; a post with Threads accounts stays scheduled, held to Threads' 500-character count again.
/v1/posts/:id/subtitlesSubtitles go on a video post as subtitles on create or update: { "srt": "<SubRip text>", "language": "en", "name": "Main" } — the text up to 1 MB with a timing line like 00:00:01,000 --> 00:00:04,000 on every subtitle, the language a BCP-47 tag (required), the name optional (up to 150 characters). YouTube gets them as the video’s captions once it is live (the youtube_captions follow-up); Instagram, TikTok and Threads take no subtitle files through their APIs, so there they are kept for the person to download from the post page.
/v1/posts/:id/retrycurl -X POST https://api.relay.lantean.tech/v1/posts/3f0c8a71-…/retry \ -H "Authorization: Bearer $RELAY_API_KEY"
Only failed and partly posts can be retried — anything else returns 400. Failed targets reset to pending and the post re-enters the publish queue on the next scheduler tick; targets that already published are untouched, so a partly-published post republishes only what failed. The post keeps its ID. Fix the underlying cause first (the per-target error on GET /v1/posts/:id says why the platform said no) or the retry will fail the same way. A retried post with a YouTube account, or a TikTok Direct Post, comes back as a draft for a person to publish again; a YouTube target that failed is uploaded again from the start. A Threads target whose publish Threads never confirmed is checked with Threads first, so a post that did go out is recorded as published rather than sent twice.
/v1/posts/:idCancellation is atomic against the scheduler: if a publish has already started you get 400 rather than a half-cancelled post (a YouTube upload can't be stopped once it has started, nor a Threads post Relay has asked Threads to publish). It cannot remove something already live on Instagram, TikTok, YouTube or Threads — delete that in the platform's own app (YouTube Studio for YouTube).
With ?permanent=true it instead deletes a post that already ran its course (published, partly, failed, or cancelled) from Relay, returning { "deleted": true, "id": "…" }. The post stays live on Instagram, TikTok, YouTube and Threads; only Relay's record goes.
/v1/posts/:id/duplicate/v1/mediacurl -X POST https://api.relay.lantean.tech/v1/media \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: fall-drop-hero-v3" \
-d '{ "url": "https://cdn.example.com/fall-drop.jpg", "name": "fall-drop-hero.jpg", "group": "Fall drop" }'curl -X POST https://api.relay.lantean.tech/v1/media \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"data\": \"$(base64 -w0 fall-drop.jpg)\", \"content_type\": \"image/jpeg\" }"{
"media": {
"id": "a1b2c3d4-0000-4a1b-8c2d-3e4f5a6b7c8d",
"url": "https://media.relay.lantean.tech/users/…/a1b2….jpg",
"kind": "image",
"content_type": "image/jpeg",
"size_bytes": 412903,
"width": 1080,
"height": 1350,
"duration_ms": null,
"poster_url": null,
"name": "fall-drop-hero.jpg",
"alt_text": null,
"description": null,
"created_at": "2026-07-30T12:41:08.911Z"
},
"group": { "id": "c4d5e6f7-0000-4a1b-8c2d-3e4f5a6b7c8d", "name": "Fall drop" }
}- Pass exactly one of
url(a publicly reachable http(s) URL Relay fetches) ordata(the file content itself, as raw base64 or adata:URI). Withdata, the type comes fromcontent_type, thedata:URI, or the bytes themselves, in that order. - Accepted types:
image/jpeg(≤ 8 MB),video/mp4andvideo/quicktime(≤ 2 GB from aurl). PNG and other image formats are rejected here rather than at publish time, because Instagram will not accept them — convert before uploading. (The dashboard does this conversion in the browser, which is why it accepts any image you give it.) - Image dimensions are parsed on upload so aspect-ratio problems surface now, not when the post goes out. A video's length and size are read from its MP4/MOV header too, which is how Relay tells a YouTube Short from a regular video.
- The source URL must be publicly reachable over http(s). Private and link-local hosts are refused. A video is streamed from it straight into storage, never held whole, and the download has 15 minutes to finish. Inline
datatravels in this one request: up to 90 MB of file, and less in practice — base64 inflates payloads ~33% and a request over 100 MB is refused before it reaches Relay. For video over ~50 MB useurl. - Optional:
name(up to 255 characters; the library shows the stored file's own name without one),alt_text(up to 1000: what the file shows, sent as alt text to Instagram on images and to Threads with every post that uses it;descriptionis its old name, and sending both with different text is a 400alt_text_conflict) andgroup, an upload group (album) to file it in — the id of one of your groups, or a name: your newest group with exactly that name, made if there is none (up to 80 characters). The answer'sgroupis that group, ornull. A group id that isn't yours is a 400, and nothing is stored. - Uploading is optional —
POST /v1/postsaccepts URLs directly. Upload first when you want to reuse one asset across posts or validate it before composing.
/v1/media/:id| Field | Type | Description |
|---|---|---|
| name | string? | The name the media library shows the file by, 1–255 characters. Omit to keep it Example: "fall-drop-hero.jpg" |
| alt_text | string? | What the file shows, for people who can’t see it, 1–1000 characters: sent as alt text to Instagram (images) and Threads with every post that uses the file. Pass null to clear it; omit to keep it Example: "A sand-coloured jumper laid on a beach" |
curl -X PATCH https://api.relay.lantean.tech/v1/media/a1b2c3d4-0000-4a1b-8c2d-3e4f5a6b7c8d \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "alt_text": "A sand-coloured jumper folded on a wooden table." }'{
"media": {
"id": "a1b2c3d4-0000-4a1b-8c2d-3e4f5a6b7c8d",
"url": "https://media.relay.lantean.tech/users/…/a1b2….jpg",
"kind": "image",
"name": "fall-drop-hero.jpg",
"alt_text": "A sand-coloured jumper folded on a wooden table.",
"description": "A sand-coloured jumper folded on a wooden table.",
"used": true,
"group_count": 1,
…
}
}A field left out stays as it is, and null clears the alt text (empty text is refused). The alt text belongs to the file, so the change reaches every post that uses it and hasn’t published yet; a post that already went out keeps what it was sent with. An unknown id, or a file that belongs to another account, is a 404.
/v1/uploadscurl -X POST https://api.relay.lantean.tech/v1/uploads \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H "Content-Type: image/jpeg" \ --data-binary @fall-drop.jpg
{
"upload": {
"url": "https://api.relay.lantean.tech/v1/uploads/users/…/a1b2….jpg",
"kind": "image",
"content_type": "image/jpeg",
"size_bytes": 412903,
"expires_at": "2026-07-30T13:41:08.911Z"
}
}curl -X POST https://api.relay.lantean.tech/v1/posts \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "targets": ["3f0c8a71-…"], "caption": "Fall drop", "media": ["<the url above>"] }'- The request body is the file itself, not JSON — unlike every other endpoint here.
Content-Typeidentifies the format andContent-Lengthis required. - The URL expires. Staged files are deleted an hour after upload, and the URL 404s from that moment. This is a hand-off, not storage: create the post while the URL is alive and it keeps a permanent copy of the bytes, unaffected by the expiry — so scheduling a post weeks out is fine. For an asset you want to reuse across posts, use
POST /v1/mediainstead. - Same accepted types as
POST /v1/media, and the file is this one request:image/jpeg(≤ 8 MB),video/mp4andvideo/quicktime(≤ 90 MB). A bigger video (up to 2 GB) goes up in parts through POST /v1/uploads/sessions and ends with the same URL; one already at a public URL can be passed as it is. - Reach for this when you hold the bytes and have nowhere public to put them. It avoids base64 entirely, which matters most for video — inline
datainflates the payload by about a third. - Uploads are charged against a 512 MB/minute budget per user, on top of the request rate limits. Over it you get a
429withRetry-After.Idempotency-Keyis not accepted here — replays are honoured for 24 h but a staged file is gone within the hour, so retrying the upload is the right move.
/v1/uploads/sessionscurl -X POST https://api.relay.lantean.tech/v1/uploads/sessions \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "content_type": "video/mp4", "size_bytes": 297795584 }'{
"session": {
"token": "eyJhbGciOi…",
"content_type": "video/mp4",
"size_bytes": 297795584,
"part_size": 33554432,
"part_count": 9,
"parts_url": "https://api.relay.lantean.tech/v1/uploads/sessions/eyJhbGciOi…/parts",
"complete_url": "https://api.relay.lantean.tech/v1/uploads/sessions/eyJhbGciOi…/complete",
"expires_at": "2026-07-30T13:41:08.911Z"
}
}- The body is JSON:
content_type(video/mp4orvideo/quicktime) andsize_bytes, the file's exact size. Any video up to 2 GB may come this way, so one code path can send every video; images go toPOST /v1/uploadsas they are (a400here). Over 2 GB is a413withcode: "file_too_large". - The file goes up in
part_countparts ofpart_sizebytes (32 MiB), the last one the rest of the file: partnis the bytes from offset(n − 1) × part_size. Send each toparts_url/<n>, then finish atcomplete_url. Both carry the session's token; every request needs your API key too, and a session is only its own user's. - Start, send and finish before the session's
expires_at: the staging window (an hour), since a session is a hand-off too. An expired session is a404— start again. - Sessions are charged their size when they start, against 8192 MB an hour per user (the per-minute upload budget is smaller than one big video). Over it you get a
429withRetry-After, before anything is opened.
FILE=launch.mp4
SIZE=$(wc -c < "$FILE" | tr -d ' ')
SESSION=$(curl -s -X POST https://api.relay.lantean.tech/v1/uploads/sessions \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"content_type\": \"video/mp4\", \"size_bytes\": $SIZE}")
PART_SIZE=$(echo "$SESSION" | jq -r .session.part_size)
PARTS_URL=$(echo "$SESSION" | jq -r .session.parts_url)
PARTS=""
for n in $(seq 1 "$(echo "$SESSION" | jq -r .session.part_count)"); do
dd if="$FILE" bs="$PART_SIZE" skip=$((n - 1)) count=1 2>/dev/null > part.bin
PART=$(curl -s -X PUT "$PARTS_URL/$n" \
-H "Authorization: Bearer $RELAY_API_KEY" \
--data-binary @part.bin)
PARTS="$PARTS${PARTS:+,}$PART"
done
curl -s -X POST "$(echo "$SESSION" | jq -r .session.complete_url)" \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"parts\": [$PARTS]}"/v1/uploads/sessions/:token/parts/:n{ "part_number": 1, "etag": "6a1f…" }- Every part is exactly
part_sizebytes except the last. A part of any other length is a400before a byte is kept, one the plan has no room for a404, and one withoutContent-Lengtha411. - Keep each answer: finishing needs every part's
etag. A part that failed can be sent again (the later one counts), and parts may go side by side.
/v1/uploads/sessions/:token/completecurl -X POST https://api.relay.lantean.tech/v1/uploads/sessions/eyJhbGciOi…/complete \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "parts": [{ "part_number": 1, "etag": "6a1f…" }, …] }'{
"upload": {
"url": "https://api.relay.lantean.tech/v1/uploads/users/…/c3d4….mp4",
"kind": "video",
"content_type": "video/mp4",
"size_bytes": 297795584,
"expires_at": "2026-07-30T13:52:40.120Z"
}
}partslists every part once, as each answered. A part missing is a400that says how many there should be.- Use
upload.urlas a media entry onPOST /v1/postsor asPOST /v1/media'surlbeforeupload.expires_at, as with POST /v1/uploads. Finishing again after a lost answer returns the same upload.
/v1/uploads/sessions/:token/v1/library{
"media": [{ "id": "b1c2…", "url": "https://…/b1c2.jpg", "kind": "image", "name": "fall-drop-hero.jpg", "alt_text": null, "used": false, "group_count": 1, … }],
"page": 1,
"page_size": 24,
"total": 31,
"total_pages": 2
}Account management
Everything after publishing: what is live on an account (including posts made outside Relay), comments and Threads replies, insights, Instagram DMs, and TikTok and YouTube video stats. These endpoints ask Instagram, TikTok, YouTube or Threads live, with the account's own token. Platform ids — media, comments, replies, conversations — go in the path; for a post Relay published, use its targets[].platform_post_id. Paged lists take limit and cursor and return next_cursor (null on the last page). Each has an MCP twin; the parameters and results are the same.
canReadInsights, canMessage, canListVideos and (Threads) canComment on GET /v1/accounts. Reading Threads replies needs one no flag shows. Without it you get a 400 that says to reconnect the account. Relay doesn't moderate TikTok or YouTube comments or send messages there, so management is read-only on both. Replies and DMs are a person's to send: every API key gets 403 from the routes that would send one./v1/accounts/:id/refreshInstagram media & comments
/v1/accounts/:id/instagram/media{
"media": [
{
"id": "17900000000000001",
"caption": "Fall collection is here",
"media_type": "CAROUSEL_ALBUM",
"product_type": "FEED",
"permalink": "https://www.instagram.com/p/…",
"timestamp": "2026-09-20T15:00:00+0000",
"like_count": 214,
"comments_count": 3,
"comments_enabled": true,
…
}
],
"next_cursor": "QVFIU…"
}/v1/accounts/:id/instagram/media/:mediaId/comments{
"media_id": "17900000000000001",
"comments": [
{
"id": "18000000000000001",
"text": "Is the scarf back in stock?",
"username": "maya.reads",
"timestamp": "2026-09-21T09:12:00+0000",
"like_count": 4,
"hidden": false,
"replies": [{ "id": "18000000000000002", "text": "Friday!", … }]
}
],
"next_cursor": null
}/v1/accounts/:id/instagram/comments/:commentId/replies/v1/accounts/:id/instagram/comments/:commentId/v1/accounts/:id/instagram/comments/:commentId/v1/accounts/:id/instagram/media/:mediaId/v1/accounts/:id/instagram/publishing-limitInstagram insights
/v1/accounts/:id/instagram/media/:mediaId/insights{
"media_id": "17900000000000001",
"product_type": "FEED",
"metrics": { "reach": 1204, "views": 1890, "likes": 214, "comments": 3,
"saved": 14, "shares": 3, "total_interactions": 234 }
}/v1/accounts/:id/instagram/insights{
"since": "2026-09-22T12:00:00.000Z",
"until": "2026-09-29T12:00:00.000Z",
"metrics": { "reach": 8420, "views": 15230, "accounts_engaged": 612,
"total_interactions": 1480, "follows_and_unfollows": 38, … },
"demographics": { "breakdown": "country", "values": [{ "key": "US", "value": 610 }, …] }
}Instagram direct messages
Needs canMessage. Instagram lets a business reply only within 24 hours of the other person's last message, and never lets it start a conversation. Relay checks the window before sending and answers 400 with the time it closed.
/v1/accounts/:id/instagram/conversations/v1/accounts/:id/instagram/conversations/:conversationId/messages{
"conversation_id": "aWdfZG…",
"participants": [{ "id": "1780…", "username": "maya.reads" }],
"messages": [
{ "id": "m_…", "created_at": "2026-09-29T10:00:00+0000", "direction": "inbound",
"from": { "id": "1780…", "username": "maya.reads" }, "text": "Do you ship to Canada?" }
],
"window": { "open": true, "closes_at": "2026-09-30T10:00:00.000Z" }
}/v1/accounts/:id/instagram/conversations/:conversationId/messagesTikTok videos
/v1/accounts/:id/tiktok/videos{
"videos": [
{
"id": "7412345678901234567",
"title": "Studio tour",
"description": "Studio tour #smallbusiness",
"create_time": "2026-09-18T20:00:00.000Z",
"share_url": "https://www.tiktok.com/@northlight.co/video/7412345678901234567",
"duration_sec": 34,
"view_count": 18230,
"like_count": 1204,
"comment_count": 58,
"share_count": 91,
…
}
],
"next_cursor": "1758225600000"
}/v1/accounts/:id/tiktok/videos/queryYouTube videos
Each read costs Relay's shared YouTube quota, so ask when you need the numbers rather than polling. A Relay post's video id is its targets[].platform_post_id.
/v1/accounts/:id/youtube/videos{
"account_id": "5b9e…",
"videos": [
{
"id": "Hq3vT9xYp0E",
"title": "Fall drop, in 40 seconds",
"url": "https://www.youtube.com/watch?v=Hq3vT9xYp0E",
"published_at": "2026-09-18T20:00:00.000Z",
"privacy_status": "public",
"upload_status": "processed",
"duration_sec": 40,
"thumbnail_url": "https://i.ytimg.com/vi/Hq3vT9xYp0E/hqdefault.jpg",
"view_count": 18230,
"like_count": 1204,
"comment_count": 58
}
],
"next_cursor": "CAUQAA"
}url is always the /watch?v= link, which plays a Short too: YouTube's video list doesn't say which videos are Shorts. A Relay post's own permalink does use /shorts/, from the video Relay uploaded. upload_status is YouTube's: uploaded (still processing), processed, failed, rejected or deleted. A count is null when YouTube doesn't report it (likes hidden, comments off).
/v1/accounts/:id/youtube/videos/queryThreads posts, replies & insights
A Relay post's Threads id is its targets[].platform_post_id (the first post of a thread); a reply's id is a Threads media id too. See Threads replies and metrics.
/v1/accounts/:id/threads/posts{
"posts": [
{
"id": "18050000000000001",
"text": "Streaks are back. Pick up where you left off.",
"media_type": "TEXT_POST",
"permalink": "https://www.threads.com/@northlight.co/post/DEVth00001",
"shortcode": "DEVth00001",
"media_url": null,
"thumbnail_url": null,
"timestamp": "2026-09-15T09:00:00+0000",
"topic_tag": "Running",
"link_attachment_url": "https://northlight.co/streaks",
"reply_control": "everyone",
"has_replies": true,
"is_quote_post": false
}
],
"next_cursor": "QVFIU…"
}/v1/accounts/:id/threads/posts/:mediaId/insights{
"media_id": "18050000000000001",
"metrics": { "views": 1840, "likes": 96, "replies": 14, "reposts": 6, "quotes": 2, "shares": 9 }
}/v1/accounts/:id/threads/insights/v1/accounts/:id/threads/publishing-limit/v1/accounts/:id/threads/posts/:mediaId/replies{
"media_id": "18050000000000001",
"replies": [
{
"id": "18060000000000001",
"text": "Does it work offline?",
"username": "coach.mia",
"permalink": "https://www.threads.com/@coach.mia/post/…",
"timestamp": "2026-09-15T09:12:00+0000",
"hidden": false,
"is_top_level": true,
"replied_to_id": "18050000000000001",
"has_replies": true,
"is_mine": false
}
],
"next_cursor": null
}/v1/accounts/:id/threads/replies/:replyId/v1/accounts/:id/threads/posts/:mediaId/repliesObject reference
Post
| Field | Type | Description |
|---|---|---|
| id | string | UUID. |
| caption | string | Caption text, 1–2,200 characters. On Threads it is the post’s text unless threads.text is set. |
| status | string | Roll-up across targets — see status reference. |
| post_type | string | null | feed, carousel, reel, story, or text (a post to Threads accounts alone with no media). Null only for a media-less draft. |
| share_to_feed | boolean | null | Reels only. Null means Instagram’s default (shown on the grid). |
| first_comment | string | null | Posted as a comment on each Instagram target once it is live. Null when there is none. |
| cover_image | { id, url } | null | The cover image (a JPEG in the media library): an Instagram Reel’s cover and a YouTube video’s thumbnail. Null when there is none. |
| cover_frame_ms | number | null | The cover frame, in milliseconds into the video: a TikTok Direct Post video’s cover, and an Instagram Reel’s when there is no cover_image. Null when none was picked. It reads the TikTok settings’ frame when the post has one: on a post saved before cover_frame_ms existed, that frame is TikTok’s only, and Instagram picks its own until cover_frame_ms is sent again. |
| object | null | Instagram settings applied to every Instagram target: ai_generated, trial_graduation and comments_off, each optional. Null when the post has none. See Instagram settings. | |
| tiktok | object | null | TikTok settings applied to every TikTok target (mode, privacy_level, interactions, disclosure). Null when the post has no TikTok target. See TikTok settings. |
| youtube | object | null | YouTube settings applied to every YouTube target: title, privacy_status, made_for_kids, and optional description, category_id, tags, notify_subscribers, contains_synthetic_media. Null when the post has no YouTube target. See YouTube settings. |
| threads | object | null | Threads settings applied to every Threads target: text, reply_control, topic_tag, link_attachment and thread, each optional. Null when the post has none. See Threads settings. |
| subtitles | object | null | The video’s subtitles: language (a BCP-47 tag), name (or null), bytes and cue_count. Never the file itself: read it from GET /v1/posts/:id/subtitles. YouTube gets them as the video’s captions. Null when the post has none. |
| schedule_at | string | null | ISO 8601. When the scheduler becomes eligible to publish it. |
| published_at | string | null | ISO 8601. Set when the first target goes live. |
| source | string | dashboard, api, or mcp — where the post was created. |
| created_at | string | ISO 8601. |
| media | Media[] | Ordered media items, each with its file’s alt text (and, on a carousel, its deprecated per-slide caption). |
| targets | Target[] | One per account. |
| link_parent_id | string | null | The parent post this one is linked to (pass it on create or update). Its text may hold {{link:parent}}, or {{link:<ref>}} for a sibling, which Relay fills in with that post’s link when this one goes out; a line whose link isn’t live yet is left out whole. Null when it has no parent. |
| link_ref | string | This post’s ref in placeholders ({{link:<ref>}}): the first 8 characters of its id. |
| schedule_after_parent_min | number | null | Minutes after the parent goes live that this post goes out, instead of a time of its own. Null for a fixed time. |
| schedule_released_at | string | null | ISO 8601. When a post that waits for its parent got its time, the parent having gone live. Null while it waits. |
| linked_posts | object[] | The family: the parent first, then its children, each with id, ref, is_parent, caption, status, schedule_at, published_at, schedule_after_parent_min and targets (platform, username, status, linkable, permalink). Empty when the post is in none. |
| link_warnings | object[] | What its placeholders will do if it goes out when it is meant to: code (link_not_live_in_time, link_not_public or link_missing), token, post_id and message. |
| resolved_links | object | null | Once sent: each placeholder and the link it became, or null where its line was left out. |
Target
| Field | Type | Description |
|---|---|---|
| id | string | UUID of the post↔account row. |
| account_id | string | The connected account. |
| username | string | Handle at publish time. |
| platform | string | instagram, tiktok, youtube or threads. |
| status | string | pending, uploading, processing, published, failed, cancelled. |
| platform_post_id | string | null | The platform’s post ID once published (TikTok: once public; YouTube: the video ID, set as soon as the upload completes; Threads: the first post’s ID, set as soon as it is live, even while the rest of its thread goes out). |
| permalink | string | null | Public post URL. On TikTok it can arrive a little after published, once TikTok’s review finishes; SELF_ONLY posts have none. On YouTube it is https://www.youtube.com/shorts/<id> for a Short and https://www.youtube.com/watch?v=<id> otherwise. On Threads it is https://www.threads.com/@<handle>/post/<code>, the thread’s first post. |
| published_at | string | null | ISO 8601. |
| error | { code, message } | null | Populated on failure, and occasionally as a non-fatal breadcrumb (for example quota_exceeded while waiting, tiktok_inbox on a published target that was delivered to the TikTok inbox, youtube_processing on a YouTube video still processing, youtube_private when YouTube kept it private, threads_thread_posting on a Threads target whose first post is live while the rest of its thread goes out, or threads_thread_stopped on one whose thread stopped early). On a published Instagram target it says what Instagram did with the post: instagram_caption_dropped, instagram_ai_label_missing or instagram_copyright_match. Each platform's codes are in its failure reference (Instagram, YouTube, Threads). |
| first_comment_status | string | null | pending, posted or failed: the first comment, apart from the target’s own status (a comment that fails leaves the post published). Null when the post has no first comment. |
| followups | { kind, status, message }[] | What Relay does on the target once it is live, each with its own outcome: instagram_comments_off (turning comments off), youtube_thumbnail (setting the thumbnail) and youtube_captions (adding the post’s subtitles as the video’s captions). status is pending, done or failed, and message says why one failed. A failed follow-up leaves the target published. Empty when there is none. |
Media
| Field | Type | Description |
|---|---|---|
| id | string | UUID — pass this in post media. |
| url | string | Public URL Instagram, TikTok and Threads fetch from. Relay uploads YouTube videos itself. |
| kind | string | image or video. |
| content_type | string | image/jpeg, video/mp4, video/quicktime. |
| size_bytes | number | null | Stored size. |
| width | number | null | Pixels, as displayed. Parsed for JPEGs, and for MP4/MOV videos from the video track’s header (a rotated phone video reads as portrait). Null when it couldn’t be read, and on videos stored before Relay read their size. |
| height | number | null | Pixels, as displayed — read the same way as width. |
| duration_ms | number | null | Video length, read from the MP4/MOV header at upload (TikTok checks it against the creator’s limit; with the size, it tells a YouTube Short from a video). Null for images. |
| poster_url | string | null | A video’s still: a JPEG of one frame, at most 640 pixels wide, made a minute or so after the upload. Null for images, until it is made, and for a video Relay couldn’t read a frame of. |
| name | string | The name the file was given (the upload page, name on POST /v1/media), else the stored file’s own. |
| alt_text | string | null | What the file shows, for people who can’t see it: sent as alt text to Instagram (feed and carousel images) and Threads with every post that uses the file. Set with PATCH /v1/media/:id or a media entry’s alt_text. Null when there is none. |
| description | string | null | The same value as alt_text, under its old name. |
| created_at | string | ISO 8601. |
| caption | string | null | Deprecated: a carousel slide’s own caption, kept and shown but posted nowhere (Instagram shows no per-slide caption). Null elsewhere and on uncaptioned slides. |
caption appears only on media inside a post: the media-library object — what POST /v1/media, PATCH /v1/media/:id and the MCP media_upload tool return — has none. alt_text is the file’s own, the same in every post that uses it; the library’s object adds used (a post uses it, as media or as its cover) and group_count.
Account
Returned by GET /v1/accounts in camelCase: id, platform, username, displayName, status, tokenExpiresAt, connectedAt, followersCount, mediaCount, statsSyncedAt. The MCP accounts_list tool returns the same account in snake_case with a derived health and token_expires_in_days. For a YouTube account, username is the channel's handle (its title when it has none) and displayName its title. For a Threads account, username is the profile's @username and displayName its name.
Status reference
Post status
| Status | Meaning |
|---|---|
| draft | Not queued: saved in the dashboard without a schedule, staged by an agent, or waiting for a person — a post with a YouTube account, or a TikTok Direct Post, made with an API key. |
| scheduled | Queued. The scheduler will pick it up at schedule_at. |
| publishing | Claimed by the scheduler; at least one target is still in flight. No longer editable. |
| published | Every target is live. |
| partly | Some targets are live, others failed. Inspect targets[] to see which. |
| failed | Every target failed. |
| cancelled | Cancelled before publishing. |
Target status
| Status | Meaning |
|---|---|
| pending | Not started. |
| uploading | Carousel children are being created and transcoded (Instagram and Threads), or a YouTube video is being uploaded. |
| processing | The platform has the media; waiting for Instagram, TikTok, YouTube or Threads to finish processing it. A Threads target whose first post is live stays here, with its permalink, while the rest of its thread goes out. |
| published | Live, with a platform_post_id and usually a permalink. |
| failed | Terminal. Read error.code. |
| cancelled | The post was cancelled before this target ran. |