Authentication
The Monk API uses API keys to authenticate requests. You can create and manage API keys from your Settings page.Environments
Monk runs production and sandbox as completely separate instances with separate accounts and API keys.| Monk API | Monk Events API | Dashboard | |
|---|---|---|---|
| Production | api.monk.com | events-api.monk.com | app.monk.com |
| Sandbox | api-sandbox.monk.com | events-api-sandbox.monk.com | sandbox.monk.com |
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 |
contracts:write | Create and cancel contracts |
plans:read | Read plan information |
plans:write | Create plans |
meters:read | Read meter information |
meters:write | Create meters |
pricing:read | Read pricing configurations |
pricing:write | Create pricing configurations |
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
Rate Limiting
The Monk API enforces rate limits to ensure fair usage and protect the service from abuse. Rate limits are applied per IP address.| Endpoint | Limit | Window | Description |
|---|---|---|---|
/v1/events | Unlimited | — | High-throughput event ingestion (1M+ events/sec) |
| All other endpoints | 100 requests | 1 minute | Standard rate limit |
The Events API is built on dedicated high-throughput infrastructure and is
exempt from rate limiting. You can safely send millions of events per second
without throttling.
Rate Limit Response
When you exceed the rate limit, you’ll receive a429 Too Many Requests response:
Best Practices for Rate Limits
Implement exponential backoff
Implement exponential backoff
When you receive a 429 response, wait before retrying. Double the wait time
with each subsequent retry (e.g., 1s, 2s, 4s, 8s).
Batch requests when possible
Batch requests when possible
Use batch endpoints like Batch Events
to send multiple items in a single request instead of making many individual
calls.
Cache responses
Cache responses
Cache read responses (customers, plans, meters) to reduce redundant API
calls. These resources change infrequently.
Batch pricing estimates
Batch pricing estimates
The Pricing Estimate endpoint accepts up
to 500 events per request. Batch events together rather than making separate
calls per event. For example, if you run a workflow with 100 events, send
them all in one request instead of 100 individual requests.
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.