JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const schedules = await client.schedules.list('agent_abc123');
console.log(schedules.schedules);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
schedules = client.schedules.list(
"agent_abc123",
)
print(schedules.schedules)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
schedules, err := client.Schedules.List(context.TODO(), "agent_abc123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", schedules.Schedules)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
schedules = cerca.schedules.list("agent_abc123")
puts(schedules)cerca schedules list \
--api-key 'My API Key' \
--agent-id agent_abc123curl --request GET \
--url https://api.cerca.dev/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/agents/{agentId}/schedules")
.header("Authorization", "Bearer <token>")
.asString();{
"schedules": [
{
"createdAt": "<string>",
"enabled": true,
"id": "<string>",
"name": "<string>",
"nextAt": "<string>",
"message": "<string>",
"timezone": "<string>",
"updatedAt": "<string>",
"cron": "<string>",
"instructions": "<string>",
"model": "<string>",
"runAt": "2023-11-07T05:31:56Z",
"tools": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Schedules
List schedules
GET
/
agents
/
{agentId}
/
schedules
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const schedules = await client.schedules.list('agent_abc123');
console.log(schedules.schedules);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
schedules = client.schedules.list(
"agent_abc123",
)
print(schedules.schedules)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
schedules, err := client.Schedules.List(context.TODO(), "agent_abc123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", schedules.Schedules)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
schedules = cerca.schedules.list("agent_abc123")
puts(schedules)cerca schedules list \
--api-key 'My API Key' \
--agent-id agent_abc123curl --request GET \
--url https://api.cerca.dev/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/agents/{agentId}/schedules")
.header("Authorization", "Bearer <token>")
.asString();{
"schedules": [
{
"createdAt": "<string>",
"enabled": true,
"id": "<string>",
"name": "<string>",
"nextAt": "<string>",
"message": "<string>",
"timezone": "<string>",
"updatedAt": "<string>",
"cron": "<string>",
"instructions": "<string>",
"model": "<string>",
"runAt": "2023-11-07T05:31:56Z",
"tools": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}⌘I