Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt

Use this file to discover all available pages before exploring further.

Create a new API key for programmatic access.
key = await mesa.api_keys.create(
    name="ci-key",
    scopes=["read", "write"],
    repo_ids=["repo_123"],
    expires_in_seconds=3600,
)

print(key.id)
print(key.key)  # only returned once

Options

org
str | None
Organization override.
name
str | None
Human-readable key name.
scopes
list[str] | None
Permission scopes. Supported scopes are read, write, and admin. When omitted, the API defaults to ['read', 'write'].
repo_ids
list[str] | None
Restrict the key to specific repository IDs. Omit to allow all repositories in the organization.
expires_in_seconds
int | None
Server-side TTL in seconds. The API accepts values from 100 through 31536000.

Response

id
str
API key ID.
key
str
Secret key value. Store it immediately because future list responses do not include it.
name
str | None
Key name.
scopes
list[str]
Granted scopes.
repo_ids
list[str] | None
Repository IDs the key is scoped to, or None for organization-wide access.
created_at
datetime
Creation timestamp.

Required scope

admin