Authorization header.
How it works
- Generate an access token from your Privy dashboard.
- Include the token in the
Authorizationheader of every request.
Getting a token
Navigate to Settings > Apps in your Privy dashboard to generate an access token. When creating a token, you’ll choose which scopes to grant.Scopes
Scopes control what your token can access. Choose the minimum scopes needed for your use case.| Scope | Allows |
|---|---|
contacts_read | List and filter contacts |
contacts_write | Create, update, unsubscribe, and delete contacts |
A token with only
contacts_read cannot create or modify contacts. If you attempt a write operation with a read-only token, you’ll receive a 403 insufficient_scope error.Security tips
- Keep tokens secret. Never share tokens in client-side code, public repositories, or URLs.
- Use minimum scopes. Only grant the permissions your integration needs.
- Rotate tokens regularly. Revoke and regenerate tokens periodically, especially if a team member leaves.
- Use one token per integration. This makes it easy to revoke access for a single integration without affecting others.
Invalid tokens
If your token is missing, expired, or malformed, the API returns a401 unauthorized error: