Authentication
Authenticate with the Snippe API using API keys
All API requests require authentication using an API key in the Authorization header.
Authorization: Bearer snp_your_api_key_hereGetting Your API Key
Log in to Dashboard
Go to your Snippe Dashboard and sign in to your account.
Navigate to API Keys
Go to Settings → API Keys in the sidebar.
Create New Key
Click Create API Key and select the scopes you need.
Copy and Store
Copy your API key immediately and store it securely.
Your API key is only shown once. Store it securely immediately. If you lose it, you'll need to create a new one.
Example Request
curl -X GET https://api.snippe.sh/v1/payments \
-H "Authorization: Bearer snp_your_api_key_here"API Key Scopes
| Scope | Description |
|---|---|
collection:read | View payments and balance |
collection:create | Create payment intents |
disbursement:read | View payouts |
disbursement:create | Create payouts |
Select only the scopes your application needs. This follows the principle of least privilege.
Error Responses
HTTP 401 Unauthorized
{
"status": "error",
"code": 401,
"error_code": "unauthorized",
"message": "invalid or missing API key"
}Common causes: API key is missing from the request, API key is malformed or expired, or using test key in production.
HTTP 403 Forbidden
{
"status": "error",
"code": 403,
"error_code": "insufficient_scope",
"message": "API key does not have required scope: disbursement:create"
}Fix: Create a new API key with the required scope.
Best Practices
Never expose your API key in client-side code, public repositories, or logs.
Store API keys in environment variables. Use different keys for development and production. Rotate keys periodically. Revoke compromised keys immediately.