Relay docs
What Relay does
Publishing to Instagram, TikTok, YouTube or Threads from an API is more involved than one HTTP call. You need reviewed developer apps, tokens that expire (60 days on Instagram and Threads, 24 hours on TikTok, an hour on YouTube), publicly reachable media URLs or a resumable upload, an asynchronous create → poll → publish handshake, and caps that silently stop you — 50 posts a day per account on Instagram, 250 on Threads, about 15 on TikTok, and a daily upload quota on YouTube. Relay owns all of that.
- Connections. OAuth with Instagram Login, TikTok Login Kit, Google and Threads, tokens encrypted at rest (AES-256-GCM) and refreshed automatically before they expire.
- Media. Upload bytes, send base64 inline (over the API or MCP), or hand Relay a public URL; it validates the format, dimensions and video length against each platform's rules and hosts the file for you. Agents holding a local file with no public URL to offer can park it at POST /v1/uploads (a video over 90 MB, up to 2 GB, in parts through POST /v1/uploads/sessions) and pass back the short-lived link it returns.
- Scheduling. A scheduler claims due posts every minute, so "publish now" and "publish next Tuesday at 09:00" are the same code path.
- Delivery. Instagram containers and carousel children, TikTok video and photo posts (straight to the profile or into the TikTok inbox), YouTube Shorts and videos (a resumable upload that picks up where it stopped), Threads text posts, images, videos, carousels and multi-post threads, status polling, retries on transient errors, and a per-account outcome you can read back — with the platform's own error code and message when something is rejected.
One post can target several accounts. Each target succeeds or fails independently, which is why a post can end up partly published.
tiktok object — who can view the post, which interactions are allowed, and any commercial disclosure — because TikTok requires the creator to choose those. See TikTok requirements. YouTube posts need a youtube object — the video's title, its visibility, and whether it is made for kids — and one made with an API key is saved as a draft for a person to upload from Relay, because YouTube requires the person to see its upload notice and confirm. See YouTube requirements. A post to Threads accounts alone may be text only, and Threads counts its 500 characters its own way (an emoji counts as several); an optional threads object says who can reply, sets a topic or a link preview, and adds further posts that make it a thread. See Threads requirements.Core objects
Five objects carry the whole model. Every one of them is scoped to your account.
| Object | What it is |
|---|---|
| account | A connected Instagram, TikTok or Threads profile, or a YouTube channel. Carries the encrypted tokens, connection health, token expiry, and cached follower/media counts. Its id is what you pass as a post target. |
| media | An image or video stored by Relay and served from a public URL — which is what Instagram, TikTok and Threads fetch at publish time (Relay uploads YouTube videos itself). Reusable across posts. |
| post | A caption, an ordered list of media (none on a Threads text post), a post type, TikTok settings when it targets TikTok, YouTube settings when it targets YouTube, Threads settings when it targets Threads, and a schedule. Carousel slides can each carry their own caption on top of the post’s. Holds the roll-up status across all its targets. |
| target | One post ↔ one account. Owns the real outcome: the platform’s post ID, the permalink, and the error if it failed. |
| api key | A rly_live_… secret that authorizes both the REST API and the MCP server. Only a SHA-256 hash is stored, so a lost key can be revoked but never recovered. |
Publishing lifecycle
Creating a post never blocks on Instagram. The API validates and queues; a scheduler running every minute does the work. That means a successful POST /v1/posts means "accepted", not "live" — read the post back to find out what happened.
create ─► scheduled ──(scheduler claims it)──► publishing ─┬─► published all targets ok
├─► partly some ok, some failed
└─► failed every target failed
per target: pending ─► uploading (carousel children, YouTube upload) ─► processing ─► published
└─► failedImages usually finish inside the tick that claims them. Video is slower: Instagram transcodes asynchronously, so the target sits in processing and Relay re-checks it on later ticks. A YouTube video is uploaded in pieces over one or more ticks, then processed by YouTube. A Threads text post, or a short thread of them, usually goes out in one or two ticks. Transient platform errors (429s, 5xx) don't fail a post — they're retried. See Timing & retries, YouTube quota & timing and Threads publishing for the exact budgets.
Quickstart
Five minutes from nothing to a scheduled post.
1. Create an API key
In the dashboard, go to API keys and create one. The full value is shown exactly once — store it in your secret manager. The same key authorizes the REST API and the MCP server.
2. Connect an account
Go to Accounts → Connect account and pick Instagram, TikTok, YouTube or Threads. An Instagram account must be a professional one (Business or Creator); personal accounts are rejected during the connect flow, not at publish time. Any TikTok account works. For YouTube, sign in with the Google account that owns or manages the channel and leave every permission ticked. Any Threads profile works, with or without a linked Instagram account: sign in with your Threads login and leave the posting permission ticked.
3. Find the account ID
curl 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",
"status": "connected",
"followersCount": 12840
}
]
}4. Schedule a post
Media can be a public URL — Relay fetches and stores it — or an ID from an earlier upload. Omit schedule_at to publish on the next tick instead.
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"
}'5. Check what happened
curl https://api.relay.lantean.tech/v1/posts/<post_id> \ -H "Authorization: Bearer $RELAY_API_KEY"
Each entry in targets carries its own status, the permalink once live, and an error object with the platform's code and message when it isn't.
Limits at a glance
| Limit | Value | Where it comes from |
|---|---|---|
| API requests | 120 / minute per key | Relay |
| Failed auth attempts | 30 / minute per IP | Relay |
| Published posts | 50 / rolling 24h per account | |
| Published posts | ~15 / day per creator, across all apps; 5 waiting inbox uploads | TikTok |
| Caption | 1–2,200 characters, at most 30 hashtags and 20 @mentions | |
| Alt text | 1–1,000 characters per file, sent on images (Instagram) and every item (Threads) | Relay |
| Carousel items | 2–20 | |
| Reels and story videos | Reels 3 seconds – 15 minutes; story videos 3 – 60 seconds | |
| Photo post images | 1–35 (images only) | TikTok |
| Video length | The creator’s limit: 3, 5 or 10 minutes | TikTok |
| Uploads | A daily quota shared by every Relay user (100 a day by default, reset at midnight Pacific), plus each channel’s own daily limit | YouTube |
| YouTube title | 1–100 characters, no < or > | YouTube |
| YouTube description | ≤ 5,000 bytes, no < or > (the caption, unless youtube.description is set) | YouTube |
| YouTube tags | Up to 100, 500 characters together (commas and quotes count) | YouTube |
| Shorts | Square or vertical, ≤ 3 minutes — YouTube decides; anything else is a regular video | YouTube |
| YouTube video length | ≤ 15 minutes unless the channel is allowed long uploads (verified) | YouTube |
| Published posts | 250 / rolling 24h per profile (a carousel, or a thread’s first post, counts once); 1,000 replies, a thread’s further posts included | Threads |
| Threads text | 1–500 characters by Threads’ count (an emoji counts its UTF-8 bytes: 😀 is 4), ≤ 5 links | Threads |
| Threads posts | Text only, 1 image, 1 video ≤ 5 minutes, or a carousel of 2–20 images and videos; a thread up to 10 posts | Threads |
| Image | JPEG, ≤ 8 MB, 4:5 – 1.91:1 (the dashboard converts and fits other formats for you) | |
| Video | MP4 / MOV, ≤ 2 GB | Relay (TikTok and YouTube allow more; Instagram Reels stop at 300 MB, stories at 100 MB, Threads at 1 GB) |
| Schedule granularity | ~60 seconds | Relay scheduler |
| Idempotency replay window | 24 hours | Relay |
Support
Questions, bug reports, and access requests go to support@lantean.tech. When reporting a failed publish, include the post ID and the error.code from the target — that's enough to trace it end to end.