API keys

Create an API key

POST/v1/workspaces/{workspaceId}/api-keys

Creates a personal API key for the caller, or a service-account key when owner.kind is service_account. A viewer key can create a personal key. An admin key is required for a service-account key. The secret and bearer token appear once.

Authentication

Send your Spark API key with every request. The value is the full bearer token Spark returned when you created the key. See Authentication.

Authorization: Bearer <SPARK_API_KEY>

Path parameters

workspaceId

string

The workspace id.

Request body

name

string

Display name.

role

string (optional)

Role for the new key. A key cannot exceed the owner's role. One of: viewer, editor, admin.

expiresAt

string (optional)

Optional expiry in UTC. The time must be in the future.

owner

object (optional)

Service-account owner. Omit this object for a personal key.

Was this page helpful?