How to post to Threads with the API
Meta's Threads API publishes posts in two steps: create a container, then publish it. Here is the whole path, from permissions to carousels, with the limits that trip people up.
Before you start
You need a Meta developer app with the Threads use case, and two permissions: threads_basic, which every Threads endpoint needs, and threads_content_publish, which the publishing endpoints need.
Until your app passes App Review for those permissions, it can only post for Threads testers. Add yourself in the App Dashboard under App roles, Roles, as a Threads Tester, then accept the invite in the Threads app's settings. That is enough to build and test against your own account.
To post for other people, the app must be published and each permission approved in App Review. Plan for this early: review asks for a screencast of the feature and a privacy policy, and it takes days, not hours.
Tokens
A user signs in through Threads and your app receives an authorization code, which you exchange for a short-lived token. It lasts one hour.
Exchange it on your server for a long-lived token with the th_exchange_token grant on graph.threads.com/access_token. A long-lived token lasts about 60 days. Your app secret is part of that request, so it never belongs in a mobile app or a web page.
Refresh long-lived tokens with the th_refresh_token grant on graph.threads.com/refresh_access_token. A token can be refreshed once it is at least 24 hours old and before it expires, and each refresh gives another 60 days. A token you forget to refresh simply expires, and the user has to sign in again.
MultiPush searches Threads for your keywords and drafts the reply in your voice.
Step by step: a text post
Step 1 creates a container. Send POST /{threads-user-id}/threads with media_type=TEXT and the text. The answer is a container id, not a post: nothing is visible yet.
Step 2 publishes it. Send POST /{threads-user-id}/threads_publish with creation_id set to that container id. The answer is the id of the live post.
Meta recommends waiting about 30 seconds between the two steps, so the server can finish processing. For text the wait rarely matters. For video it does, and publishing too early is the most common reason a post fails.
Text posts are limited to 500 characters. A post may hold up to 5 unique links; since December 2025 a container with more fails at once with THREADS_API__LINK_LIMIT_EXCEEDED. The same link twice counts once.
Images and videos
For an image, create the container with media_type=IMAGE and image_url; for a video, media_type=VIDEO and video_url. The URL must be public, because Threads downloads the file itself. A link behind a login or a signed URL that expires in seconds will fail.
Images: JPEG or PNG, up to 8 MB, at least 320 pixels wide, no wider than 10:1. Bigger images are scaled down.
Videos: MOV or MP4 with H264 or HEVC, 23 to 60 frames a second, up to 5 minutes and 1 GB, with AAC audio. A 9:16 vertical video is the recommended shape.
With video, check the container before you publish: GET /{container-id}?fields=status,error_message returns IN_PROGRESS, FINISHED, ERROR, EXPIRED or PUBLISHED. Publish on FINISHED. Meta suggests asking once a minute for no more than five minutes.
Carousels
A carousel holds 2 to 20 images or videos, mixed if you like. Build it in three steps: create one container per item with is_carousel_item=true, create a parent container with media_type=CAROUSEL and children set to the item ids separated by commas, then publish the parent.
Each item follows the same image and video rules as a single post, and the whole carousel counts as one post against your daily limit.
Create the item containers first and wait until each video item is FINISHED before you create the parent. One failed item fails the whole carousel, so check them all rather than only the last one.
Links, topics, polls and more
link_attachment adds a preview card to a text post. Leave it out and the first link in a text-only post becomes the card anyway.
topic_tag sets the post's topic, one per post, 1 to 50 characters, without periods or ampersands. It is the preferred way to tag a topic; a hashtag in the text still works but is kept only for older apps.
poll_attachment adds a poll with 2 to 4 options of up to 25 characters each. quote_post_id quotes another post. text_attachment adds a long text of up to 10,000 characters with simple styling. gif_attachment adds a GIF from GIPHY. Polls, text attachments and GIFs work on text posts only.
Two flags are worth knowing: is_spoiler_media hides an image or video behind a spoiler, and is_made_with_ai labels AI-made content.
Limits and how to check them
An account can publish 250 posts through the API in any rolling 24 hours, and send 1,000 replies. A carousel counts as one post. These are per Threads account, not per app.
Ask before you hit the wall: GET /{threads-user-id}/threads_publishing_limit?fields=quota_usage,config returns how many posts the account has used and the limit. A scheduler that posts for many people should check it before each batch.
Calls in general are limited too, by a formula based on the account's impressions, so a brand-new account with no audience has the smallest budget.
Errors you will meet
Media that cannot be downloaded. The URL was private, redirected to a login, or expired. Host the file somewhere public until the post is published.
Video that fails processing. The container status shows codes such as INVALID_DURATION, INVALID_FRAME_RATE, INVALID_BIT_RATE or FAILED_PROCESSING_VIDEO. Re-encode to H264 MP4 at 30 frames a second and keep it under 5 minutes.
Publishing too early. If the publish call fails right after creating a video container, wait for FINISHED and try again with the same creation_id.
An expired token. Refresh long-lived tokens on a schedule, well before day 60, instead of waiting for the first failed post.
If you would rather not maintain any of this, a scheduler that uses the official API does it for you: MultiPush handles the containers, the waits, the token refreshes and the daily limits, and you write the post.
A checklist for a real integration
Store tokens encrypted, never in logs, and refresh them with a daily job rather than at the moment of posting.
Keep a queue. Create the container, store its id, and publish from a worker that waits and checks the status. If the worker restarts, it can pick up the stored container instead of creating a second one, which would risk a double post.
Check the quota before a batch, not after the first failure. A user who imports a month of posts into your app can reach 250 faster than you think.
Expect people to leave. Permission grants last 90 days and users can remove your app at any time, so treat a permission error as a sign that the account needs to be connected again, and tell the user in plain words.
Log what you sent and what Meta answered for each post: the container id, the status and the error code. When a user asks why a post did not go out, that log is the answer.