Skip to content
Keptslot
Start free

Replace weekly hours

PUT
/v1/staff/{id}/working-hours
curl --request PUT \
--url https://api.keptslot.com/v1/staff/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/working-hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "working_hours": [ { "weekday": 1, "start_minute": 540, "end_minute": 1020 }, { "weekday": 2, "start_minute": 540, "end_minute": 1020 } ] }'

This endpoint replaces the whole weekly schedule in one transaction. Send every block you want. A block you omit is erased.

Send an empty array to clear the schedule. The calendar then offers no slots.

The response echoes what you sent.

id
required
string format: uuid

The calendar id.

Media type application/json
object
working_hours
required
Array<object>
object
weekday
required

The day of the week. 0 is Sunday.

integer
start_minute
required

Minutes after midnight, in the workspace timezone.

integer
end_minute
required

Minutes after midnight, in the workspace timezone.

integer
Example
{
"working_hours": [
{
"weekday": 1,
"start_minute": 540,
"end_minute": 1020
},
{
"weekday": 2,
"start_minute": 540,
"end_minute": 1020
}
]
}

The schedule is replaced.

Media type application/json
object
working_hours
required
Array<object>
object
weekday
required

The day of the week. 0 is Sunday.

integer
start_minute
required

Minutes after midnight, in the workspace timezone.

integer
end_minute
required

Minutes after midnight, in the workspace timezone.

integer
Example generated
{
"working_hours": [
{
"weekday": 1,
"start_minute": 1,
"end_minute": 1
}
]
}

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
}
}

There is no such resource in this workspace.

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
}
}