| API Tokens | OAuth Applications | |
|---|---|---|
| Setup | Generate a token in the dashboard | Create an app, then exchange credentials for a token |
| Token lifetime | 30 days to 1 year (or no expiry) | 2 hours |
| Best for | Scripts, internal tools, quick integrations | Third-party integrations, automated token rotation |
Creating a token
Open API token settings
Navigate to Settings > API Tokens in your Privy dashboard.
Create a new token
Click Create Token. Choose a descriptive name, select the scopes you need, and pick an expiration period.
Token format
API tokens use the prefixprivy_ followed by a 40-character hex string:
Scopes
Scopes control what your token can access. You select scopes when creating the token.| Scope | Description |
|---|---|
contacts_read | List and filter contacts |
contacts_write | Create, update, unsubscribe, and delete contacts |
Using a token
Include the token in theAuthorization header as a bearer token — exactly the same as an OAuth access token:
Expiration
When creating a token, choose from the following lifetimes:| Option | Duration |
|---|---|
| 30 days | Token expires 30 days after creation |
| 60 days | Token expires 60 days after creation |
| 90 days | Token expires 90 days after creation |
| 1 year | Token expires 1 year after creation |
| No expiration | Token never expires (use with caution) |
Revoking a token
You can revoke a token at any time from Settings > API Tokens in the dashboard. Revoked tokens are rejected immediately — any request using a revoked token receives a401 error.
Limits
Each Privy account can have up to 25 active API tokens at a time. Revoked and expired tokens do not count toward this limit. Rate limits apply to API tokens the same way they apply to OAuth access tokens — all requests under the same account share the same rate limit budget.Error responses
| Status | Code | Cause |
|---|---|---|
401 | unauthorized | Token is missing, invalid, expired, or revoked |
403 | insufficient_scope | Token does not have the required scope for this endpoint |