Skip to content

Managing Locations

Managing Locations

A location is a physical clinic or site within your tenant. Every appointment, room, and schedule template references a location, so creating at least one location is a prerequisite for booking. This page covers the full locations CRUD.

All endpoints require the x-api-key header and use application/json request and response bodies. Locations are tenant-scoped: you only ever see and modify locations that belong to your own API key.

Endpoints

MethodPathStatusDescription
POST/v1/scheduling/locations201Create a location
GET/v1/scheduling/locations200List locations (cursor-paginated)
GET/v1/scheduling/locations/{id}200Get a location by ID
PUT/v1/scheduling/locations/{id}200Update a location (partial)
DELETE/v1/scheduling/locations/{id}204Deactivate a location (soft-delete)

The location object

FieldTypeDescription
idUUIDLocation identifier
namestringDisplay name
addressstring or nullStreet address
citystring or nullCity
statestring or nullBrazilian state (UF, 2 letters — e.g. SP, RJ)
zip_codestring or nullPostal code (free format, e.g. 01310-100)
phonestring or nullContact phone
timezonestringIANA timezone name (default America/Sao_Paulo)
is_activebooleanfalse after a soft-delete
operating_hoursobjectWeekly opening hours (see below)
metadataobjectFree-form key/value metadata
created_atdatetimeCreation timestamp (UTC)
updated_atdatetimeLast update timestamp (UTC)

operating_hours

operating_hours is a free-form object. The canonical shape is a map of weekday to { "start": "HH:MM", "end": "HH:MM" }, with null for closed days:

{
"monday": { "start": "08:00", "end": "18:00" },
"tuesday": { "start": "08:00", "end": "18:00" },
"wednesday": { "start": "08:00", "end": "18:00" },
"thursday": { "start": "08:00", "end": "18:00" },
"friday": { "start": "08:00", "end": "18:00" },
"saturday": null,
"sunday": null
}

Create a location

POST /v1/scheduling/locations

Request body

FieldTypeRequiredDefaultDescription
namestringYes1–255 characters
addressstringNonullStreet address
citystringNonullCity (max 100 chars)
statestringNonullBrazilian UF (max 2 chars)
zip_codestringNonullPostal code (max 10 chars)
phonestringNonullPhone (max 20 chars)
timezonestringNoAmerica/Sao_PauloIANA timezone name (max 50 chars)
operating_hoursobjectNoclinic defaultWeekly opening hours
metadataobjectNo{}Free-form metadata

Only name is required; every other field has a sensible default.

Status codes

CodeMeaning
201Location created
422Validation error (e.g. empty name, state longer than 2 characters)
Terminal window
curl -X POST "https://your-instance.delphos.app/v1/scheduling/locations" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Clínica Centro",
"address": "Av. Paulista, 1000",
"city": "São Paulo",
"state": "SP",
"zip_code": "01310-100",
"phone": "+5511999999999",
"timezone": "America/Sao_Paulo"
}'

The id returned here is the value you pass as location_id when creating appointments, schedule templates, and rooms.


List locations

GET /v1/scheduling/locations

Returns active locations by default, newest first, using cursor pagination.

Query parameters

ParameterTypeDefaultDescription
limitinteger20Page size (1–100)
cursorstringOpaque cursor from a previous response’s next_cursor
include_inactivebooleanfalseInclude soft-deleted locations
citystringFilter by city (max 100 chars)

Response

FieldTypeDescription
itemsarrayPage of location objects
next_cursorstring or nullPass as cursor to fetch the next page; null on the last page
has_morebooleantrue when more pages remain
Terminal window
curl "https://your-instance.delphos.app/v1/scheduling/locations?limit=20" \
-H "x-api-key: YOUR_API_KEY"

Get a location

GET /v1/scheduling/locations/{id}

Returns a single location by ID, regardless of whether it is active or soft-deleted (so you can reactivate it). Returns 404 if the ID does not exist within your tenant.

Terminal window
curl "https://your-instance.delphos.app/v1/scheduling/locations/550e8400-e29b-41d4-a716-446655440004" \
-H "x-api-key: YOUR_API_KEY"

Update a location

PUT /v1/scheduling/locations/{id}

Updates are partial — send only the fields you want to change. Omitted fields keep their current values. Every field from the create body is accepted, plus is_active (used to reactivate a soft-deleted location).

Status codes

CodeMeaning
200Location updated
404No location with that ID in your tenant
422Validation error
Terminal window
curl -X PUT "https://your-instance.delphos.app/v1/scheduling/locations/550e8400-e29b-41d4-a716-446655440004" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "phone": "+5511988887777" }'

Reactivating a location

A soft-deleted location is reactivated by setting is_active back to true:

Terminal window
curl -X PUT "https://your-instance.delphos.app/v1/scheduling/locations/{id}" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "is_active": true }'

Deactivate a location

DELETE /v1/scheduling/locations/{id}

Deactivation is a soft-delete: the location’s is_active is set to false and it is excluded from the default list, but the record is preserved. This is idempotent — deleting an already-inactive location still returns 204.

Status codes

CodeMeaning
204Location deactivated (no response body)
404No location with that ID in your tenant
Terminal window
curl -X DELETE "https://your-instance.delphos.app/v1/scheduling/locations/550e8400-e29b-41d4-a716-446655440004" \
-H "x-api-key: YOUR_API_KEY"

Errors

CodeMeaning
401Missing or invalid x-api-key
404The location does not exist within your tenant
422Request validation failed (the body lists the offending fields)
500Unexpected server error

A request for a location that belongs to a different tenant returns 404, not 403 — locations outside your tenant are simply invisible to your API key.