Skip to main content
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

Authorization
string
required
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
rules
object[]
Updated schedule rules defining when the schedule is active
timezone
string
default:"America/Los_Angeles"
Updated timezone for the schedule (IANA timezone identifier)

Respuestas

schedule
object
required
Schedule
{}
{}
{}
{}

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);