Token Exchange enables your backend to obtain Boosted access tokens for your users without browser redirects or user interaction. This method is designed for backend-to-backend integrations where you embed Boosted features directly in your application.
Authentication Flow:
sub set to your client ID to obtain a service account tokenNo user redirects, login screens, or consent flow.
Standards:
jwks_uri)Provide the public URL where your JWKS (JSON Web Key Set) is hosted. We will fetch your public keys from this endpoint to verify signatures.
How to generate and host:
Example URL:
https://your-domain.com/.well-known/jwks.json
Expected Response (at the URL above):
Used for:
iss claim (issuer)sub claim (for token exchange to use the account-management API)Used for:
Send your token exchange requests here.
Create the organizational hierarchy via these endpoints before performing token exchange for users.
Include this in the aud claim of your JWT.
Your JWT must include these standard claims:
You can request specific scopes in your token exchange request. Your partner account will be configured with allowed scopes.
The Threads API requires an access token for a user with the thread scope. Before you can generate these tokens, you must set up your accounts using the Account Management API.
Account Hierarchy
The Account Management API uses a three-tier hierarchy:
Choosing Your Structure
For most use cases, we recommend starting with a simple structure:
This approach works well when you don’t need to segment users into different groups. If you have more complex requirements (e.g., separating internal production use from end user production use, or isolating different end user groups), contact us for guidance on structuring your hierarchy.
Perform token exchange with your client ID as the subject to obtain a management token:
The bash snippets use process substitution <(...) which requires bash. Add #!/bin/bash at the top of your script or run with bash script.sh.
When a user needs Boosted access, create a JWT with their User ID as the subject and exchange it for an access token:
Example Response:
Use the access token to call Boosted APIs:
Access tokens expire after 1 hour. When expired, perform another token exchange:
Token Exchange does not return refresh tokens. When the access token expires, create a new JWT and perform another token exchange.