Skip to content

API Keys

API keys are the authentication tokens for the Machine API. Each key is scoped to a project and associated with a team member role.

POST /machine/keys/bootstrap

No authentication required. Creates a new project along with the first API key and owner membership.

{
"projectName": "my-project",
"description": "Optional project description"
}
FieldTypeRequiredDescription
projectNamestringYesName for the new project
descriptionstringNoProject description
{
"projectId": "a1b2c3d4-...",
"apiKeyId": "e5f6g7h8-...",
"apiKey": "mk_1a2b3c4d5e6f...",
"message": "Store this API key securely — it will not be shown again."
}

The apiKey is returned once. Store it securely.

POST /machine/keys

Roles: owner admin

Generates a new API key for the current project.

{
"label": "ci-pipeline",
"role": "member"
}
FieldTypeDefaultDescription
labelstringnullHuman-readable label
rolestring"member"Role: admin, member, or viewer

You cannot create a key with the owner role.

{
"apiKeyId": "a1b2c3d4-...",
"apiKey": "mk_...",
"role": "member",
"message": "Store this API key securely — it will not be shown again."
}

DELETE /machine/keys/:id

Roles: owner admin

Revokes an API key and removes the associated team membership. You cannot revoke your own key. The target key must belong to the same project.

Returns { "success": true } on success.