Modify an existing schedule by updating its rules, timezone, and name All fields are optional - only provided fields will be updated.
PUT https://services.leadconnectorhq.com/calendars/schedules/{id}
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Path parameters
id
string
default:"sch123def456ghi789"
required
Unique identifier of the schedule to update
Body
name
string
default:"Updated Business Hours"
Human-readable name for the schedule
Updated schedule rules defining when the schedule is active
type
string
default:"wday"
required
Type of schedule rule - weekday (recurring) or date (specific date) Posibles valores: ‘wday’, ‘date’
Time intervals for the rule (e.g., 9 AM to 5 PM)
from
string
default:"09:00"
required
Start time in HH:MM format (24-hour format)
to
string
default:"17:00"
required
End time in HH:MM format (24-hour format)
date
string
default:"2023-04-15"
Specific date in YYYY-MM-DD format (only for date-type rules)
Day of week (only for weekday-type rules) Posibles valores: ‘sunday’, ‘monday’, ‘tuesday’, ‘wednesday’, ‘thursday’, ‘friday’, ‘saturday’
timezone
string
default:"America/Los_Angeles"
Updated timezone for the schedule (IANA timezone identifier)
Respuestas
200 - Schedule updated successfully
400 - Invalid request parameters
401 - User not authenticated
404 - Schedule with the specified ID was not found
422 - Validation errors in schedule rules or conflicting data
Ejemplo
curl -X PUT 'https://services.leadconnectorhq.com/calendars/schedules/YOUR_id' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "Updated Business Hours",
"rules": [
{
"type": "wday",
"day": "monday",
"intervals": [
{
"from": "08:00",
"to": "18:00"
}
]
}
],
"timezone": "America/Los_Angeles"
}'
const response = await fetch('https://services.leadconnectorhq.com/calendars/schedules/YOUR_id', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "Updated Business Hours", "rules": [{"type": "wday", "day": "monday", "intervals": [{"from": "08:00", "to": "18:00"}]}], "timezone": "America/Los_Angeles"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/calendars/schedules/YOUR_id',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "Updated Business Hours", "rules": [{"type": "wday", "day": "monday", "intervals": [{"from": "08:00", "to": "18:00"}]}], "timezone": "America/Los_Angeles"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/calendars/schedules/YOUR_id');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'name': 'Updated Business Hours', 'rules': [{'type': 'wday', 'day': 'monday', 'intervals': [{'from': '08:00', 'to': '18:00'}]}], 'timezone': 'America/Los_Angeles'}),
]);
$data = json_decode(curl_exec($ch), true);