curl --request PATCH \
--url https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cron_expression": "30 6 * * *",
"timezone": "America/New_York"
}
'import requests
url = "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}"
payload = {
"cron_expression": "30 6 * * *",
"timezone": "America/New_York"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({cron_expression: '30 6 * * *', timezone: 'America/New_York'})
};
fetch('https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cron_expression' => '30 6 * * *',
'timezone' => 'America/New_York'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}"
payload := strings.NewReader("{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"id": "66f1c4d2e4b0a1b2c3d4e5f8",
"url": "https://api.example.com/reports/refresh",
"method": "POST",
"timeout_seconds": 120,
"cron_expression": "0 2 * * *",
"timezone": "UTC",
"created_at": "2023-11-07T05:31:56Z",
"headers": {},
"body": "<unknown>",
"max_retries": 3,
"retry_delay": 60,
"label": "Nightly report refresh",
"is_active": true,
"updated_at": "2023-11-07T05:31:56Z",
"next_run_time": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_run_success": true,
"last_run_status": 123,
"last_attempt_count": 123
}Update HTTP Schedule
Change one or more fields of an HTTP schedule.
curl --request PATCH \
--url https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cron_expression": "30 6 * * *",
"timezone": "America/New_York"
}
'import requests
url = "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}"
payload = {
"cron_expression": "30 6 * * *",
"timezone": "America/New_York"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({cron_expression: '30 6 * * *', timezone: 'America/New_York'})
};
fetch('https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cron_expression' => '30 6 * * *',
'timezone' => 'America/New_York'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}"
payload := strings.NewReader("{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/http-schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_expression\": \"30 6 * * *\",\n \"timezone\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"id": "66f1c4d2e4b0a1b2c3d4e5f8",
"url": "https://api.example.com/reports/refresh",
"method": "POST",
"timeout_seconds": 120,
"cron_expression": "0 2 * * *",
"timezone": "UTC",
"created_at": "2023-11-07T05:31:56Z",
"headers": {},
"body": "<unknown>",
"max_retries": 3,
"retry_delay": 60,
"label": "Nightly report refresh",
"is_active": true,
"updated_at": "2023-11-07T05:31:56Z",
"next_run_time": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_run_success": true,
"last_run_status": 123,
"last_attempt_count": 123
}next_run_time is recalculated.
Set is_active to false to pause the schedule or true to resume it.Authorizations
Lyzr API key. Required on every endpoint except Trigger Webhook.
Path Parameters
ID of the schedule.
"66f1c2a9e4b0a1b2c3d4e5f6"
Body
All fields are optional. Only the fields you send are changed.
Absolute URL to call.
GET, POST, PUT, PATCH, DELETE Replaces the stored headers.
Show child attributes
Show child attributes
Request body. Objects and arrays are sent as JSON; any other value is sent as a raw string.
1 <= x <= 600Five-field cron expression: minute hour day month day_of_week. Day-of-week follows standard cron numbering (0 or 7 = Sunday, 1 = Monday, ..., 6 = Saturday).
"0 9 * * 1-5"
0 <= x <= 510 <= x <= 3600Set to false to pause or true to resume.
Response
The updated HTTP schedule.
"66f1c4d2e4b0a1b2c3d4e5f8"
"https://api.example.com/reports/refresh"
"POST"
120
"0 2 * * *"
"UTC"
Show child attributes
Show child attributes
Stored request body.
"Nightly report refresh"
false when the schedule is paused.
When the schedule will next fire. null while paused.
HTTP status code returned by the target on the most recent run.
Number of attempts the most recent run took.