Skip to content
Keptslot
Start free

Verify a booking code

POST
/v1/bookings/{id}/verify
curl --request POST \
--url https://api.keptslot.com/v1/bookings/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "code": "482915" }'

This endpoint promotes a pending booking to confirmed when the code is correct. Both key types can call it, because the publishable key that created the hold must be able to complete it.

Every refusal gives the same error: a wrong code, an expired hold, too many attempts, and an unknown booking are not told apart. The response is deliberately not an oracle.

Rate limited the same as POST /v1/bookings: called with a publishable key, 60 requests a minute shared by the workspace’s whole booking page and 10 a minute for one caller address within that. A secret key is not subject to either.

id
required
string format: uuid

The booking id.

Media type application/json
object
code
required

The 6-digit code from the customer.

string
Example
{
"code": "482915"
}

The booking is confirmed.

Media type application/json
object
status
required
string
Example
{
"status": "confirmed"
}

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

The request used a publishable key and sent an Origin header that is not on the allowed list of that key. Add the origin to the key, or call the endpoint with a secret key from a server. The type field is origin_not_allowed.

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

This endpoint’s request budget is spent. The type field is rate_limited.

The budget is a token bucket, not a calendar-minute counter: it refills CONTINUOUSLY as time passes, a few tokens’ worth every second, rather than resetting all at once at the top of the minute. There is no wall-clock boundary to wait for. A REFUSED request costs nothing – the check happens before a token is spent, so hammering this endpoint while refused does not delay when it starts working again. What you get back is Retry-After: seconds until the bucket has refilled enough to admit one more request, computed from exactly how empty the bucket is right now. Retrying before then just gets refused again; retrying at or after Retry-After succeeds. See the endpoint’s own description for the actual numbers – they differ by endpoint and, for the publishable-key routes, by whether the budget is shared by the whole workspace or is one caller’s own share of it.

The response also carries RateLimit-Remaining (requests left in the bucket – always 0 on this response, since a refusal only happens once it reaches zero). Both headers are ADDITIVE: type alone is enough to act correctly, and a client that cannot read response headers loses nothing. Access-Control-Expose-Headers names both, so a browser-based integration on a publishable key can read them too, the same as it reads type from the body.

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
}
}
Retry-After
integer

Seconds until this bucket admits another request.

RateLimit-Remaining
integer

Requests left in the bucket. Always 0 on this response.

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