curl --request PUT \
--url https://api.example.com/api/agenda/bookings/{id} \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"staff_id": "<string>",
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": "<string>"
}
'{
"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": {},
"400 Bad Request": {},
"404 Not Found": {}
}Update an existing booking by ID
curl --request PUT \
--url https://api.example.com/api/agenda/bookings/{id} \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"staff_id": "<string>",
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": "<string>"
}
'{
"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": {},
"400 Bad Request": {},
"404 Not Found": {}
}end_time if start_time or duration are updated.
auth_token cookie.
Authorization: Bearer YOUR_TOKEN
abc123-def456-ghi789null to unassign staff. Must be a valid user UUID if provided.service, packpending: Awaiting confirmationconfirmed: Booking confirmedcompleted: Service completedcancelled: Booking cancelledno_show: Client did not show up2024-03-15 or 2024-03-15T00:00:00.000Z)09:30, 14:00Note: Updating this will trigger automatic end_time recalculation if duration is presentstart_time and duration are both updated, this will be automatically recalculated unless explicitly providedend_time recalculation if start_time is also presentExample: 60 for 1 hour, 90 for 1.5 hoursservice or packcurl -X PUT 'https://api.beils.com/api/agenda/bookings/abc123-def456-ghi789' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"status": "confirmed"
}'
{
"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-789",
"staff": {
"name": "Carlos",
"surname": "Ruiz"
},
"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": "Confirmed via phone call",
"created_at": "2024-03-01T08:30:00.000Z",
"updated_at": "2024-03-05T10:15:00.000Z"
}
{
"statusCode": 401,
"statusMessage": "Unauthorized: Token is missing or invalid"
}
{
"statusCode": 400,
"statusMessage": "Booking ID is required"
}
{
"statusCode": 404,
"statusMessage": "Booking not found"
}
booking_id, created_at, updated_atstart_time and duration together, the end_time is automatically recalculatedbooking_date is provided as a string, it’s automatically converted to a proper Date objectupdated_at timestamp is automatically updated on every successful updatestaff_id to null in the request