Skip to content
Keptslot
Start free

Replace a service

PUT
/v1/services/{id}
curl --request PUT \
--url https://api.keptslot.com/v1/services/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "duration_minutes": 1, "buffer_before_minutes": 1, "buffer_after_minutes": 1, "min_lead_minutes": 1, "max_advance_days": 1, "min_cancel_notice_minutes": 1, "price_cents": 1, "description": "example", "payment_mode": "example", "deposit_amount_cents": 1, "deposit_percent": 1 }'

This endpoint replaces every field of a service. Send the whole object. A field you omit takes its zero value.

This endpoint does not change active. Use the activate and deactivate endpoints for that.

id
required
string format: uuid

The service id.

Media type application/json

The writable fields of a service. Create and replace use the same shape. active is not here: use the activate and deactivate endpoints.

object
name
required
string
duration_minutes
required
integer
buffer_before_minutes
integer
buffer_after_minutes
integer
min_lead_minutes
integer
max_advance_days

If you send 0, the API stores 60.

integer
min_cancel_notice_minutes
integer
price_cents
integer | null
description

Plain text. It renders on a public page. Render it as text. Do not render it as markup.

string | null
payment_mode

Whether booking this service takes a payment. One of none, full, deposit_fixed or deposit_percent. Omitting it is not the same as sending none, and is rejected.

The other three fields must match the mode. full needs price_cents and neither deposit field. deposit_fixed needs deposit_amount_cents and no percent. deposit_percent needs deposit_percent and price_cents. none needs neither deposit field.

Whatever the mode charges must come to more than zero. A price or deposit of 0 is rejected: it would save a service that no customer could ever book, because the payment would be refused at booking time rather than here.

string
deposit_amount_cents

The fixed deposit, in the smallest currency unit. Required by deposit_fixed and rejected by every other mode.

integer | null
deposit_percent

The deposit as a whole-number percentage of price_cents, from 1 to 100. Required by deposit_percent and rejected by every other mode. We round the resulting amount half up.

integer | null
Example generated
{
"name": "example",
"duration_minutes": 1,
"buffer_before_minutes": 1,
"buffer_after_minutes": 1,
"min_lead_minutes": 1,
"max_advance_days": 1,
"min_cancel_notice_minutes": 1,
"price_cents": 1,
"description": "example",
"payment_mode": "example",
"deposit_amount_cents": 1,
"deposit_percent": 1
}

The service is replaced.

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
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"duration_minutes": 1,
"buffer_before_minutes": 1,
"buffer_after_minutes": 1,
"min_lead_minutes": 1,
"max_advance_days": 1,
"min_cancel_notice_minutes": 1,
"active": true,
"price_cents": 1,
"description": "example",
"payment_mode": "example",
"deposit_amount_cents": 1,
"deposit_percent": 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
}
}