Getting a Threads API access token involves a few steps: creating a Meta app, adding your Threads account as a tester, generating a token, and exchanging it for one that lasts 60 days. The entire process is free.

Unlike some APIs, Threads doesn't give you a single API key to copy. Instead, you generate an access token through your Meta developer app.

What You Need Before You Start

  • A Threads account
  • A Meta developer account at developers.facebook.com
  • A terminal with curl, or another tool that can send HTTP requests

Step 1: Create a Meta App With the Threads Use Case

  1. Go to developers.facebook.com, open My Apps, and click Create App.
  2. On the App details step, enter an app name and contact email, then click Next.
  3. On the Use cases step, tick the box on the right of Access the Threads API (it's listed under Featured) and click Next.
  4. On the Business step, Meta asks which business portfolio you want to connect. Select I don't want to connect a business portfolio yet and click Next. You can connect one later.
  5. On the Requirements step, Meta shows "No requirements identified." Click Next.
  6. On the Overview step, check your app name, email and use case, then click Create app.

You can view the use case's permissions at any time by clicking Use cases in the left-hand menu and opening the Threads use case.

The threads_basic permission is already included and can't be removed. Every Threads API endpoint requires it, so your token won't work without it.

If your project needs additional permissions, such as reading replies or accessing insights, click Add next to each one.

Step 2: Find Your Threads App ID and Secret

Open App settings > Basic in your app dashboard.

You'll find two sets of IDs and secrets on this page: one for your Meta app and another for Threads. Use the Threads App ID and Threads App secret, not the Meta ones.

Step 3: Add Yourself as a Threads Tester

While your app is in development mode, only people with a tester role can authorize it. This includes your own Threads account.

  1. In your app dashboard, go to App roles > Roles and click Add People.
  2. Select Threads Tester and enter your Threads account.
  3. Open Threads using the app or website. Go to Settings > Account > Website permissions and accept the invitation.

Don't skip the last part. Until you accept the invitation, Threads won't recognize your account as an authorized tester, and the token generation process will fail.

Step 4: Generate a Short-Lived Token

The easiest way to generate your first token is through the Graph API Explorer.

  1. Open Tools > Graph API Explorer on developers.facebook.com.
  2. In the right-hand panel, open the Meta App dropdown and select your app.
  3. At the top, next to GET, open the dropdown after graph. and switch it from Facebook to threads.net.
  4. Click Generate Threads Access Token in the right-hand panel.
  5. A pop-up asks you to authorize your app. Choose your Threads account and approve it.

Your token appears in the Access Token field. Copy it. It's short-lived and expires after one hour, which is enough time to exchange it for a longer-lasting token, but not suitable for regular API use.

You can also generate a token from your app dashboard.

Open Use cases > Customize, go to Settings, and look near the bottom of the page for the User Token Generator. Click Generate Access Token there.

To check how long any token has left, paste it into Meta's Access Token Debugger.


Blank page after approving? Meta's token generator can end on a blank page instead of showing your token. If no token appears in the Access Token field, "get your token another way".

Step 5: Exchange It for a Long-Lived Token

Run:

curl -G "https://graph.threads.com/access_token" \
  -d "grant_type=th_exchange_token" \
  -d "client_secret=YOUR_THREADS_APP_SECRET" \
  -d "access_token=YOUR_SHORT_LIVED_TOKEN"

A successful request returns a response similar to this:

{
  "access_token": "THQ...",
  "token_type": "bearer",
  "expires_in": 5183944
}

The access_token is your long-lived token, valid for 60 days. expires_in is the number of seconds left before it expires.

Your app secret is part of this request, so run it from your own computer or server, never from a browser page.

Store the secret in an environment variable, not in your code or a public repository.

Step 6: Check That the Token Works

Run:

curl "https://graph.threads.com/v1.0/me?fields=id,username&access_token=YOUR_LONG_LIVED_TOKEN"

If everything is working, the API returns your Threads username and a numeric id. Keep that ID somewhere safe. Many Threads API endpoints require it in the request URL.

Step 7: Refresh the Token Before It Expires

You can refresh a long-lived token to get another 60 days, as long as it's at least 24 hours old and hasn't expired yet:

curl -G "https://graph.threads.com/refresh_access_token" \
  -d "grant_type=th_refresh_token" \
  -d "access_token=YOUR_LONG_LIVED_TOKEN"

The response includes a new access token and its new expiry. Save it and update it wherever your application uses it.

If the token expires first, you'll need to repeat Steps 4 and 5. The easiest way to avoid that is to schedule a refresh once a month.

If Something Goes Wrong

No "Generate Threads Access Token" button

The Graph API Explorer defaults to Facebook, so the Threads option won't appear until you switch the API to threads.net.

Blank page after approving the pop-up

This happens with both the Graph API Explorer and the dashboard's User Token Generator. Get your token another way.

Authorization error when generating a token

Check that you've accepted the Threads tester invitation in Step 3.

Exchange request rejected

Your short-lived token has probably expired. Generate a new one and exchange it right away.

What to Do With Your Token

With a long-lived token and your user ID, you're ready to publish from code. Follow the next guide to "auto-post to Threads".