Avycenna

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).

POST
/api/v1/api-keys

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Header Parameters

x-api-key?string|null

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"    }  ]}