Relay
DocsLog inSign up

REST API

Schedule, publish, and inspect Instagram, TikTok, YouTube and Threads posts over plain HTTP. JSON in, JSON out, one bearer token. Every capability here is also exposed to agents through the MCP server.
This page is the scheduler’s API, for 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.

Field naming is not uniform yet. Post, media, and target objects use 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 lastUsedAt timestamp 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 revoked

Rate limits

ScopeLimitResponse when exceeded
Per API key120 requests / minute429 with Retry-After
Per user (all keys combined)300 requests / minute429 with Retry-After
Failed auth per IP30 attempts / minute429 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.

Relay's request limit is separate from Instagram's publishing quota of 50 posts per rolling 24 hours per account, Threads' 250 posts per profile, and YouTube's daily upload quota. Hitting any of them does not produce an HTTP error — see Publishing quota, Threads' daily limits and YouTube quota & timing.

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/retry and DELETE /v1/posts/:id ignore the header — their status guards make an accidental duplicate a safe 400 (the post is already scheduled or cancelled), not a second execution.
  • POST /v1/uploads ignores 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

StatusMeaningWhat to do
400Validation 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.
401Missing, malformed, unknown, or revoked API key.Check the header; rotate the key if it was revoked.
404No such post or media file, or it belongs to another account.Do not retry.
411POST /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.
413POST /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.
429Rate limited.Sleep for Retry-After seconds, then retry.
5xxTransient 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"
}
codeMeaning
alt_text_conflictalt_text and description (its old name) were both sent and differ.
cover_image_unusedcover_image was set, but no target takes a cover image (an Instagram Reel, a YouTube video).
cover_image_not_jpegcover_image is not a JPEG image.
cover_frame_unusedcover_frame_ms was set, but no target takes a frame (an Instagram Reel, a TikTok Direct Post video).
cover_frame_out_of_rangecover_frame_ms is at or past the end of the video.
cover_frame_conflictcover_frame_ms and the deprecated tiktok.cover_timestamp_ms were both sent and differ.
instagram_captionThe caption has more than 30 hashtags or 20 @mentions, which Instagram refuses.
instagram_video_lengthA Reel outside 3 seconds to 15 minutes, or a story video outside 3 to 60 seconds.
subtitles_need_videosubtitles were set on a post without a video.
video_too_largeA 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_onlyinstagram.trial_graduation on a post that is not a Reel.
instagram_trial_share_to_feedA trial Reel with share_to_feed true: a trial goes to non-followers first.
instagram_ai_label_storyinstagram.ai_generated on a story, which Instagram labels nowhere.
instagram_comments_off_storyinstagram.comments_off on a story, which has no comments.
instagram_comments_permissioninstagram.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_rangetiktok.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.

This scheduler API has no webhooks. To track a publish, poll the post — every ~30 seconds is plenty, since the scheduler itself runs once a minute. The growth API (below) sends signed webhooks for published and failed posts, new moves, high-intent signals, decided experiments and attributed revenue.

Endpoints

GET/v1/accounts
List connected social accounts, newest connection first. The ids returned here are what post targets refer to.
curl https://api.relay.lantean.tech/v1/accounts \
  -H "Authorization: Bearer $RELAY_API_KEY"
200 OK
{
  "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.

GET/v1/accounts/:id/tiktok/creator-info
What a TikTok account allows right now, asked live from TikTok. Call it before creating a TikTok post: privacy_level must be one of privacy_level_options.
200 OK
{
  "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.

GET/v1/accounts/:id/youtube/channel-info
The YouTube channel an account uploads to, asked live from YouTube. Call it before creating a YouTube post and show the person the channel's title, so they know where the video goes. Needs canListVideos.
200 OK
{
  "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.

POST/v1/posts
Create a post and queue it for publishing. Returns 201 with the queued post; delivery happens asynchronously.
FieldTypeDescription
targetsstring[] requiredAccount IDs to post to (from accounts_list), up to 10 Example: ["9d1f…"]
captionstring requiredCaption 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_typestring?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_feedboolean?Reels only: also show the reel on the profile grid (Instagram defaults to true) Example: false
first_commentstring?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_imagestring?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_msnumber?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
instagramobject?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 }
tiktokobject?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 }
youtubeobject?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 }
threadsobject?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."] }
subtitlesobject?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_atstring?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_idstring?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_minnumber?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"
  }'
