Create an API key (the secret is returned exactly once)
POST
/v1/api-keys
const url = 'https://api.vocapable.com/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mode":"live","scopes":["example"],"name":"example","expires_at":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vocapable.com/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mode": "live", "scopes": [ "example" ], "name": "example", "expires_at": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
ApiKeyCreateResponse
Returned once at creation - secret is unrecoverable afterwards.
object
id
required
Id
string
display_prefix
required
Display Prefix
string
mode
required
Mode
string
scopes
required
Scopes
Array<string>
created_at
required
Created At
string format: date-time
secret
required
Secret
string
Example
{ "mode": "live"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}