Skip to content
Keptslot
Start free

Create a workspace

POST
/v1/account/workspaces
curl --request POST \
--url https://api.keptslot.com/v1/account/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Bella Hair, Leeds", "timezone": "Europe/London", "slot_interval_minutes": 15, "staff_name": "Chair 1", "with_secret_key": true }'

This endpoint creates a workspace on the account, with one calendar.

CAUTION: If with_secret_key is true and secret_key is ABSENT from the response, the workspace still exists. The key mint failed after the create committed. Mint a key with POST /v1/account/workspaces/{id}/keys. Do not read a missing secret_key as a failed create, and do not create the workspace again.

Media type application/json
object
name
required
string
timezone
required

An IANA zone name, such as Europe/London.

string
slot_interval_minutes

The step between the slots that availability offers.

integer
staff_name

The name of the first calendar.

string
with_secret_key

If it is true, the response carries a new secret key. That is the only time the key is shown.

boolean
Example
{
"name": "Bella Hair, Leeds",
"timezone": "Europe/London",
"slot_interval_minutes": 15,
"staff_name": "Chair 1",
"with_secret_key": true
}

The workspace is created.

Media type application/json
object
id
required
string format: uuid
name
required
string
slug
required
string
timezone
required
string
secret_key

Present only when the request asked for it, and only on this response. Store it now. Read the CAUTION above when it is absent.

string
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"slug": "example",
"timezone": "example",
"secret_key": "example"
}

The key is missing, malformed or revoked.

Media type application/json
object
error
required
object
type
required

A stable machine-readable code. Match on this.

string
message
required

A sentence for a person. Do not match on this.

string
param

The field that caused the refusal, if one field did.

string
dimension

The plan limit that refused the request. It is present only on a 402, and only for a secret key or an account key. See the errors guide.

string
used

The current count for that dimension. It is present only on a 402, and only for an account key. It is absent when the refusal has no count to report. Absent and zero are different answers.

integer format: int64
limit

The cap for that dimension. It is present only on a 402, and only for an account key. A cap of zero is a real value.

integer format: int64
Example generated
{
"error": {
"type": "example",
"message": "example",
"param": "example",
"dimension": "example",
"used": 1,
"limit": 1
}
}

A plan limit refused the request. The fields in the body change with the key type. See the errors guide.

Media type application/json
object
error
required
object
type
required

A stable machine-readable code. Match on this.

string
message
required

A sentence for a person. Do not match on this.

string
param

The field that caused the refusal, if one field did.

string
dimension

The plan limit that refused the request. It is present only on a 402, and only for a secret key or an account key. See the errors guide.

string
used

The current count for that dimension. It is present only on a 402, and only for an account key. It is absent when the refusal has no count to report. Absent and zero are different answers.

integer format: int64
limit

The cap for that dimension. It is present only on a 402, and only for an account key. A cap of zero is a real value.

integer format: int64
Example generated
{
"error": {
"type": "example",
"message": "example",
"param": "example",
"dimension": "example",
"used": 1,
"limit": 1
}
}

The request body or the query is not valid.

Media type application/json
object
error
required
object
type
required

A stable machine-readable code. Match on this.

string
message
required

A sentence for a person. Do not match on this.

string
param

The field that caused the refusal, if one field did.

string
dimension

The plan limit that refused the request. It is present only on a 402, and only for a secret key or an account key. See the errors guide.

string
used

The current count for that dimension. It is present only on a 402, and only for an account key. It is absent when the refusal has no count to report. Absent and zero are different answers.

integer format: int64
limit

The cap for that dimension. It is present only on a 402, and only for an account key. A cap of zero is a real value.

integer format: int64
Example generated
{
"error": {
"type": "example",
"message": "example",
"param": "example",
"dimension": "example",
"used": 1,
"limit": 1
}
}