By default, Threads user access tokens are short-lived and are valid for one hour. However, short-lived tokens can be exchanged for long-lived tokens.
Long-lived tokens are valid for 60 days and can be refreshed as long as they are at least 24 hours old but have not expired, and the app user has granted your app the threads_basic
permission. Refreshed tokens are valid for 60 days from the date at which they are refreshed. Tokens that have not been refreshed in 60 days will expire and can no longer be refreshed.
Long-lived access tokens for private Threads profiles can now be refreshed. In addition, permissions granted to apps by app users with private profiles are now valid for 90 days.
Use the GET /access_token
endpoint to exchange a short-lived Threads user access token for a long-lived token. Once you have a long-lived token, you can use it in server-side requests or send it to the client for use there.
Your request must be made server-side and include:
Include the following query string parameters to augment the request.
Name | Description |
---|---|
string
| Required. |
string
| Required. |
string
| Required. |
curl -i -X GET "https://graph.threads.net/access_token ?grant_type=th_exchange_token &client_secret=<THREADS_APP_SECRET> &access_token=<SHORT_LIVED_ACCESS_TOKEN>"
{ "access_token": "<LONG_LIVED_USER_ACCESS_TOKEN>", "token_type": "bearer", "expires_in": 5183944 // number of seconds until token expires }
Use the [GET /refresh_access_token
endpoint] to refresh unexpired long-lived Threads user access tokens. Refreshing a long-lived token makes it valid for 60 days again. Long-lived tokens that have not been refreshed in 60 days will expire.
Your request must include:
Name | Description |
---|---|
string
| Required. |
string
| Required. |
curl -i -X GET "https://graph.threads.net/refresh_access_token ?grant_type=th_refresh_token &access_token=<LONG_LIVED_ACCESS_TOKEN>"
{ "access_token": "<LONG_LIVED_USER_ACCESS_TOKEN>", "token_type": "bearer", "expires_in": 5183944 // number of seconds until token expires }