Visits
Cancel a visit
/api/v1/visits/{visitId}/cancelvisits:writeCancel a visit that has not started, or the rest of a repeating one. A visitor who was sent a pass is told by email.
Path parameters
| Name | Type | Description |
|---|---|---|
visitIdrequired | string (uuid) | The visit’s id. |
Request body
application/json| Name | Type | Description |
|---|---|---|
reason | string or null, at most 300 characters | Why, kept in the visit’s history. |
series | boolean, default false | For a visit that repeats: also cancel every later visit in the series that has not started. |
Responses
| Name | Type | Description |
|---|---|---|
cancelled | integer | How many visits were cancelled. |
Errors
| Status | Type | When |
|---|---|---|
| 400 | bad-request | The id in the path is not a UUID. |
| 401 | api-key-invalid | No key was sent, or it is mistyped or unknown. |
| 401 | api-key-revoked | The key has been revoked. |
| 401 | api-key-expired | The key has passed its expiry date. |
| 402 | plan-feature | The organisation’s plan does not include the API (feature: "api"). |
| 402 | account-read-only | A payment is overdue: the organisation can read but not change anything until it is paid. |
| 403 | organisation-suspended | Gbàlejò has suspended the organisation. |
| 403 | api-key-scope | The key does not have visits:write. |
| 404 | not-found | There is no such visit in the organisation. |
| 409 | visit-transition | The visit has started or ended: only INVITED and EXPECTED visits can be cancelled. |
| 409 | visit-changed | Someone changed the visit at the same moment: read it again. |
| 422 | validation | A field is missing or not valid: errors lists each one with its path. |
| 429 | rate-limited | The key has made its requests for this minute (Retry-After says when). |
Visits
Cancel a visit
/api/v1/visits/{visitId}/cancelvisits:writeCancel a visit that has not started, or the rest of a repeating one. A visitor who was sent a pass is told by email.
Example request
curl -X POST https://api.gbalejo.com/api/v1/visits/8b0e7c1a-4f2d-4b9e-a6c3-2d1f5e9a7b40/cancel \
-H "Authorization: Bearer $GBALEJO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "The review moved to next week."
}'const response = await fetch('https://api.gbalejo.com/api/v1/visits/8b0e7c1a-4f2d-4b9e-a6c3-2d1f5e9a7b40/cancel', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GBALEJO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
reason: 'The review moved to next week.',
}),
});
// Problems come back as application/problem+json: type, title, status, detail.
if (!response.ok) throw new Error((await response.json()).detail);
const result = await response.json();Example response
200 OK{
"cancelled": 1
}Path parameters
visitIdrequiredstring (uuid)
The visit’s id.
Request body
application/json
reasonstring or null, at most 300 characters
Why, kept in the visit’s history.
seriesboolean, default false
For a visit that repeats: also cancel every later visit in the series that has not started.
Responses
How many visits were cancelled.
cancelledinteger
How many visits were cancelled.
Errors
The id in the path is not a UUID.
No key was sent, or it is mistyped or unknown.
The key has been revoked.
The key has passed its expiry date.
The organisation’s plan does not include the API (feature: "api").
A payment is overdue: the organisation can read but not change anything until it is paid.
Gbàlejò has suspended the organisation.
The key does not have visits:write.
There is no such visit in the organisation.
The visit has started or ended: only INVITED and EXPECTED visits can be cancelled.
Someone changed the visit at the same moment: read it again.
A field is missing or not valid: errors lists each one with its path.
The key has made its requests for this minute (Retry-After says when).