List agent attachments
curl --request GET \
--url https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_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/schedules/by-agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"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
}
],
"webhooks": [
{
"id": "<string>",
"agent_id": "<string>",
"user_id": "<string>",
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"is_active": true,
"last_triggered_at": "2023-11-07T05:31:56Z",
"last_trigger_success": true,
"trigger_count": 0
}
]
}Schedules
List Agent Attachments
List the schedules and webhooks attached to an agent.
GET
/
schedules
/
by-agent
/
{agent_id}
List agent attachments
curl --request GET \
--url https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_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/schedules/by-agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scheduler.studio.lyzr.ai/schedules/by-agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"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
}
],
"webhooks": [
{
"id": "<string>",
"agent_id": "<string>",
"user_id": "<string>",
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"is_active": true,
"last_triggered_at": "2023-11-07T05:31:56Z",
"last_trigger_success": true,
"trigger_count": 0
}
]
}Returns the agent’s cron schedules and its webhooks in one response, scoped to your API key. Use it to see everything that can run an agent automatically.
Authorizations
Lyzr API key. Required on every endpoint except Trigger Webhook.
Path Parameters
ID of the agent.