Bulk pause schedules
curl --request POST \
--url https://scheduler.studio.lyzr.ai/schedules/pause-bulk/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
"66f1c2a9e4b0a1b2c3d4e5f6",
"66f1c2a9e4b0a1b2c3d4e5f9"
]
'import requests
url = "https://scheduler.studio.lyzr.ai/schedules/pause-bulk/"
payload = ["66f1c2a9e4b0a1b2c3d4e5f6", "66f1c2a9e4b0a1b2c3d4e5f9"]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify(['66f1c2a9e4b0a1b2c3d4e5f6', '66f1c2a9e4b0a1b2c3d4e5f9'])
};
fetch('https://scheduler.studio.lyzr.ai/schedules/pause-bulk/', 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/schedules/pause-bulk/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'66f1c2a9e4b0a1b2c3d4e5f6',
'66f1c2a9e4b0a1b2c3d4e5f9'
]),
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/schedules/pause-bulk/"
payload := strings.NewReader("[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]")
req, _ := http.NewRequest("POST", 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.post("https://scheduler.studio.lyzr.ai/schedules/pause-bulk/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/schedules/pause-bulk/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"total_requested": 123,
"paused_count": 0,
"already_paused_count": 0,
"not_found_count": 0,
"invalid_count": 0,
"paused_schedules": [
{
"id": "66f1c2a9e4b0a1b2c3d4e5f6",
"user_id": "user@example.com",
"agent_id": "66e9b0f2a1c3d4e5f6a7b8c9",
"message": "Summarize yesterday's support tickets and flag anything urgent.",
"cron_expression": "0 9 * * 1-5",
"timezone": "Asia/Kolkata",
"created_at": "2023-11-07T05:31:56Z",
"max_retries": 3,
"retry_delay": 60,
"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
}
]
}Schedules
Bulk Pause Schedules
Pause up to 100 agent schedules at once.
POST
/
schedules
/
pause-bulk
/
Bulk pause schedules
curl --request POST \
--url https://scheduler.studio.lyzr.ai/schedules/pause-bulk/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
"66f1c2a9e4b0a1b2c3d4e5f6",
"66f1c2a9e4b0a1b2c3d4e5f9"
]
'import requests
url = "https://scheduler.studio.lyzr.ai/schedules/pause-bulk/"
payload = ["66f1c2a9e4b0a1b2c3d4e5f6", "66f1c2a9e4b0a1b2c3d4e5f9"]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify(['66f1c2a9e4b0a1b2c3d4e5f6', '66f1c2a9e4b0a1b2c3d4e5f9'])
};
fetch('https://scheduler.studio.lyzr.ai/schedules/pause-bulk/', 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/schedules/pause-bulk/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'66f1c2a9e4b0a1b2c3d4e5f6',
'66f1c2a9e4b0a1b2c3d4e5f9'
]),
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/schedules/pause-bulk/"
payload := strings.NewReader("[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]")
req, _ := http.NewRequest("POST", 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.post("https://scheduler.studio.lyzr.ai/schedules/pause-bulk/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/schedules/pause-bulk/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"66f1c2a9e4b0a1b2c3d4e5f6\",\n \"66f1c2a9e4b0a1b2c3d4e5f9\"\n]"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"total_requested": 123,
"paused_count": 0,
"already_paused_count": 0,
"not_found_count": 0,
"invalid_count": 0,
"paused_schedules": [
{
"id": "66f1c2a9e4b0a1b2c3d4e5f6",
"user_id": "user@example.com",
"agent_id": "66e9b0f2a1c3d4e5f6a7b8c9",
"message": "Summarize yesterday's support tickets and flag anything urgent.",
"cron_expression": "0 9 * * 1-5",
"timezone": "Asia/Kolkata",
"created_at": "2023-11-07T05:31:56Z",
"max_retries": 3,
"retry_delay": 60,
"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
}
]
}Send a JSON array of schedule IDs. The response reports how many schedules were paused, how many were already paused, how many IDs were not found, and how many were not valid IDs.
Authorizations
Body
application/json
Maximum array length:
100Example:
[
"66f1c2a9e4b0a1b2c3d4e5f6",
"66f1c2a9e4b0a1b2c3d4e5f9"
]
Response
Summary of the bulk pause.