The Privy API supports two authentication methods. Both methods produce a bearer token that you send in theDocumentation Index
Fetch the complete documentation index at: https://help.privy.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header:
- API tokens — Generate a long-lived token from the dashboard and use it directly. Best for scripts and quick integrations.
- OAuth applications — Exchange client credentials for a short-lived access token. Best for third-party integrations with automated rotation.
OAuth: How it works
- Create an OAuth application in your Privy dashboard to get a client ID and client secret.
- Exchange those credentials for an access token using the OAuth 2.0 client credentials flow.
- Include the access token in the
Authorizationheader of every request.
Creating an OAuth application
Navigate to Settings > Apps in your Privy dashboard and create a new application. You’ll choose a name and select which scopes the application should have access to. By default, no scopes are assigned. When the application is created, the dashboard displays the client secret once. Copy it immediately — you won’t be able to view it again. If you lose it, you can regenerate a new secret from the application’s settings.Scopes
Scopes control what your token can access. Your OAuth application must have a scope enabled before you can request it — configure scopes in Settings > Apps in your dashboard.| Scope | Description | Default |
|---|---|---|
contacts_read | List and filter contacts | Yes |
contacts_write | Create, update, unsubscribe, and delete contacts | No |
Getting an access token
Exchange your client ID and client secret for an access token by making aPOST request to the token endpoint.
Read-only access
To read contacts, request thecontacts_read scope explicitly:
Read and write access
To create, update, or delete contacts, request thecontacts_write scope explicitly:
The
scope response field confirms which scopes were actually granted. Always check this to verify your token has the access you need.| Field | Description |
|---|---|
access_token | The bearer token to include in API requests. |
token_type | Always Bearer. |
expires_in | Token lifetime in seconds. Access tokens expire after 2 hours (7200 seconds). |
scope | The scopes granted to this token. |
Refreshing tokens
When your access token expires, request a new one by repeating the client credentials exchange above. There is no refresh token in the client credentials flow — simply request a new access token.Security tips
- Keep credentials secret. Never share your client secret or access tokens in client-side code, public repositories, or URLs.
- Rotate secrets regularly. Regenerate your client secret periodically from the dashboard, especially if a team member leaves.
- Use one application per integration. This makes it easy to revoke access for a single integration without affecting others.
Invalid tokens
If your bearer token is missing, expired, revoked, or malformed, API endpoints return a401 unauthorized error: