Authentication
The Monk API uses API keys to authenticate requests. You can create and manage API keys from your Settings page.API Key Format
API keys follow this format:mk_live_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6
Making Authenticated Requests
Include your API key in theAuthorization header as a Bearer token:
Scopes
API keys can be created with specific scopes to limit their access:| Scope | Description |
|---|---|
* | Full access to all endpoints |
customers:read | Read customer information |
customers:write | Create and update customers |
invoices:read | Read invoice information |
contracts:read | Read contract information |
usage:read | Read usage data |
usage:write | Send usage events |
Error Responses
Missing or Invalid Authorization
Invalid API Key
Revoked API Key
Expired API Key
Insufficient Permissions
Best Practices
Store keys securely
Store keys securely
Use environment variables or a secrets manager to store your API keys. Never commit them to version control.
Use minimal scopes
Use minimal scopes
Create API keys with only the scopes needed for their specific use case.
Rotate keys regularly
Rotate keys regularly
Periodically revoke old keys and create new ones, especially if you suspect a key may have been compromised.
Monitor usage
Monitor usage
Check the “Last Used” timestamp in your Settings to identify unused or suspicious keys.