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 webhookSubscription = await client.webhooks.update('fleet_abc123', 'webhook_abc123');
console.log(webhookSubscription.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
)
webhook_subscription = client.webhooks.update(
fleet_id="fleet_abc123",
webhook_id="webhook_abc123",
)
print(webhook_subscription.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"),
)
webhookSubscription, err := client.Webhooks.Update(
context.TODO(),
"fleet_abc123",
"webhook_abc123",
cercago.WebhookUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhookSubscription.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
webhook_subscription = cerca.webhooks.update("fleet_abc123", "webhook_abc123")
puts(webhook_subscription)cerca webhooks update \
--api-key 'My API Key' \
--fleet-id fleet_abc123 \
--webhook-id webhook_abc123curl --request PUT \
--url https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"events": [],
"url": "https://example.com/webhook"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'events' => [
],
'url' => 'https://example.com/webhook'
]),
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.put("https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"events\": [],\n \"url\": \"https://example.com/webhook\"\n}")
.asString();{
"createdAt": "<string>",
"enabled": true,
"fleetId": "<string>",
"events": [
"agent.created"
],
"id": "<string>",
"updatedAt": "<string>",
"url": "<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"
}Webhooks
Update webhook
PUT
/
fleets
/
{fleetId}
/
webhooks
/
{webhookId}
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 webhookSubscription = await client.webhooks.update('fleet_abc123', 'webhook_abc123');
console.log(webhookSubscription.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
)
webhook_subscription = client.webhooks.update(
fleet_id="fleet_abc123",
webhook_id="webhook_abc123",
)
print(webhook_subscription.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"),
)
webhookSubscription, err := client.Webhooks.Update(
context.TODO(),
"fleet_abc123",
"webhook_abc123",
cercago.WebhookUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhookSubscription.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
webhook_subscription = cerca.webhooks.update("fleet_abc123", "webhook_abc123")
puts(webhook_subscription)cerca webhooks update \
--api-key 'My API Key' \
--fleet-id fleet_abc123 \
--webhook-id webhook_abc123curl --request PUT \
--url https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"events": [],
"url": "https://example.com/webhook"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'events' => [
],
'url' => 'https://example.com/webhook'
]),
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.put("https://api.cerca.dev/fleets/{fleetId}/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"events\": [],\n \"url\": \"https://example.com/webhook\"\n}")
.asString();{
"createdAt": "<string>",
"enabled": true,
"fleetId": "<string>",
"events": [
"agent.created"
],
"id": "<string>",
"updatedAt": "<string>",
"url": "<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:
"fleet_abc123"
Minimum string length:
1Example:
"webhook_abc123"
Body
application/json
Whether deliveries are enabled for this subscription.
Example:
true
Event names to deliver. Omit to subscribe to all non-test events.
webhook.test is reserved for the test endpoint and cannot be subscribed to.
Available options:
agent.created, agent.updated, agent.deleted, thread.created, thread.status.changed, thread.completed, thread.failed, turn.created, turn.completed, turn.failed, message.created, approval.requested, approval.resolved, approval.granted, schedule.created, schedule.deleted, schedule.triggered, connection.attached, connection.detached HTTPS endpoint that will receive webhook deliveries.
Example:
"https://example.com/webhook"
Response
Webhook subscription updated.
Webhook subscription metadata returned by list, get, and update. The one-time signing secret is not returned here.
Available options:
agent.created, agent.updated, agent.deleted, thread.created, thread.status.changed, thread.completed, thread.failed, turn.created, turn.completed, turn.failed, message.created, approval.requested, approval.resolved, approval.granted, schedule.created, schedule.deleted, schedule.triggered, connection.attached, connection.detached, webhook.test