Available Scopes
OAuth2 scopes available for AgnicPay authorization
Available Scopes
Scopes define what permissions your application requests from users during OAuth2 authorization.
Supported Scopes
payments:sign
Description: Sign X402 payment proofs on behalf of the user.
Allows:
- Signing payments within user-defined spending limits
- Using the
/api/sign-paymentendpoint - Using the
/api/x402/fetchproxy - Accessing the AI Gateway (
/v1/chat/completions)
Does not allow:
- Exceeding spending limits
- Transferring funds directly
- Modifying wallet settings
balance:read
Description: View the user's USDC balance.
Allows:
- Reading wallet balance via
/api/balance - Viewing balance across networks
Does not allow:
- Modifying balance
- Initiating transfers
Default Scopes
If no scope is specified in the authorization request, these scopes are used:
Requesting Scopes
Include scopes in your authorization URL:
Scopes are space-separated in the URL. Use + or %20 for URL encoding.
Scope Inheritance
When a user re-authorizes your app:
- If requested scopes are a subset of previously granted scopes, authorization is automatic
- If you request new scopes, the user sees the consent screen again
Checking Granted Scopes
The token response includes the granted scopes:
Always check that your required scopes were granted before using the token.
Future Scopes
Additional scopes may be added in the future:
| Scope | Status | Description |
|---|---|---|
transactions:read | Planned | View transaction history |
tokens:manage | Planned | Create/revoke API tokens |
profile:read | Planned | Read user profile |
Best Practices
- Request minimal scopes - Only ask for what you need
- Explain scope usage - Tell users why you need each permission
- Handle scope changes - Be prepared for users to deny certain scopes
- Check granted scopes - Verify the token has required permissions