Skip to main content
POST
/
fleets
/
{fleetId}
/
webhooks
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 webhookSubscriptionCreated = await client.webhooks.create('fleet_abc123', {
  url: 'https://example.com/webhook',
});

console.log(webhookSubscriptionCreated.id);
{
  "createdAt": "<string>",
  "enabled": true,
  "fleetId": "<string>",
  "events": [],
  "id": "<string>",
  "updatedAt": "<string>",
  "url": "<string>",
  "secret": "whsec_abc123"
}

Documentation Index

Fetch the complete documentation index at: https://docs.cerca.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

fleetId
string
required
Minimum string length: 1
Example:

"fleet_abc123"

Body

application/json
url
string<uri>
required

HTTPS endpoint that will receive webhook deliveries.

Example:

"https://example.com/webhook"

events
enum<string>[]

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
{key}
any

Response

Webhook subscription created. The one-time signing secret is returned as secret.

Webhook subscription response for create and rotate. Includes the one-time secret field.

createdAt
string
required
enabled
boolean
required
fleetId
string
required
events
enum<string>[]
required
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
id
string
required
updatedAt
string
required
url
string
required
secret
string
required

One-time webhook signing secret returned only by create and rotate responses. The field name is secret.

Example:

"whsec_abc123"