Skip to main content
GET
/
api
/
agenda
/
bookings
List Bookings
curl --request GET \
  --url https://api.example.com/api/agenda/bookings
{
  "bookings": [
    {
      "booking_id": "<string>",
      "client_id": "<string>",
      "client": {
        "name": "<string>",
        "surname": "<string>",
        "phone": "<string>"
      },
      "staff_id": {},
      "staff": {
        "name": "<string>",
        "surname": "<string>"
      },
      "item_type": "<string>",
      "item_id": "<string>",
      "status": "<string>",
      "booking_date": "<string>",
      "start_time": "<string>",
      "end_time": "<string>",
      "duration": 123,
      "notes": {},
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  ],
  "401 Unauthorized": {}
}
Retrieves a list of all bookings with optional filtering capabilities. Results are ordered by booking date and start time in ascending order.

Authentication

This endpoint requires authentication via Bearer token in the Authorization header or auth_token cookie.
Authorization: Bearer YOUR_TOKEN

Query Parameters

start
string
Filter bookings from this date onwards (ISO 8601 format)Example: 2024-03-01
end
string
Filter bookings up to this date (ISO 8601 format)Example: 2024-03-31
staff_id
string
Filter bookings assigned to a specific staff memberMust be a valid user UUID (100 characters max)
client_id
string
Filter bookings for a specific clientMust be a valid user UUID (100 characters max)

Response

Returns an array of booking objects with related client and staff information.
bookings
Booking[]
Array of booking objects

Examples

curl -X GET 'https://api.beils.com/api/agenda/bookings' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Response Example

[
  {
    "booking_id": "abc123-def456-ghi789",
    "client_id": "client-uuid-123",
    "client": {
      "name": "María",
      "surname": "García",
      "phone": "+34 600 123 456"
    },
    "staff_id": "staff-uuid-456",
    "staff": {
      "name": "Ana",
      "surname": "López"
    },
    "item_type": "service",
    "item_id": "service-uuid-789",
    "status": "confirmed",
    "booking_date": "2024-03-15T00:00:00.000Z",
    "start_time": "10:00",
    "end_time": "11:00",
    "duration": 60,
    "notes": "Client prefers window seat",
    "created_at": "2024-03-01T08:30:00.000Z",
    "updated_at": "2024-03-01T08:30:00.000Z"
  }
]

Error Responses

401 Unauthorized
error
Missing or invalid authentication token
{
  "statusCode": 401,
  "statusMessage": "Unauthorized: Token is missing or invalid"
}

Notes

  • When filtering by date range, both start and end parameters must be provided together
  • Dates are stored in UTC timezone
  • Results are automatically ordered by booking_date ascending, then start_time ascending
  • The endpoint includes related client and staff information to minimize additional API calls

Build docs developers (and LLMs) love