Update Weekly Availability
This endpoint allows you to update an existing weekly availability schedule. Only the fields you provide will be modified, while others remain unchanged.
πΉ Endpoint Detailsβ
PUT /api/v1/weekly-schedules/{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 schedule | "f57b71ad-c1cc-4af6-853b-616ecb7d234c" |
Updatable Fieldsβ
Field | Type | Required | Description | Example |
---|---|---|---|---|
name | string | No | New schedule name | "Updated Availability" |
configuration | object | No | Schedule configuration | See configuration structure |
serviceIds | string[] | No | Associated services | ["uuid1", "uuid2"] |
timezone | string | No | IANA timezone name | "Europe/Madrid" |
Configuration Structureβ
Field | Type | Required | Description |
---|---|---|---|
workingHours | object | No | Day-based schedule updates |
dateOverrides | object | No | Special date schedule updates |
outsOfTheOffice | array | No | Out-of-office period updates |
π§© Request Exampleβ
curl -X PUT "https://openapi.onlive.site/api/v1/weekly-schedules/f57b71ad-c1cc-4af6-853b-616ecb7d234c" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"configuration": {
"workingHours": {
"0": [
[
"09:00",
"14:00"
],
[
"16:00",
"20:30"
]
],
"1": [
[
"09:00",
"14:00"
],
[
"16:00",
"20:30"
]
],
"2": [
[
"09:00",
"14:00"
],
[
"16:00",
"20:30"
]
],
"3": [
[
"09:00",
"14:00"
],
[
"16:00",
"20:30"
]
],
"4": [
[
"09:00",
"14:00"
],
[
"16:00",
"20:30"
]
],
"5": [
[
"10:00",
"14:00"
]
],
"6": []
},
"dateOverrides": {
"2025-03-19": [
[
"08:00",
"12:00"
]
]
},
"outsOfTheOffice": [
[
"2025-03-06T18:57",
"2025-03-07T18:57"
]
]
},
"serviceIds": [
"1c79cfed-2076-438c-99f4-1c26da94ab0b",
"1c79cfed-2076-438c-99f4-1c26da94ab43"
]
}'
π€ Response Formatβ
Successful Response (200 OK)β
{
"id": "f57b71ad-c1cc-4af6-853b-616ecb7d234c",
"createdAt": "2025-05-22T12:45:06.490Z",
"updatedAt": "2025-05-22T13:00:00.490Z"
// ... updated schedule object
}
β Error Responsesβ
400 Bad Requestβ
{
"statusCode": 400,
"message": "Invalid input",
"errors": [
{
"field": "configuration.workingHours",
"message": "Invalid time format"
}
]
}
401 Unauthorizedβ
{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}
404 Not Foundβ
{
"statusCode": 404,
"message": "Schedule not found"
}
π Notesβ
- Only include fields you want to update
- The
updatedAt
timestamp is automatically updated - Omitted fields retain their current values
- Changes affect future availability only
- Existing appointments are not affected
- Time slots must be in schedule's timezone
β Common Use Casesβ
- π Schedule Adjustment: Modify working hours
- π Service Association: Update linked services
- π Special Hours: Add or modify date overrides
- ποΈ Vacation Planning: Update out-of-office periods
- βοΈ Configuration: Adjust timezone settings
π Update Restrictionsβ
-
Immutable Fields
- Schedule ID
- Organization ID
- Creation timestamp
- Calendar ID
-
Time Updates
- Must maintain valid time formats
- No overlapping time slots
- Future-dated changes only
-
Service Updates
- Services must exist
- Services must be in your organization
- Previous associations are replaced
π·οΈ Field Validationβ
-
Time Values
- Must be in "HH:mm" format
- End time after start time
- Valid hours (00-23)
- Valid minutes (00-59)
-
Date Values
- ISO 8601 format for out-of-office
- "YYYY-MM-DD" for overrides
- Future dates only
-
Configuration
- Valid day numbers (0-6)
- No overlapping slots
- Valid timezone names