You can use the Threads API to publish image, video, text, or carousel posts.
This document covers:
Publishing a single image, video, or text post is a two-step process:
POST /{threads-user-id}/threads
endpoint.POST /{threads-user-id}/threads_publish
endpoint.Use the POST /{threads-user-id}/threads
endpoint to create a Threads media container.
Name | Description |
---|---|
Boolean | Required. Values: |
string | Required. Values: Note: |
URL | Optional. Required for Note: We will cURL your image using the URL provided so it must be on a public server. |
URL | Optional. Required for Note: We will cURL your video using the URL provided so it must be on a public server. |
string | Optional. Required for |
Refer to the POST /{threads-user-id}/threads
endpoint reference for additional supported parameters.
curl -i -X POST \ -d "media_type=IMAGE" \ -d "image_url=<IMAGE_URL>" \ -d "text=<TEXT>" \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads"
{ "id": "<THREADS_MEDIA_CONTAINER_ID>" }
Use the POST /{threads-user-id}/threads_publish
endpoint to publish the media container ID returned in the previous step.
It is recommended to wait on average 30 seconds before publishing a Threads media container to give our server enough time to fully process the upload. See the media container status endpoint for more details.
Name | Description |
---|---|
int | Required. |
curl -i -X POST \ -d "creation_id=<MEDIA_CONTAINER_ID>" \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads_publish"
{ "id": "<THREADS_MEDIA_ID>" }
You may publish up to 20 images, videos, or a mix of the two in a carousel post. Publishing carousels is a three-step process:
POST /{threads-user-id}/threads
endpoint.POST /{threads-user-id}/threads
endpoint.POST /{threads-user-id}/threads_publish
endpoint.Carousel posts count as a single post against a profile's rate limit.
Use the POST /{threads-user-id}/threads
endpoint to create a media container for each of the images and/or videos that will appear in the carousel.
Name | Description |
---|---|
Boolean | Required. Values: |
string | Required. Values: Note: |
URL | Optional. Required for Note: We will cURL your image using the URL provided so it must be on a public server. |
URL | Optional. Required for Note: We will cURL your video using the URL provided so it must be on a public server. |
string | Optional. |
Refer to the POST /{threads-user-id}/threads
endpoint reference for additional supported parameters.
curl -i -X POST \ -d "image_url=<IMAGE_URL>" \ -d "is_carousel_item=true" \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads"
{ "id": "<THREADS_MEDIA_CONTAINER_ID>" }
If the operation is successful, the API will return an media container ID, which can be used when creating the carousel container.
Repeat this process for each image and/or video that will appear in the carousel.
Use the POST /{threads-user-id}/threads
endpoint to create a carousel container.
Name | Description |
---|---|
string | Required. Value: |
list<int> | Required. Note: Carousels must have at least 2 and no more than 20 total images, videos, or a mix of the two. |
string | Optional. |
Refer to the POST /{threads-user-id}/threads
endpoint reference for additional supported parameters.
curl -i -X POST \ -d "media_type=CAROUSEL" \ -d "children=<MEDIA_ID_1>,<MEDIA_ID_2>,<MEDIA_ID_3>,..." \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads"
{ "id": "<THREADS_CAROUSEL_CONTAINER_ID>" }
Use the POST /{threads-user-id}/threads_publish
endpoint to publish a carousel post.
Note: Profiles are limited to 250 published posts within a 24-hour period. Publishing a carousel counts as a single post.
Name | Description |
---|---|
int | Required. |
curl -i -X POST \ -d "creation_id=<MEDIA_CONTAINER_ID>" \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads_publish"
{ "id": "<THREADS_MEDIA_ID>" }
If the operation is successful, the API will return the carousel album's Threads media ID.
Topics and links appear in posts in such a way as to encourage engagement.
Topics make posts more social by allowing central topics of discussion. You can include a topic in a post either by using the topic_tag
parameter or by including a tag within the text of a post.
topic_tag
parameterNote: Topic tags must be at least 1 character and no more than 50 characters long. The following characters are not allowed:
curl -i -X POST \ -d "media_type=TEXT" \ -d "text=<Text>" \ -d "access_token=<ACCESS_TOKEN>" \ -d "topic_tag=<TAG>" \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads"
This method is not preferred but is kept for backwards compatability.
A topic can also be attached to a post by including it in-line within the text of the post. Only one topic tag is allowed per post, so the first valid tag included in a post of any type (text-only, image, video, carousel) via the API is treated as the tag for that post.
Information to keep in mind when adding a topic to a post using an in-text tag:
The following characters are not allowed when using in-text tags with the Threads API, so any in-text tag that starts with a hash sign will end just before these characters:
To attach a link to your post, use the link_attachment
parameter when creating a media container.
If no link_attachment
parameter is provided, then the first link made in a text-only post via the API is configured as the link attachment, which displays as a preview card, to make it easier to engage with and click on.
Links can be attached when making an API call to the POST /threads
endpoint to create a media container.
Name | Description |
---|---|
URL | Optional. Note: Can only be used for |
curl -i -X POST \ -d "media_type=TEXT" \ -d "text=<TEXT>" \ -d "access_token=<ACCESS_TOKEN>" \ -d "link_attachment=<URL> \ "https://graph.threads.net/v1.0/<THREADS_USER_ID>/threads"
{ "id": "<THREADS_MEDIA_CONTAINER_ID>" }
The request above creates a Threads media container that, once published, will attach a link preview to your media.
The value for the link_attachment
URL can be retrieved by making a request to the GET /threads
or GET /{threads_media_id}
endpoint to retrieve media object(s).
Name | Description |
---|---|
URL | The URL attached to a Threads post. |
curl -s -X GET \ "https://graph.threads.net/v1.0/<THREADS_MEDIA_ID>?fields=id,link_attachment_url&access_token=<ACCESS_TOKEN>"
{ "id": "<THREADS_MEDIA_ID>", "link_attachment_url": "<LINK_ATTACHMENT_URL>", }