Skip to main content

Update Booking Service

This endpoint allows you to update an existing booking service's configuration. Only the fields you provide will be modified, while others remain unchanged.

πŸ”Ή Endpoint Details​

PUT /api/v1/services/{id}

πŸ”’ Authentication​

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesFormat: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature

πŸ“ Request Structure​

Path Parameters​

ParameterTypeRequiredDescriptionExample
idstring (UUID)YesUnique identifier of the service1610c525-f19a-40d0-8cd1-03daba3d2d98

Updatable Fields​

FieldTypeRequiredDescriptionExample
namestringNoService name"Premium Test Drive"
durationnumberNoDuration in minutes45
timeBetweennumberNoBuffer time in minutes15
minTimeToSchedulenumberNoMinimum days to book1
maxTimeToSchedulenumberNoMaximum days to book90
incrementTimenumberNoTime slot increment30
extraFieldsobjectNoAdditional details{"area": "Barcelona"}
deniedMultipleAppointmentbooleanNoMultiple booking flagtrue
activebooleanNoService availabilitytrue
allowOverlappingbooleanNoAllow overlappingfalse
hasICallbooleanNoEnable iCall featuretrue
dateRangesarrayNoAvailability periodsSee example
calendarsarrayNoArray of calendar configurations. If included, each calendar object must contain required propertiesSee below

Calendar Object Structure​

If the calendars field is included in the request, each calendar object must contain the following properties:

FieldTypeRequiredDescriptionExample
calendarIdstring (UUID)YesThe ID of the calendar, matches with externalId"123e4567-e89b-12d3-a456-426614174000"
activebooleanYesWhether the calendar is active and available for schedulingtrue
typestringYesMust be either "agent" or "asset""agent"
restrictionDatesobjectNoCustom date restrictions for this calendar{"include": [["2025-12-25","2026-01-01"]], "exclude": [["2025-12-26","2025-12-27"]]}

🧩 Request Example​

curl -X PUT "https://openapi.onlive.site/api/v1/services/1610c525-f19a-40d0-8cd1-03daba3d2d98" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"name": "Premium Test Drive Service",
"duration": 45,
"timeBetween": 15,
"minTimeToSchedule": 1,
"maxTimeToSchedule": 90,
"incrementTime": 30,
"extraFields": {
"area": "Barcelona",
"city": "Mollet Del Valles",
"street": "Avenida. Rabassaires, 22-26",
"country": "Spain",
"requirements": [
"valid_license",
"age_over_21"
],
"vehicle_type": "electric"
},
"deniedMultipleAppointment": true,
"image": "https://cdn.onlive.site/assets/cupra/premium-test-drive.webp",
"userGroupId": "f329fe97-452f-4d12-aef0-f526a74569cc",
"allowOverlapping": false,
"hasICall": true,
"active": true,
"typeId": "e3fb21fb-83ef-4051-916b-a8e96effe81f",
"dateRanges": [
{
"startDate": "2024-10-13T22:00:00.000Z",
"endDate": "2025-10-14T21:59:59.000Z"
},
{
"startDate": "2025-11-01T00:00:00.000Z",
"endDate": "2025-12-31T23:59:59.000Z"
}
]
}'

πŸ“€ Response Format​

Successful Response (200 OK)​

{
"id": "1610c525-f19a-40d0-8cd1-03daba3d2d98",
"createdAt": "2025-03-09T19:32:03.735Z",
"updatedAt": "2025-03-09T19:32:06.669Z"
// ... updated service object
}

❌ Error Responses​

400 Bad Request​

{
"statusCode": 400,
"message": "Invalid input",
"errors": [
{
"field": "duration",
"message": "must be a positive number"
}
]
}

401 Unauthorized​

{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}

404 Not Found​

{
"statusCode": 404,
"message": "Service not found"
}

πŸ“˜ Notes​

  • Only include fields you want to update in the request body
  • The updatedAt timestamp is automatically updated
  • Omitted fields retain their current values
  • You can only update services within your organization
  • Changes may affect future appointments
  • Existing appointments are not affected by most changes

βœ… Common Use Cases​

  • πŸ“ Service Configuration: Adjust timing and scheduling rules
  • πŸ”„ Availability Update: Modify service availability periods
  • πŸ‘₯ Calendar Association: Update linked calendars
  • βš™οΈ Settings Adjustment: Modify booking constraints
  • πŸ” Access Control: Enable/disable service availability

πŸ” Update Restrictions​

  1. Immutable Fields

    • Service ID
    • Organization ID
    • Creation timestamp
  2. Scheduling Changes

    • Cannot reduce duration of existing appointments
    • Future appointments may be affected
    • Consider existing bookings when updating time constraints
  3. Calendar Changes

    • Calendars must belong to your organization
    • Removing calendars affects availability
    • Consider existing appointments

🏷️ Field Validation​

  1. Time Values

    • All durations must be positive numbers
    • incrementTime must be less than or equal to duration
    • maxTimeToSchedule must be greater than minTimeToSchedule
  2. Date Ranges

    • Must be valid ISO 8601 format
    • End date must be after start date
    • No overlapping ranges allowed