Mesa uses API keys for authentication. Each key is scoped to an organization, prefixed withDocumentation Index
Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
Use this file to discover all available pages before exploring further.
mesa_, and granted specific permission scopes to control what it can access.
Your First API Key
Your first API key is created in the Mesa dashboard. If you haven’t done this yet, follow the Quickstart to create this initial key withadmin scope. See Permission Scopes for details on what each scope allows.
Creating API Keys
You can create API keys through the SDK or API. This is useful if you want to generate scoped keys to put in a sandbox or within CI:Tags
Tags are optional key-value labels you can attach to API keys to organize them by purpose, environment, team, or any other dimension. Tag keys are lowercased and limited to 64 characters, values are limited to 256 characters. Tags are returned on every key when listing. Post-create tag updates are available through the REST API and dashboard.Listing Keys
The full API key value is never returned when listing keys. Only the key ID, name, and metadata are returned.
Revoking Keys
Using API Keys
SDK Authentication
HTTP API Authentication
Include the API key in theAuthorization header:
Git Authentication
Use the API key as the password when cloning or pushing:Permission Scopes
Scopes are hierarchical. Each level includes all permissions from the levels below it.| Scope | Description |
|---|---|
read | Clone, fetch, and view repositories, branches, commits, and content |
write | Everything read can do, plus push, create/update/delete repos, branches, and bookmarks |
admin | Everything write can do, plus API key management and webhook management |
Scope Requirements by Operation
| Operation | Required Scope |
|---|---|
| List/get repos, branches, commits, content, diffs, changes | read |
| Clone (git fetch) | read |
| Create/update/delete repos | write |
| Push (git push) | write |
| Create/move/delete bookmarks and changes | write |
| Manage webhooks | admin |
| Manage API keys | admin |
Default Scopes
When creating a key without specifying scopes, the default is:read and write.
This covers common development workflows without granting admin capabilities.
Repository Scoping
By default, API keys have access to all repositories in the organization. You can restrict a key to specific repositories by passingrepo_ids when creating it:
FORBIDDEN error. This applies to all operations including API calls, git push/pull, and webhook management.
Repository scoping is independent of permission scopes. Both must be satisfied. For example, a key with read scope and repo_ids: ["repo-id-1"] can only read repo-id-1.
Key Expiration
API keys can optionally be set to expire by passingexpires_in_seconds when creating a key. The value must be between 100 seconds and 1 year (31,536,000 seconds). Omit the field to create a key that never expires. Expired keys are automatically invalidated and will return UNAUTHORIZED on use.
You can also set expiration from the dashboard when creating a key.
Error Handling
Authentication Errors
Permission Errors
Organization Access
API keys are scoped to a single organization. Attempting to access a different organization returns a forbidden error:Best Practices
Use Scoped Keys
Create separate API keys for different purposes with minimal required scopes:- Set expirations on keys used in CI or sandboxes. Long-lived keys should be limited to
readorwritescope. - Rotate keys regularly. If a key is compromised, revoke it immediately from the dashboard or SDK.
- Keys are always bound to a single organization. Even an
adminkey with no repo restrictions cannot access another organization’s resources.

