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 schedule = await client.schedules.create('agent_abc123', {
message: 'message',
name: 'name',
});
console.log(schedule.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
schedule = client.schedules.create(
agent_id="agent_abc123",
message="message",
name="name",
)
print(schedule.id)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"),
)
schedule, err := client.Schedules.New(
context.TODO(),
"agent_abc123",
cercago.ScheduleNewParams{
Message: cercago.F("message"),
Name: cercago.F("name"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", schedule.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
schedule = cerca.schedules.create("agent_abc123", message: "message", name: "name")
puts(schedule)cerca schedules create \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--message message \
--name namecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"name": "<string>",
"cron": "<string>",
"instructions": "<string>",
"model": "<string>",
"runAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"tools": [
"sandbox.*"
]
}
'<?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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'name' => '<string>',
'cron' => '<string>',
'instructions' => '<string>',
'model' => '<string>',
'runAt' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'tools' => [
'sandbox.*'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"name\": \"<string>\",\n \"cron\": \"<string>\",\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"runAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"tools\": [\n \"sandbox.*\"\n ]\n}")
.asString();{
"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": [
"sandbox.*"
]
}{
"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"
}Create schedule
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 schedule = await client.schedules.create('agent_abc123', {
message: 'message',
name: 'name',
});
console.log(schedule.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
schedule = client.schedules.create(
agent_id="agent_abc123",
message="message",
name="name",
)
print(schedule.id)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"),
)
schedule, err := client.Schedules.New(
context.TODO(),
"agent_abc123",
cercago.ScheduleNewParams{
Message: cercago.F("message"),
Name: cercago.F("name"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", schedule.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
schedule = cerca.schedules.create("agent_abc123", message: "message", name: "name")
puts(schedule)cerca schedules create \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--message message \
--name namecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"name": "<string>",
"cron": "<string>",
"instructions": "<string>",
"model": "<string>",
"runAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"tools": [
"sandbox.*"
]
}
'<?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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'name' => '<string>',
'cron' => '<string>',
'instructions' => '<string>',
'model' => '<string>',
'runAt' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'tools' => [
'sandbox.*'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"name\": \"<string>\",\n \"cron\": \"<string>\",\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"runAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"tools\": [\n \"sandbox.*\"\n ]\n}")
.asString();{
"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": [
"sandbox.*"
]
}{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
1"agent_abc123"
Body
Per-schedule tool subset. When the schedule starts a thread, these tools can only narrow the agent's effective tools.
Configurable runtime tool name, configurable namespace wildcard such as sandbox., or external namespace wildcard such as google.. At thread and turn scope, entries can only narrow the agent's effective tools.
1Response
Schedule created.
Per-schedule tool subset. Scheduled threads inherit the agent's effective tools when omitted and can only narrow them when provided.
Configurable runtime tool name, configurable namespace wildcard such as sandbox., or external namespace wildcard such as google.. At thread and turn scope, entries can only narrow the agent's effective tools.
1