Skip to main content

API keys

The organization's API keys. revoke revokes a key for good (only a revoked key can be removed with delete), and rotate issues a successor and keeps the previous one working for a few days — the new secret shows up once, in the response.

CommandHTTPDescription
api-keys listGET /v1/api_keysList API keys
api-keys createPOST /v1/api_keysCreate API key
api-keys getGET /v1/api_keys/{id}Get API key
api-keys updatePATCH /v1/api_keys/{id}Update API key
api-keys deleteDELETE /v1/api_keys/{id}Remove revoked API key
api-keys revokePOST /v1/api_keys/{id}/revokeRevoke API key
api-keys rotatePOST /v1/api_keys/{id}/rotateRotate API key

Examples​

--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# List API keys
kobana dashboards api-keys list \
--params '{"status": "active"}' \
--fields "id,name,prefix,status,expires_at"

# Create API key
kobana dashboards api-keys create \
--json '{"name": "Integração ERP", "expires_at": "2027-10-01T00:00:00Z"}'

# Rotate API key
kobana dashboards api-keys rotate \
--params '{"id": "API_KEY_ID"}' \
--json '{"grace_days": 7}'

# Revoke API key
kobana dashboards api-keys revoke --params '{"id": "API_KEY_ID"}' --dry-run

Next steps​