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 an API key. The secret key value is returned only once; store it immediately.
const key = await mesa.apiKeys.create({
  name: 'agent-runner',
  scopes: ['read', 'write'],
  repo_ids: ['repo_123'],
  expires_in_seconds: 3600,
});

console.log(key.key);

Options

org
string | undefined
Organization override.
name
string | undefined
Human-readable key name.
scopes
Array<'read' | 'write' | 'admin'> | undefined
Scopes granted to the key.
repo_ids
string[] | undefined
Restrict the key to specific repository IDs. Omit for organization-wide access.
expires_in_seconds
number | undefined
Expiration between 100 seconds and 31536000 seconds.
tags
Record<string, string> | undefined
String key-value metadata.

Response

id
string
API key ID. Use this for revocation.
key
string
Secret API key value. Returned only once.
name
string | null
Human-readable key name.
scopes
string[]
Granted scopes.
repo_ids
string[] | null
Repository scope, or null for organization-wide access.
tags
Record<string, string>
String key-value metadata.
created_at
string
Creation timestamp.

Required scope

admin