API keys
Create an API key
POST
/v1/workspaces/{workspaceId}/api-keysCreates 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
workspaceIdstring
The workspace id.
Request body
namestring
Display name.
rolestring (optional)
Role for the new key. A key cannot exceed the owner's role. One of: viewer, editor, admin.
expiresAtstring (optional)
Optional expiry in UTC. The time must be in the future.
ownerobject (optional)
Service-account owner. Omit this object for a personal key.