201 Created
{
  "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

Reel, kept off the profile grid
{
  "targets": ["9d1f…"],
  "caption": "Behind the drop.",
  "post_type": "reel",
  "media": ["https://cdn.example.com/behind.mp4"],
  "share_to_feed": false
}
Carousel from previously uploaded media
{
  "targets": ["9d1f…"],
  "caption": "Every colourway.",
  "media": ["a1b2c3d4-…", "e5f6a7b8-…", "c9d0e1f2-…"]
}
Carousel with alt text on its images
{
  "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-…"
  ]
}
Reel with a cover image, Instagram's AI label and comments off
{
  "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 }
}
Trial Reel, cover picked from the video
{
  "targets": ["9d1f…"],
  "caption": "Testing a new hook.",
  "post_type": "reel",
  "media": ["e5f6a7b8-…"],
  "cover_frame_ms": 2000,
  "instagram": { "trial_graduation": "performance" }
}
Story (Instagram shows no caption on stories)
{
  "targets": ["9d1f…"],
  "caption": "internal note — not shown",
  "post_type": "story",
  "media": ["https://cdn.example.com/story.jpg"]
}
Fan out to several accounts
{
  "targets": ["9d1f…", "4a7b…"],
  "caption": "Same drop, two brands.",
  "media": ["a1b2c3d4-…"]
}
A YouTube Short (saved as a draft for a person to upload)
{
  "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
  }
}
A Threads text post, as a thread of three
{
  "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."
    ]
  }
}
GET/v1/posts
List posts newest-first, with their media and per-account targets.
Query paramTypeDescription
statusstring?draft | scheduled | publishing | published | partly | failed | cancelled
limitnumber?1–100, default 20
cursorstring?next_cursor from a previous page
200 OK
{
  "posts": [ /* post objects, newest first */ ],
  "next_cursor": "MjAyNi0wNy0zMFQxMTo0Mzoy…"
}
GET/v1/posts/:id
Fetch one post with its per-target delivery timeline — the endpoint to poll after creating a post.
200 OK — one target live, one rejected
{
  "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.

PATCH/v1/posts/:id
Edit an unpublished post: caption, first_comment, share_to_feed, cover_image, cover_frame_ms, instagram, tiktok, youtube, threads, schedule_at, or any combination of them.
curl -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.

GET/v1/posts/:id/subtitles
Download a post's subtitles: the SubRip (.srt) file as it was stored, as application/x-subrip with a file name. 404 when the post has none.

Subtitles 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.

POST/v1/posts/:id/retry
Re-queue a failed or partly-published post for another attempt. Returns the re-queued post.
curl -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.

DELETE/v1/posts/:id
Cancel a draft or scheduled post before it publishes. Returns the cancelled post.

Cancellation 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.

POST/v1/posts/:id/duplicate
Copy any post into a new draft — same caption, per-slide captions, type, first comment, cover, subtitles, Instagram, TikTok, YouTube and Threads settings, targets, and media. With ?linked=1 the copy is a linked post of the original (or of its parent, when the original is a linked post). Returns 201 with the draft.
POST/v1/media
Store a file in Relay — from a public URL or inline base64 — and return a reusable media ID.
curl -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" }'
Inline upload (base64 or data: URI)
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\" }"
201 Created
{
  "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) or data (the file content itself, as raw base64 or a data: URI). With data, the type comes from content_type, the data: URI, or the bytes themselves, in that order.
  • Accepted types: image/jpeg (≤ 8 MB), video/mp4 and video/quicktime (≤ 2 GB from a url). 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 data travels 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 use url.
  • 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; description is its old name, and sending both with different text is a 400 alt_text_conflict) and group, 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's group is that group, or null. A group id that isn't yours is a 400, and nothing is stored.
  • Uploading is optional — POST /v1/posts accepts URLs directly. Upload first when you want to reuse one asset across posts or validate it before composing.
PATCH/v1/media/:id
Change a stored file's alt text or name — the REST twin of the media_update MCP tool. Returns the file as the library lists it.
FieldTypeDescription
namestring?The name the media library shows the file by, 1–255 characters. Omit to keep it Example: "fall-drop-hero.jpg"
alt_textstring?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." }'
200 OK
{
  "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.

POST/v1/uploads
Park a local file somewhere public and get a short-lived URL back, so you have something to pass as a media entry.
curl -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
201 Created
{
  "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"
  }
}
Then use it like any other URL
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-Type identifies the format and Content-Length is 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/media instead.
  • Same accepted types as POST /v1/media, and the file is this one request: image/jpeg (≤ 8 MB), video/mp4 and video/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 data inflates 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 429 with Retry-After. Idempotency-Key is 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.
POST/v1/uploads/sessions
Start sending a video too big for POST /v1/uploads' one request — up to 2 GB — in parts. Finishing it gives the same short-lived public URL.
curl -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 }'
201 Created
{
  "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/mp4 or video/quicktime) and size_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 to POST /v1/uploads as they are (a 400 here). Over 2 GB is a 413 with code: "file_too_large".
  • The file goes up in part_count parts of part_size bytes (32 MiB), the last one the rest of the file: part n is the bytes from offset (n − 1) × part_size. Send each to parts_url/<n>, then finish at complete_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 a 404 — 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 429 with Retry-After, before anything is opened.
The whole upload, in a shell (curl, dd and jq)
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]}"
PUT/v1/uploads/sessions/:token/parts/:n
Send part n (from 1) of a session: its raw bytes as the body, with Content-Length set.
200 OK
{ "part_number": 1, "etag": "6a1f…" }
  • Every part is exactly part_size bytes except the last. A part of any other length is a 400 before a byte is kept, one the plan has no room for a 404, and one without Content-Length a 411.
  • 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.
