Skip to content
Keptslot
Start free

Set the category of a service

PUT
/v1/services/{id}/category
curl --request PUT \
--url https://api.keptslot.com/v1/services/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/category \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "category_id": "3f0c1d52-8a4e-4c1b-9d7a-2b6e5f1a9c30" }'

This endpoint puts a service in a category. Send null to take it out of its category. category_id is required: a body without it is rejected with 422.

A 404 means the service or the category is not in this workspace. The response does not say which.

id
required
string format: uuid

The service id.

Media type application/json
object
category_id
required
string | null format: uuid
Example
{
"category_id": "3f0c1d52-8a4e-4c1b-9d7a-2b6e5f1a9c30"
}

The service, with its new category.

Media type application/json

The full service, with the rules that drive availability. The Service schema is the smaller customer-facing view of the same row.

object
id
required
string format: uuid
name
required
string
duration_minutes
required
integer
buffer_before_minutes
required

Free time held before the appointment.

integer
buffer_after_minutes
required

Free time held after the appointment.

integer
min_lead_minutes
required

How far ahead a customer must book.

integer
max_advance_days
required

How far ahead a customer can book. If you send 0 on a write, the API stores 60.

integer
min_cancel_notice_minutes
required

How long before the start time cancellation closes. It binds customers only. A secret key cancels at any time. A value of 0 keeps cancellation open until the start time.

integer
active
required
boolean
price_cents
integer | null
description
string | null
payment_mode
string
deposit_amount_cents
integer | null
deposit_percent
integer | null
category_id

The category this service is in. Null means it is in none. Change it with PUT /v1/services/{id}/category.

string | null format: uuid
standalone
required

See ServiceWrite.

boolean
extra_scope
required

See ServiceWrite.

string
Allowed values: none all selected
offered_with_ids
required

The services this extra can be added to when extra_scope is selected. Always present, and [] when there are none. It is returned under all and none too, so a client switching back to selected can send the same list again. A service that has since been deactivated, or can no longer be booked on its own, is left out.

Array<string>
Example
{
"extra_scope": "none"
}

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

This is a server route and you sent a publishable key. Send a secret key from your server. The type field is secret_key_required.

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

A fault on our side. Do not retry the same request in a loop. The type field is internal_error.

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

Two writes contended and one was rolled back. The request did nothing. Retry it. The type field is transient_failure.

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