API keys API
Keys for the CLI, scripts and MCP clients without OAuth. 3 ops: list_api_keys, create_api_key, revoke_api_key.
Keys for the CLI, scripts and MCP clients without OAuth.
list_api_keys
readList API keys · POST /api/v1/list_api_keys · scope keys:read or GET …?input=
API keys of this organization (prefix only; the full key is shown once at creation), each with the role it acts with, its scopes and who created it. Owners and admins see every key; members see their own. Also returns available_scopes.
curl -X POST https://getgutlog.com/api/v1/list_api_keys \ -H "Authorization: Bearer gutlog_…"npx @meterapp/gutlog list_api_keys{
"type": "object",
"properties": {}
}create_api_key
writeCreate API key · POST /api/v1/create_api_key · scope keys:write
Create an organization API key for your backend, the CLI, an MCP host or CI. It acts with your role (an owner's key acts as admin), optionally narrowed to scopes, and keeps working if you leave the organization; admins can revoke it. The full key (gutlog_…) is returned only once; store it as a secret and never ship it to a browser or app.
curl -X POST https://getgutlog.com/api/v1/create_api_key \ -H "Authorization: Bearer gutlog_…" \ -H "Content-Type: application/json" \ -d '{"name":"scrambled eggs"}'npx @meterapp/gutlog create_api_key --json '{"name":"scrambled eggs"}'{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"scopes": {
"default": [],
"description": "Narrow the key to these scopes: `<group>:read`, `<group>:write`, `<group>:*`, `*:read`, or `billing:purchase` (groups: meals, foods, products, clean, gut, programs, insights, billing…). Empty (default): everything the key's role allows.",
"maxItems": 64,
"type": "array",
"items": {
"type": "string"
}
},
"expires_in_days": {
"description": "Expire the key after this many days. Default: never.",
"type": "integer",
"minimum": 1,
"maximum": 3650
}
},
"required": [
"name"
]
}revoke_api_key
writeRevoke API key · POST /api/v1/revoke_api_key · scope keys:write
Revoke an API key immediately; every backend, CLI, CI job or MCP host using it stops working. Owners and admins revoke any key; members their own.
curl -X POST https://getgutlog.com/api/v1/revoke_api_key \ -H "Authorization: Bearer gutlog_…" \ -H "Content-Type: application/json" \ -d '{"key":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/gutlog revoke_api_key --json '{"key":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"key": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"key"
]
}