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
Header | Required | Description |
---|---|---|
Content-Type | Yes | Must be application/json |
Authorization | Yes | Format: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature |
📝 Request Structure
Path Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id | string (UUID) | Yes | Unique identifier of the service | 1610c525-f19a-40d0-8cd1-03daba3d2d98 |
Updatable Fields
Field | Type | Required | Description | Example |
---|---|---|---|---|
name | string | No | Service name | "Premium Test Drive" |
duration | number | No | Duration in minutes | 45 |
timeBetween | number | No | Buffer time in minutes | 15 |
minTimeToSchedule | number | No | Minimum days to book | 1 |
maxTimeToSchedule | number | No | Maximum days to book | 90 |
incrementTime | number | No | Time slot increment | 30 |
extraFields | object | No | Additional details | {"area": "Barcelona"} |
deniedMultipleAppointment | boolean | No | Multiple booking flag | true |
active | boolean | No | Service availability | true |
allowOverlapping | boolean | No | Allow overlapping | false |
hasICall | boolean | No | Enable iCall feature | true |
dateRanges | array | No | Availability periods | See example |
calendars | array | No | Array of calendar configurations. If included, each calendar object must contain required properties | See below |
Calendar Object Structure
If the calendars
field is included in the request, each calendar object must contain the following properties:
Field | Type | Required | Description | Example |
---|---|---|---|---|
calendarId | string (UUID) | Yes | The ID of the calendar, matches with externalId | "123e4567-e89b-12d3-a456-426614174000" |
active | boolean | Yes | Whether the calendar is active and available for scheduling | true |
type | string | Yes | Must be either "agent" or "asset" | "agent" |
restrictionDates | object | No | Custom 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
-
Immutable Fields
- Service ID
- Organization ID
- Creation timestamp
-
Scheduling Changes
- Cannot reduce duration of existing appointments
- Future appointments may be affected
- Consider existing bookings when updating time constraints
-
Calendar Changes
- Calendars must belong to your organization
- Removing calendars affects availability
- Consider existing appointments
🏷️ Field Validation
-
Time Values
- All durations must be positive numbers
incrementTime
must be less than or equal toduration
maxTimeToSchedule
must be greater thanminTimeToSchedule
-
Date Ranges
- Must be valid ISO 8601 format
- End date must be after start date
- No overlapping ranges allowed