Skip to main content

Create API key

POST /api/api-keys

Generate a new API key for the authenticated user

Authentication​

  • Option 1: x-api-key: YOUR_API_KEY (header). API key for authentication. Create one in your dashboard.
  • Option 2: Authorization: Bearer YOUR_ACCESS_TOKEN. Dashboard JWT in Authorization: Bearer <token>, only on operations that explicitly list this scheme. Prefer x-api-key for REST integrations. OAuth for hosted MCP is a separate connection at https://mcp.zvid.io/mcp.

Create API keys at app.zvid.io/api-keys. Keep credentials on your server.

Parameters​

This operation has no path, query, or additional header parameters.

Request​

The shell examples read credentials from ZVID_API_KEY (or ZVID_ACCESS_TOKEN for Bearer authentication). Set that variable in your environment. Replace sample project, template, job, and asset identifiers with values from your own account.

A request body is required.

application/json​

Required properties: name.

FieldTypeRequiredDescription and constraints
body.namestringYesName for the API key Minimum length: 1. Maximum length: 100.

Request example: Example​

curl --request POST 'https://api.zvid.io/api/api-keys' \
--header "x-api-key: $ZVID_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Production automation"
}'

Responses​

HTTP 201​

API key created successfully

Content type: application/json.

Unknown properties are rejected. Required properties: id, apiKey, name, keyPrefix, created.

FieldTypeRequiredDescription and constraints
response.idintegerYes
response.apiKeystringYesFull API key (only shown once)
response.namestringYes
response.keyPrefixstringYesStored prefix derived from the key
response.createdbooleanYes

Example response

{
"id": 789,
"apiKey": "zvid_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"name": "Production API Key",
"keyPrefix": "zvid_d3f4a1b2c3d",
"created": true
}

HTTP 400​

Validation error or business error (e.g. duplicate name)

Content type: application/json.

Exactly one of the listed alternatives must match.

oneOf alternative 1

Schema: ValidationError.

oneOf alternative 2

Schema: Error.

HTTP 401​

Unauthorized

Content type: application/json.

Unknown properties are rejected. Required properties: error.

FieldTypeRequiredDescription and constraints
response.errorstringYesError type
response.messagestringNoHuman-readable error message

Schema definitions​

The following definitions describe the fields referenced above. Expand a definition to inspect its complete contract.

ApiKeyCreated

Unknown properties are rejected. Required properties: id, apiKey, name, keyPrefix, created.

FieldTypeRequiredDescription and constraints
ApiKeyCreated.idintegerYes
ApiKeyCreated.apiKeystringYesFull API key (only shown once)
ApiKeyCreated.namestringYes
ApiKeyCreated.keyPrefixstringYesStored prefix derived from the key
ApiKeyCreated.createdbooleanYes
ValidationError

Required properties: error.

FieldTypeRequiredDescription and constraints
ValidationError.errorstringYes
ValidationError.messagestringNo
ValidationError.detailsarray of objectNo
ValidationError.planLimitsobjectNoPresent on render validation errors; contains the authenticated user's current render limits.

Nested field: ValidationError.details

Array item: ValidationError.details[]

Unknown properties are rejected. Required properties: field, message.

FieldTypeRequiredDescription and constraints
ValidationError.details[].fieldstringYes
ValidationError.details[].messagestringYes
Error

Required properties: error.

FieldTypeRequiredDescription and constraints
Error.errorstringYesError type
Error.messagestringNoHuman-readable error message
AuthenticationError

Unknown properties are rejected. Required properties: error.

FieldTypeRequiredDescription and constraints
AuthenticationError.errorstringYesError type
AuthenticationError.messagestringNoHuman-readable error message