Skip to content
This site documents the main branch, which may hold changes not yet released. Latest release: v0.3.0 (changelog).

New workspace key, the previous ones revoked (D207)

POST
/admin/workspaces/{id}/key/rotate
curl --request POST \
--url http://localhost:3000/admin/workspaces/example/key/rotate \
--header 'Authorization: Bearer <token>'
id
required

Workspace id (ws_…) or slug.

Any of:
string
/^ws_[A-Za-z0-9-]{1,64}$/

Workspace id (ws_…) or slug.

The new key, once.

Media typeapplication/json
object
workspaceKey
required
string
/^mskw_[A-Za-z0-9_-]{16,128}$/
keyPreview
required
string

Example generated

{
"workspaceKey": "example",
"keyPreview": "example"
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: unauthorized

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

WWW-Authenticate
required

Sent with every 401.

string
Allowed value: Bearer

Sent with every 401.

Error: forbidden

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: not_found

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: validation_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: internal_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.