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 response = await client.schedules.trigger('agent_abc123', 'schedule_abc123');
console.log(response.threadId);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
response = client.schedules.trigger(
agent_id="agent_abc123",
schedule_id="schedule_abc123",
)
print(response.thread_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"),
)
response, err := client.Schedules.Trigger(
context.TODO(),
"agent_abc123",
"schedule_abc123",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ThreadID)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
response = cerca.schedules.trigger("agent_abc123", "schedule_abc123")
puts(response)cerca schedules trigger \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--schedule-id schedule_abc123curl --request POST \
--url https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.post("https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger")
.header("Authorization", "Bearer <token>")
.asString();{
"threadId": "<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
Trigger schedule
POST
/
agents
/
{agentId}
/
schedules
/
{scheduleId}
/
trigger
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 response = await client.schedules.trigger('agent_abc123', 'schedule_abc123');
console.log(response.threadId);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
response = client.schedules.trigger(
agent_id="agent_abc123",
schedule_id="schedule_abc123",
)
print(response.thread_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"),
)
response, err := client.Schedules.Trigger(
context.TODO(),
"agent_abc123",
"schedule_abc123",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ThreadID)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
response = cerca.schedules.trigger("agent_abc123", "schedule_abc123")
puts(response)cerca schedules trigger \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--schedule-id schedule_abc123curl --request POST \
--url https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.post("https://api.cerca.dev/agents/{agentId}/schedules/{scheduleId}/trigger")
.header("Authorization", "Bearer <token>")
.asString();{
"threadId": "<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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Example:
"agent_abc123"
Minimum string length:
1Example:
"schedule_abc123"
Response
Schedule triggered.
⌘I