POST/v1/uploads/sessions/:token/complete
Join the parts into the staged file. Answers 201 with the same { upload } as POST /v1/uploads.
curl -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…" }, …] }'
201 Created
{
  "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"
  }
}
  • parts lists every part once, as each answered. A part missing is a 400 that says how many there should be.
  • Use upload.url as a media entry on POST /v1/posts or as POST /v1/media's url before upload.expires_at, as with POST /v1/uploads. Finishing again after a lost answer returns the same upload.
DELETE/v1/uploads/sessions/:token
Abandon a session: the parts sent are dropped, and a finished file is deleted. Answers 204.
GET/v1/library
The media library, newest first: every image and video stored in Relay, with its name, alt text, whether a post uses it (as media or as a cover) and how many upload groups it is in. Query: filter (all | images | videos | unused), page, page_size (1–100, default 24).
200 OK
{
  "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.

Insights, DMs, TikTok and YouTube video lists, and hiding Threads replies need a permission the account must have granted — check 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.
POST/v1/accounts/:id/refresh
Re-sync the account's profile and follower/media counts now instead of waiting for the daily sync. Returns { account } in the snake_case accounts_list shape. A dead token marks the account reconnect_required.

Instagram media & comments

GET/v1/accounts/:id/instagram/media
What is live on the account, newest first, with like and comment counts and whether comments are on. limit 1–50 (default 25).
200 OK
{
  "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…"
}
GET/v1/accounts/:id/instagram/media/:mediaId/comments
Top-level comments, newest first, each with its replies. Hidden comments are included with hidden: true. limit 1–50 (default 25).
200 OK
{
  "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
}
POST/v1/accounts/:id/instagram/comments/:commentId/replies
A public reply as the account is a person's to send: every API key gets 403 with the reason. Draft the reply for the user to send from Relay's Inbox or in Instagram.
PATCH/v1/accounts/:id/instagram/comments/:commentId
Hide or unhide a comment. Body { "hide": true }. A hidden comment stays visible to its author. Returns { comment_id, hidden }.
DELETE/v1/accounts/:id/instagram/comments/:commentId
Delete a comment or reply permanently. Returns { comment_id, deleted: true }. Prefer hiding unless deletion was asked for.
PATCH/v1/accounts/:id/instagram/media/:mediaId
Turn comments on or off for one post. Body { "enabled": false }. Returns { media_id, comments_enabled }.
GET/v1/accounts/:id/instagram/publishing-limit
Instagram's rolling 24-hour publishing quota: { used, total, remaining }. A carousel counts as one.

Instagram insights

GET/v1/accounts/:id/instagram/media/:mediaId/insights
Reach, views, likes, comments, saves, shares, and total interactions for one post; reels add watch time (ms), stories report replies. Needs canReadInsights.
200 OK
{
  "media_id": "17900000000000001",
  "product_type": "FEED",
  "metrics": { "reach": 1204, "views": 1890, "likes": 214, "comments": 3,
               "saved": 14, "shares": 3, "total_interactions": 234 }
}
GET/v1/accounts/:id/instagram/insights
Account totals over a range: since and until (ISO 8601; default the last 7 days, at most 30). Add breakdown=age|gender|city|country for follower demographics (accounts with 100+ followers). Needs canReadInsights.
200 OK
{
  "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.

GET/v1/accounts/:id/instagram/conversations
DM threads, most recently active first: [{ id, updated_at, participants: [{ id, username }] }] (the account itself excluded). limit 1–50 (default 20).
GET/v1/accounts/:id/instagram/conversations/:conversationId/messages
The latest messages in a thread (up to 20, all Instagram exposes), newest first, each inbound or outbound, plus the reply window.
200 OK
{
  "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" }
}
POST/v1/accounts/:id/instagram/conversations/:conversationId/messages
A DM reply as the account is a person's to send: every API key gets 403 with the reason. Draft it for the user to send from Relay's Inbox or in Instagram, while the thread's window is open.

TikTok videos

GET/v1/accounts/:id/tiktok/videos
The account's public videos, newest first, with view, like, comment, and share counts — including videos posted outside Relay. limit 1–20 (default 20). Needs canListVideos.
200 OK
{
  "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"
}
POST/v1/accounts/:id/tiktok/videos/query
Current stats for specific videos. Body { "video_ids": ["…"] } (1–20). Private and still-moderating videos are not returned. Needs canListVideos.

YouTube 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.

GET/v1/accounts/:id/youtube/videos
The channel's uploads, newest first, straight from YouTube — including videos uploaded outside Relay, and private and unlisted ones, which the channel's owner sees — with their visibility, processing status and view, like and comment counts. limit 1–50 (default 20); cursor is the previous page's next_cursor. Needs canListVideos.
200 OK
{
  "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).

POST/v1/accounts/:id/youtube/videos/query
Current stats for specific videos on the channel. Body { "video_ids": ["…"] } (1–50 ids, 11 characters each). Returns { account_id, videos } in the same shape as the list; a video YouTube no longer has is left out. Needs canListVideos.

Threads 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.

GET/v1/accounts/:id/threads/posts
What is live on the account, newest first, straight from Threads — posts made in the Threads app included; the account's replies (a thread's further posts among them) are not listed. No counts here. limit 1–50 (default 25). Works for any connected Threads account.
200 OK
{
  "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…"
}
GET/v1/accounts/:id/threads/posts/:mediaId/insights
A post's lifetime views, likes, replies, reposts, quotes and shares, each a number or null when Threads didn't report it. Threads labels views and shares as still in development. Needs canReadInsights.
200 OK
{
  "media_id": "18050000000000001",
  "metrics": { "views": 1840, "likes": 96, "replies": 14, "reposts": 6, "quotes": 2, "shares": 9 }
}
GET/v1/accounts/:id/threads/insights
Account totals over a range: since and until (ISO 8601; default the last 7 days, at most 30; nothing before 2024-04-13) — views of the profile, likes, replies, reposts, quotes and link clicks — and followers_count now. Needs canReadInsights.
GET/v1/accounts/:id/threads/publishing-limit
Threads' rolling 24-hour quotas: { posts: { used, total, remaining }, replies }. 250 posts (a carousel counts as one) and 1,000 replies (a thread's further posts count here); replies is null without canComment.
GET/v1/accounts/:id/threads/posts/:mediaId/replies
The replies to one of the account's posts at every depth, newest first: is_top_level marks those made straight to the post, replied_to_id what each answers, hidden the hidden ones and is_mine the account's own. limit 1–50 (default 25). Needs the permission to read replies, which no flag shows: without it the answer is a 400 saying so.
200 OK
{
  "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
}
PATCH/v1/accounts/:id/threads/replies/:replyId
Hide or unhide a reply. Body { "hide": true }. Only a reply made straight to the post can be hidden, and hiding it hides the replies under it too. Returns { reply_id, hidden }. Needs canComment.
POST/v1/accounts/:id/threads/posts/:mediaId/replies
A public reply as the account is a person's to send: every API key gets 403 with the reason. Draft the reply for the user to send from the post's page in the Relay dashboard, or in Threads.

