Create an API key
Generates a new API key for server-to-server integrations. The raw key is returned once in this response and cannot be retrieved again — store it securely. Pass `organization_id` to create a clinic-wide key instead of a personal one — requires owner/admin role in that organization, and the key is always forced to `read_granted` scope (clinic keys are read-only by design).
Authorization
HTTPBearer In: header
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/api-keys" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'null{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ]}API keys
Manage API keys for server-to-server integrations.
List API keys GET
Excludes the secret value (only visible once, at creation). Without `organization_id`, returns the current user's personal keys. With `organization_id`, returns that clinic's keys (requires membership) — not just the ones the caller personally created.