Authentication
Learn how to create and use API keys to access the REST API from external clients.
Overview
API keys allow external clients (mobile apps, scripts, server-to-server integrations) to access the REST API without browser-based session authentication.
Each API key is:
- User-scoped — actions are attributed to the user who created the key
- Organization-scoped — the key only has access to data within the organization it was created in
- Time-limited — keys have a required expiration date
Creating an API Key
- Navigate to Settings in your organization dashboard
- Select the API Keys tab
- Click Create Key
- Enter a descriptive name (e.g., "Mobile App", "CI/CD Pipeline")
- Select an expiration period (30 days, 60 days, 90 days, 1 year, or custom)
- Click Create
The API key is only shown once after creation. Copy it immediately and store it securely.
Using an API Key
Include the API key in the Authorization header of every request:
Authorization: Bearer ba_<your-api-key>Token Format
API keys use the format ba_ followed by 40 hexadecimal characters:
ba_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9The ba_ prefix enables automated secret scanning tools (e.g., GitHub, GitGuardian) to detect leaked keys.
Key Lifecycle
| State | Description |
|---|---|
| Active | Key is valid and can be used for authentication |
| Expired | Key has passed its expiration date and is automatically rejected |
| Revoked | Key has been manually revoked by the user and is permanently disabled |
Revoking a Key
To revoke a key, go to Settings > API Keys and click Revoke next to the key. Revocation is immediate and irreversible.
Response Format
All successful responses follow this format:
{
"data": { ... },
"total": 42
}data: The resource or array of resourcestotal: Total count (only in list endpoints, for pagination)
Data Formats
The REST API is deliberately not localized. The app's screens render dates and numbers in the reader's language and timezone (see Timezone); the API does the opposite, and returns the same bytes to every caller:
- Timestamps are ISO 8601 in UTC, always with the
Zsuffix —"2026-09-01T14:54:01.000Z". They are never shifted into the timezone on the key owner's profile, and never abbreviated or reordered by language. Convert to a local zone in your own client, at the point of display. - Named date windows are cut in UTC. Where an endpoint accepts one —
today,this-week,this-month,older— its boundaries sit at midnight UTC, never in a timezone read off a profile, sotodayis the current UTC day for every caller. The app's own lists cut the same windows at midnight in the reader's timezone (see Timezone), which means such a filter can return a different set of records here than the same user sees on screen. Check the endpoint's own reference page for whether it takes one. - Numbers are raw JSON numbers — no grouping separators, no decimal comma, no currency symbol, no percent sign. Money is integer cents, so
480000is $4,800.00.
The same holds for what you send. Dates in a request body are ISO 8601 — a plain day such as "2026-10-15" or a full timestamp — and numbers are unformatted, so "1.234,50" and "$1,234.50" are both rejected.
This contract will not change with the interface language of the user who owns the API key, or with any language added later.
Error Responses
| Status | Reason |
|---|---|
400 Bad Request | Invalid request body or parameters |
401 Unauthorized | Missing, invalid, expired, or revoked API key |
404 Not Found | Resource does not exist or belongs to another organization |
422 Unprocessable Entity | Validation error (details in response body) |
500 Internal Server Error | Unexpected server error |
Validation errors (422) include details:
{
"error": "Validation failed",
"details": {
"fieldErrors": {
"email": ["Invalid email address"]
},
"formErrors": []
}
}Security Best Practices
- Never commit API keys to source control
- Store keys in environment variables or a secrets manager
- Use short expiration periods when possible
- Revoke keys immediately if they may have been compromised
- Create separate keys for different applications or environments
- Monitor usage via the "Last Used" column in the API Keys settings