Create an API key (v1 / programmatic)
POST /api/v1/api-keys
Creates an API key for the authenticated account. Requires api-keys.create; name is required and budget, expiry, and privacy-mode override are optional validated fields. The plaintext is returned once and is not stored as plaintext.
Authenticate with a portal session token.
Request body
application/json object
budgetintegerRange: at least 0expires_atstring (date-time)namestring requiredLength: at most 100 charactersprivacy_tier_overridePrivacyMode
Example
{
"budget": 10000,
"name": "CI key"
}Responses
201 API key created; plaintext is returned once.
application/json object
created_atstring (date-time) requiredis_activeboolean requiredkey_idinteger requiredkey_prefixstring requiredlast_fourstring requiredmessagestring requirednamestring requiredplaintextstring requiredWrite only
Generated sample
{
"created_at": "2026-01-01T00:00:00Z",
"is_active": true,
"key_id": 0,
"key_prefix": "string",
"last_four": "string",
"message": "string",
"name": "string",
"plaintext": "string"
}401 Missing or invalid bearer token.
application/json object
Any keys are accepted.
403 Authenticated caller lacks the required permission, ability, or role.
application/json object
Any keys are accepted.
409 The account is paused because scheduled deletion is pending.
application/json object
errorobject requiredcodestring requiredValue:"account_deletion_scheduled"messagestring required
422 Validation or healthtech privacy-floor check failed.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 The request was rate limited. API-generated responses are JSON;
Response headers
Retry-Afterstring headerSeconds to wait before retrying, when provided.
X-RateLimit-Scopestring headerIdentifies the scope of the request limit, when provided.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string