X-Company.
Base URL https://api.genuka.com · Auth Authorization: Bearer <token> + X-Company: <companyId> · See Getting Started for shared conventions, pagination & error formats.
Endpoints at a glance
Availabilities
An Availability represents a recurring weekly window during which a staff member (user) is available for bookings. The store endpoint is a full replace — it deletes all existing availabilities for the user before inserting the new set.GET /2023-11/admin/availabilities
List all weekly availability windows for a specific user. If user_id is not provided as a query parameter the authenticated user’s own availabilities are returned.
- Query parameters:
Request example
200 OK
404 Not Found— no user resolved (neitheruser_idparam nor authenticated session)401 Unauthorized— missing or invalid Bearer token
POST /2023-11/admin/availabilities
Replace all weekly availability windows for a user. All existing availabilities for the given user_id are deleted before the new set is created.
- Request body:
Request example
201 Created
Returns the full availability list for the user after the replace.
422 Unprocessable Entity—user_idmissing orcompany_idnot resolvable from request context
404 Not Found—user_iddoes not correspond to a known user422 Unprocessable Entity— validation failure onavailabilitiesarray items (invalidday_of_week,H:iformat, orend_timenot afterstart_time)
GET /2023-11/admin/availabilities/{availability}
Retrieve a single availability window by its ULID.
- Path parameters:
Request example
200 OK
404 Not Found— availability with that ULID does not exist401 Unauthorized— missing or invalid Bearer token
PUT /2023-11/admin/availabilities/{availability}
Update a single availability window. All fields are required.
- Path parameters:
- Request body:
Request example
200 OK
404 Not Found— availability ULID not found422 Unprocessable Entity— validation failure (missing required fields, bad time format,end_timenot afterstart_time,day_of_weekout of range 0–6)
DELETE /2023-11/admin/availabilities/{availability}
Delete a single availability window.
- Path parameters:
Request example
200 OK
404 Not Found— availability ULID not found500 Internal Server Error— deletion failed (e.g. database constraint)
GET /2023-11/availabilities
Public version of the availability list. Behaves identically to the admin list endpoint but does not require admin authentication. If user_id is omitted and no authenticated session is present, the request returns 404.
- Query parameters:
Request example
200 OK
404 Not Found— no user resolved
GET /2023-11/availabilities/slots
Calculate all available booking slots for a specific staff member, service, and calendar day. The algorithm:
- Checks if the user has an
Unavailabilityrecord for the requested day — if so, returns an empty slots array with"unavailable": true. - Retrieves existing
CalendarEventrecords for the user on that day. - Iterates over the user’s
Availabilitywindows that match the day of the week. - Splits each window into slots of
service.duration_minutes, advancing byduration_minutes + buffer_minutesper step. - Excludes any slot that overlaps an existing calendar event.
- Excludes slots whose end time is in the past (for the current day).
- Query parameters:
Request example
200 OK (slots available)
200 OK (user unavailable that day)
404 Not Found—user_idorservice_idnot found, or no user resolved
GET /2023-11/availabilities/{availability}
Public version of the single availability show endpoint. Behaves identically to GET /2023-11/admin/availabilities/{availability}.
- Path parameters:
Request example
200 OK
Unavailabilities
An Unavailability marks a specific calendar date on which a staff member is not available for bookings (e.g. vacation, holiday, sick leave). Multiple dates can be created in a single request. ThegetDates endpoint returns a lightweight flat array of date strings for calendar UI rendering.
GET /2023-11/admin/unavailabilities
List unavailabilities for a user with optional date range filtering.
- Query parameters:
Request example
200 OK
404 Not Found— no user resolved401 Unauthorized— missing or invalid Bearer token
POST /2023-11/admin/unavailabilities
Create unavailability records for one or more dates. Duplicate dates for the same user are silently skipped (idempotent per date). Returns the full updated unavailability list for the user sorted by date ascending.
- Request body:
Request example
201 Created
Returns the user’s complete unavailability list after the insert (including pre-existing records).
422 Unprocessable Entity—user_idorcompany_idmissing, ordatesarray missing/empty
404 Not Found—user_iddoes not correspond to a known user
POST /2023-11/admin/unavailabilities/bulk-delete
Delete unavailability records for a user by date. Only records whose date matches an entry in the dates array are deleted. Returns the count of deleted rows.
- Request body:
Request example
200 OK
422 Unprocessable Entity— validation failure (missinguser_idordates)
GET /2023-11/admin/unavailabilities/dates
Return a flat array of "Y-m-d" date strings for a user within an optional date range. Designed for calendar widget rendering where only blocked dates are needed, not full records.
- Query parameters:
Request example
200 OK
422 Unprocessable Entity—user_idnot provided
GET /2023-11/admin/unavailabilities/{unavailability}
Retrieve a single unavailability record by ULID.
- Path parameters:
Request example
200 OK
404 Not Found— ULID not found401 Unauthorized— missing or invalid Bearer token
PUT /2023-11/admin/unavailabilities/{unavailability}
Update a single unavailability record. The date field is optional (sometimes); if omitted, only type and/or reason are updated.
- Path parameters:
- Request body:
Request example
200 OK
404 Not Found— ULID not found422 Unprocessable Entity—datevalue is not a valid date
DELETE /2023-11/admin/unavailabilities/{unavailability}
Delete a single unavailability record.
- Path parameters:
Request example
200 OK
404 Not Found— ULID not found500 Internal Server Error— deletion failed
GET /2023-11/unavailabilities
Public version of the unavailability list. Accepts the same user_id, start_date, and end_date query parameters as the admin endpoint.
Request example
200 OK
GET /2023-11/unavailabilities/dates
Public version of the flat date list. Accepts user_id, start_date, end_date. Requires user_id.
Request example
200 OK
GET /2023-11/unavailabilities/{unavailability}
Public version of the single unavailability show endpoint.
- Path parameters:
Request example
200 OK
Calendar Events
A CalendarEvent is a concrete scheduled occurrence linked to a staff member (user) and optionally tied to an Order. It carries a start/end timestamp, an all-day flag, a status lifecycle, and a free-form source tag. Theindex endpoint is fully implemented with rich filtering and sorting via Spatie QueryBuilder. The remaining write endpoints (store, show, update, destroy) are registered as routes but are not yet implemented in the controller (empty method bodies).
GET /2023-11/admin/calendar-events
List calendar events with optional includes, filtering, sorting, and pagination.
- Query parameters:
Request example
200 OK
Paginated collection wrapped in the standard pagination envelope. CalendarEventResource serializes all model fields, converts starts_at and ends_at to ISO 8601, and appends relations (universal polymorphic relations) and the user relationship when loaded.
401 Unauthorized— missing or invalid Bearer token403 Forbidden— invalid OAuth scope400 Bad Request— missingX-Companyheader
POST /2023-11/admin/calendar-events
Not yet implemented. The route is registered but the controller method body is empty. Calling this endpoint returns an empty 200 OK response with no body.
GET /2023-11/admin/calendar-events/{calendarEvent}
Not yet implemented. The route is registered but the controller method body is empty. Calling this endpoint returns an empty 200 OK response with no body.
- Path parameters:
Response:
200 OK — empty body (stub).
Expected response when implemented — 200 OK
PUT /2023-11/admin/calendar-events/{calendarEvent}
Not yet implemented. The route is registered but the controller method body is empty. Calling this endpoint returns an empty 200 OK response with no body.
- Path parameters:
- Expected request body (when implemented):
Response:
200 OK — empty body (stub).
DELETE /2023-11/admin/calendar-events/{calendarEvent}
Not yet implemented. The route is registered but the controller method body is empty. Calling this endpoint returns an empty 200 OK response with no body.
- Path parameters:
Response:
200 OK — empty body (stub).