For local media, first prepare direct uploads with platform: "threads" and use { "upload_id": "..." } media references. Threads fetches media by URL, so Adeli serves each file to Threads from its own storage while the post is published.
A Threads post is text, media, or both. One media item makes an image or video
post; 2 to 20 make a carousel. Send thread to publish several posts, each a
reply to the one before. The response is the finished post: a video can take a
few minutes while Threads processes it.
Body
platform"threads"RequiredaccountIduuidRequired- A connected Threads account in your organization.
profileIduuid- Optional, because accountId names its profile. If you pass both, they must agree.
textstringRequired- Up to 500 characters, counted as Threads counts them: each emoji is its length in UTF-8 bytes, so most count as 4. At most 5 links. Send
""for a media-only post. A text post's first link becomes a preview card. mediaobject[]- Up to 20 items. Each is
{ upload_id }(JPEG, PNG or WebP images up to 8 MB; MP4 or MOV video up to 1 GB and 5 minutes), an image as{ content_type, base64 }, or a video as{ url }, a public HTTPS MP4 or MOV. Any item takes an optionalaltText, up to 1,000 characters. replyControlstring- Who can reply to the first post:
everyone(the default),accounts_you_follow,followers_only,mentioned_only, orparent_post_author_only. topicTagstring- One topic for the first post, 1 to 50 characters, without
.or&. threadobject[]- Up to 24 further posts, each
{ text, media }with the same rules, published in order as replies.
201 when every post is live. Images are re-encoded as JPEG, upright, before
Threads fetches them.
Threads can't publish a thread atomically. When a post after the first fails,
the posts before it are already live and stay live: the response is 207 with
status: "partial", the failed post's error, and not_attempted for the
rest. Publish the remainder yourself as replies to the last providerId that
went live. A failure on the first post publishes nothing and is an ordinary
error.
Threads limits each account to 250 posts and 1,000 replies in any 24 hours; a
carousel is one post, and each later post in a thread is a reply. Past either,
the request answers 429 rate_limited. A video Threads is still processing
after 4 minutes answers 504 media_processing_timeout; retry the post later.