Webhooks for Threads allow you to receive real-time notifications for the subscribed topics and fields.
To receive live webhook notifications, the following conditions must be satisfied:
threads_basic
, threads_read_replies
for reply webhooks). Download the webhooks sample app to test your integration.
Under Use Cases > Customize > Settings, add the Get real-time notifications with Threads Webhooks sub-use case.
Create an endpoint that accepts and processes webhooks. To add the configuration:
The token here is passed to your server defined in the callback URL to allow verification that the call originates from Meta servers.
Name | Description |
---|---|
| Replies on a Threads Media owned by the Threads install user. |
Name | Description |
---|---|
| Mentions on a public Threads Media tagging the Threads install user. |
If you subscribe to the replies
field, we send your endpoint a webhook notification containing the reply object.
{ "app_id": "123456", "topic": "moderate", "target_id": "78901", "time": 1723226877, "subscription_id": "234567", "has_uid_field": false, "values": { "value": { "id": "8901234", "username": "test_username", "text": "Reply", "media_type": "TEXT_POST", "permalink": "https:\/\/www.threads.net\/@test_username\/post\/Pp", "replied_to": { "id": "567890" }, "root_post": { "id": "123456", "owner_id": "123456", "username": "test_username_2" }, "shortcode": "Pp", "timestamp": "2024-08-07T10:33:16+0000" }, "field": "replies" } }
If you subscribe to the mentions
field, we send your endpoint a webhook notification containing the media object in which the user is mentioned.
{ "app_id": "123456", "topic": "interaction", "target_id": "78901", "time": 1723226877, "subscription_id": "234567", "has_uid_field": false, "values": { "value": { "id": "8901234", "alt_text": "test alt text", "gif_url": "https://media2.giphy.com/media/v1.Y2lkPTA1NzQyMTNjd2R0MXcybjZ6bDNyam9qaXJsN3RicnVncnFsanJ2dGk3eDJiejRmbyZlcD12MV9naWZzX2dpZklkJmN0PWc/3o85xEFRBYvAnamJnG/200.gif", "has_replies": true, "is_quote_post": false, "is_reply": false, "link_attachment_url": "https://developers.facebook.com/docs/threads/webhooks/", "media_product_type": "THREADS", "media_type": "TEXT_POST", "media_url": "TEXT_POST", "id": "8901234", "permalink": "https:\/\/www.threads.net\/@test_username\/post\/Pp", "root_post": { "id": "8901234", "owner_id": "78901", "username": "test_username" }, "shortcode": "Pp", "text": "Reply", "timestamp": "2024-08-07T10:33:16+0000" "username": "test_username", }, "field": "mentions" } }
Note: Additional fields not listed in this sample response that are returned when applicable include: media_url
, poll_attachment
, quoted_post
, replied_to
, reposted_post
, root_post
, and thumbnail_url
.