Object reference

Post

FieldTypeDescription
idstringUUID.
captionstringCaption text, 1–2,200 characters. On Threads it is the post’s text unless threads.text is set.
statusstringRoll-up across targets — see status reference.
post_typestring | nullfeed, carousel, reel, story, or text (a post to Threads accounts alone with no media). Null only for a media-less draft.
share_to_feedboolean | nullReels only. Null means Instagram’s default (shown on the grid).
first_commentstring | nullPosted as a comment on each Instagram target once it is live. Null when there is none.
cover_image{ id, url } | nullThe 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_msnumber | nullThe 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.
instagramobject | nullInstagram settings applied to every Instagram target: ai_generated, trial_graduation and comments_off, each optional. Null when the post has none. See Instagram settings.
tiktokobject | nullTikTok settings applied to every TikTok target (mode, privacy_level, interactions, disclosure). Null when the post has no TikTok target. See TikTok settings.
youtubeobject | nullYouTube 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.
threadsobject | nullThreads 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.
subtitlesobject | nullThe 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_atstring | nullISO 8601. When the scheduler becomes eligible to publish it.
published_atstring | nullISO 8601. Set when the first target goes live.
sourcestringdashboard, api, or mcp — where the post was created.
created_atstringISO 8601.
mediaMedia[]Ordered media items, each with its file’s alt text (and, on a carousel, its deprecated per-slide caption).
targetsTarget[]One per account.
link_parent_idstring | nullThe 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_refstringThis post’s ref in placeholders ({{link:<ref>}}): the first 8 characters of its id.
schedule_after_parent_minnumber | nullMinutes after the parent goes live that this post goes out, instead of a time of its own. Null for a fixed time.
schedule_released_atstring | nullISO 8601. When a post that waits for its parent got its time, the parent having gone live. Null while it waits.
linked_postsobject[]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_warningsobject[]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_linksobject | nullOnce sent: each placeholder and the link it became, or null where its line was left out.

Target

FieldTypeDescription
idstringUUID of the post↔account row.
account_idstringThe connected account.
usernamestringHandle at publish time.
platformstringinstagram, tiktok, youtube or threads.
statusstringpending, uploading, processing, published, failed, cancelled.
platform_post_idstring | nullThe 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).
permalinkstring | nullPublic 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_atstring | nullISO 8601.
error{ code, message } | nullPopulated 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_statusstring | nullpending, 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

FieldTypeDescription
idstringUUID — pass this in post media.
urlstringPublic URL Instagram, TikTok and Threads fetch from. Relay uploads YouTube videos itself.
kindstringimage or video.
content_typestringimage/jpeg, video/mp4, video/quicktime.
size_bytesnumber | nullStored size.
widthnumber | nullPixels, 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.
heightnumber | nullPixels, as displayed — read the same way as width.
duration_msnumber | nullVideo 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_urlstring | nullA 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.
namestringThe name the file was given (the upload page, name on POST /v1/media), else the stored file’s own.
alt_textstring | nullWhat 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.
descriptionstring | nullThe same value as alt_text, under its old name.
created_atstringISO 8601.
captionstring | nullDeprecated: 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

StatusMeaning
draftNot 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.
scheduledQueued. The scheduler will pick it up at schedule_at.
publishingClaimed by the scheduler; at least one target is still in flight. No longer editable.
publishedEvery target is live.
partlySome targets are live, others failed. Inspect targets[] to see which.
failedEvery target failed.
cancelledCancelled before publishing.

Target status

StatusMeaning
pendingNot started.
uploadingCarousel children are being created and transcoded (Instagram and Threads), or a YouTube video is being uploaded.
processingThe 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.
publishedLive, with a platform_post_id and usually a permalink.
failedTerminal. Read error.code.
cancelledThe post was cancelled before this target ran.
© 2026 Relaysupport@lantean.techPrivacyTerms