Skip to content

Triggers API ​

Create, change and fire triggers: the per-agent way to start an agent on its own. A trigger is a cron schedule, a one-off time, a manual button, an incoming webhook or a connector event (one type each), sends a prompt with optional variables, and creates an agent run. An agent can have several triggers, for example a schedule trigger and a webhook trigger. Concepts, reliability and examples are in the Triggers guide, the Webhook triggers guide and the Connector triggers guide; this page is the route reference.

All routes live under /api/client/v1, take Authorization: Bearer cpeer_… and need the agents service (GET read, everything else write). A token sees only its own project. Field names are snake_case; timestamps are unix seconds (except a once trigger's run_at, see below); errors use { "error": { "type", "message", "code" } }. The exceptions to the token are the public hook endpoint and the public connector hook endpoint, which senders call with the trigger's or the subscription's secret.

Endpoints ​

Endpoint
GET /agents/{agentKey}/triggersList an agent's triggers: { "object": "list", "data": […], "has_more": false }
POST /agents/{agentKey}/triggersCreate
GET /agents/{agentKey}/triggers/{triggerId}Read
PATCH /agents/{agentKey}/triggers/{triggerId}Update
DELETE /agents/{agentKey}/triggers/{triggerId}Delete: { "id", "object": "agent.trigger.deleted", "deleted": true }
POST /agents/{agentKey}/triggers/{triggerId}/runFire now (webhook and connector triggers: with a sample payload, or a dry_run)
POST /agents/{agentKey}/triggers/{triggerId}/webhook/rotate-secretRotate the webhook secret of a webhook or connector trigger
POST /agents/{agentKey}/triggers/{triggerId}/connector/retryRetry a connector trigger
GET /agents/{agentKey}/triggers/{triggerId}/deliveriesThe delivery log of a webhook or connector trigger
GET /agents/runs?trigger_id={triggerId}History: the runs the trigger created
POST /api/public/hooks/{tenantId}/{hookId}Incoming webhook: no token
POST /api/public/connector-hooks/{tenantId}/{hookId}Incoming connector event: no token

The dashboard has the same set under /api/agents/{agentId}/triggers… (browser session, agents permission). It uses the same snake_case fields and the same error envelope as the client API; the only difference is that Run now takes no Idempotency-Key there. Two dashboard routes of the Connectors module feed the connector trigger editor: GET /api/connectors/trigger-catalog (the project's connectors whose packages declare triggers, with those triggers, their parameters, events and default schedules) and GET /api/connectors/{id}/triggers (one connector's triggers and the subscriptions made from them). Both take ?locale=en|tr.

The trigger object ​

json
{
  "id": "6720b4c3d2e1f0a9b8c7d6e5",
  "object": "agent.trigger",
  "agent": "support-bot",
  "name": "Morning ticket digest",
  "description": null,
  "enabled": true,
  "type": "schedule",
  "schedule": { "cron": "0 9 * * 1-5", "timezone": "Europe/Istanbul" },
  "prompt": "Summarise the tickets opened since yesterday 09:00.",
  "variables": null,
  "version": null,
  "class": "deferred",
  "metadata": { "report": "morning-digest" },
  "callback": { "url": "https://hooks.example.com/digest", "signed": true },
  "response_format": null,
  "next_fire_at": 1792389600,
  "last_fire_at": 1792303201,
  "last_run_id": "run_65f1c0a2b9d3e4f5a6b7c8d9",
  "last_status": "started",
  "last_error": null,
  "created_at": 1791622800,
  "updated_at": 1791622800
}
Field
type and its sub-objectWhat starts the trigger: see trigger types. One sub-object only, named after the type.
promptThe message each fire sends, up to 32 000 characters. For a webhook or connector trigger it is a template.
variablesValues for the agent's variables, or null. For a webhook or connector trigger a mapping of variable names to values or "{{payload.…}}" tags.
versionA published version number, or null for the published version at fire time.
classdefault or deferred.
metadataString pairs copied onto each run (at most 16 keys); {} when none.
callback{ url, signed } or null. The secret is write-only.
response_formatA JSON-schema answer format (as on runs) or null.
next_fire_atWhen the scheduler will fire next (unix seconds); null for manual, webhook and connector triggers, disabled triggers and finished one-offs.
last_fire_at, last_run_idThe latest fire and the run it created.
last_status, last_errorstarted when the run was created, failed with the reason when it could not be (for example invalid variables: customer_id: Required). This is about creating the run; the run has its own status.
created_at, updated_atUnix seconds.

Trigger types ​

A trigger has exactly one type, and the settings of that type sit in a sub-object of the same name. The sub-objects of the other types are not present.

typeSub-object
schedule"schedule": { "cron": "0 9 * * 1-5", "timezone": "Europe/Istanbul" }. 5-field cron; timezone is an IANA name (default UTC).
onceOn write "once": { "run_at": "2026-10-18T06:00:00Z" } or "once": { "delay_seconds": 3600 }; run_at is ISO-8601 or unix seconds and must not be in the past. Read back, once.run_at is an ISO-8601 string.
manualNone: "type": "manual" alone.
webhookSee webhook trigger.
connectorSee connector trigger. Enterprise Connectors module.

Webhook trigger ​

json
{
  "type": "webhook",
  "webhook": {
    "url": "https://console.example.com/api/public/hooks/65f1c0a2b9d3e4f5a6b7c8d9/wh_Zk3p0xH2m5Qe8TnV1aBcDe7Y",
    "preset": "generic",
    "auth": "bearer",
    "header_name": null,
    "secret_hint": "9F2c",
    "secret_source": "generated",
    "previous_secret_valid_until": null,
    "retired": false,
    "events": ["ticket.created"],
    "filter": [ { "path": "payload.ticket.priority", "op": "in", "value": ["high", "urgent"] } ],
    "include_payload": true
  }
}
FieldOn writeOn read
presetRequired on create: generic, the only preset. github, gitlab and azure_devops are retired: naming one is 400.A trigger saved with a retired preset keeps it.
authbearer (default), signature, header or standard_webhooks. The retired github_signature, gitlab_token and basic are 400.
header_nameWith auth: "header": the header that carries the secret, like x-my-token (default x-cognipeer-token). Names that carry signatures or routing are refused.null unless auth is header.
secretOnly with standard_webhooks: the sender's whsec_… secret (base64 that decodes to 24 to 64 bytes). Any other auth mode refuses it: the secret is generated.Only in the answer that creates or replaces a generated secret, once; never after that.
eventsUp to 50 event names (A-Za-z0-9._:-, at most 64 characters); empty = all events.
filterUp to 20 rules { path, op, value? }, all of which must match. op: eq, neq, in, not_in, exists, not_exists, contains, starts_with, glob. in and not_in take a list of 1 to 50 values; exists and not_exists take none. Reference.
include_payloadBoolean, default true: append the event JSON (up to 32 KiB) to the message.
url (the address a sender posts to), secret_hint (the last four characters), secret_source (generated or provided), previous_secret_valid_until (unix seconds while a rotated-out secret is still accepted, else null), retired (true for a trigger saved with a retired vendor preset).

The first time a secret is generated, which is on create, the answer carries it once, inside webhook:

json
{ "id": "6720b4c3d2e1f0a9b8c7d6e5", "object": "agent.trigger", "type": "webhook", "…": "…",
  "webhook": { "url": "https://console.example.com/api/public/hooks/…/wh_…", "secret": "whsec_…", "secret_hint": "9F2c", "…": "…" } }

The same webhook.secret appears on an update that generates a new secret (changing from standard_webhooks to another auth mode). It is never returned again.

A PATCH with a webhook sub-object keeps the hook id (so the URL) and the secret, with two exceptions: changing to standard_webhooks needs the sender's secret, and changing from it generates a new secret. A webhook sub-object sent back unchanged is not treated as a change. Changing type (together with the new type's sub-object) is allowed; a trigger that stops being a webhook stops answering at its URL (404).

Retired vendor presets ​

Triggers saved before the github, gitlab and azure_devops presets were retired are still listed, with webhook.retired: true. They receive nothing: their URL answers 410 webhook_preset_retired before authentication, and so do Run now and rotate-secret. A write that names a retired preset or auth mode is 400 invalid_trigger (on webhook.preset or webhook.auth). To keep one, PATCH it to type: "connector" with a connector object (its prompt, variables, filter and include_payload carry over; rewrite the filter paths for the package's event data), or PATCH it with a webhook object to make it a generic webhook with a new URL and secret. See Vendor presets were retired.

Connector trigger ​

json
{
  "type": "connector",
  "connector": {
    "connector_id": "6720b4c3d2e1f0a9b8c7d601",
    "trigger": "pull_request",
    "params": { "repository": "acme/api" },
    "schedule": null,
    "events": ["pull_request.opened", "pull_request.synchronize"],
    "filter": [ { "path": "payload.draft", "op": "eq", "value": false } ],
    "include_payload": true,
    "subscription_id": "6720b4c3d2e1f0a9b8c7d6aa",
    "package_id": "cognipeer.github",
    "kind": "webhook",
    "label": "GitHub · Pull request"
  },
  "connector_available": true,
  "connector_subscription": {
    "subscription_id": "6720b4c3d2e1f0a9b8c7d6aa",
    "status": "manual",
    "kind": "webhook",
    "reason": "This trigger cannot be registered at the vendor automatically. Set the webhook up with the URL and the secret.",
    "reason_code": "no_subscribe",
    "callback_url": "https://console.example.com/api/public/connector-hooks/65f1c0a2b9d3e4f5a6b7c8d9/ch_Zk3p0xH2m5Qe8TnV1aBcDe7Y",
    "secret_hint": "x7Qa",
    "previous_secret_valid_until": null,
    "auto_registered": false,
    "schedule": null,
    "next_poll_at": null,
    "last_event_at": null,
    "last_poll_at": null,
    "last_error": null,
    "setup": "1. Open the repository settings …",
    "bindings": 1
  }
}
connector fieldOn writeOn read
connector_idRequired: a connector of the same project.
triggerRequired: the name of a trigger its package declares (^[a-z][a-z0-9_]{0,63}$).
paramsThe trigger's parameters as the package declares them (a repository, a project), at most 64 KiB, no secrets. A missing required value, a wrong type, an undeclared key or a value outside the package's fixed options is 400 on connector.params.<key>. A value the package reads from the service (a repository) is checked for its type only; one that does not exist makes the registration or the first poll fail (see last_error).
eventsUp to 50 of the trigger's event types; empty = all. An event the trigger does not declare is 400 on connector.events.
schedulePoll triggers only: { cron, timezone }, a five-field cron (no L, W, #, ?, macros or seconds) no more often than the package allows, and an IANA timezone (default UTC). null returns to the package's schedule, in UTC. An object replaces the stored schedule as a whole. Errors are 400 on connector.schedule.cron with a sentence that says what is wrong.null when the package's schedule applies.
filterAs for a webhook trigger, over payload.… (the event data), event, delivery_id, received_at, trigger, agent and connector. headers is always empty and preset is connector.
include_payloadBoolean, default true.
subscription_id, package_id, kind (webhook or poll) and label (English, such as GitHub · Pull request), filled in by the Connectors module.

On a PATCH, fields left out keep their stored values, unless the write names another connector or trigger: then only what the body gives carries.

connector_available is false when the Connectors module is not there. connector_subscription is on read, create, update, retry and rotate:

Field
statusactive, pending (being registered), manual (set up by hand at the service), paused (the connector is disabled, or its account is disconnected and the subscription needs it) or failed (Retry tries again).
reason, reason_codeWhy it is manual, paused or failed. reason is one fixed English sentence; reason_code is stable: no_subscribe, subscribe_failed, unreachable, account, connector_disabled, package_missing, rotate_failed, attach_failed.
callback_urlThe URL to enter at the service for a manual setup (public connector hook endpoint).
secretThe full signing secret of a hook set up by hand, only in the answer that created or rotated it, and in the answer of a retry that bound the trigger to a new subscription.
secret_hint, previous_secret_valid_untilThe last four characters; the end of a rotation's grace period (unix seconds) or null.
auto_registeredtrue when Cognipeer registered the hook at the service.
schedule, next_poll_at, last_poll_atPolls.
last_event_at, last_errorThe latest event and the latest error. A failing poll stays active with last_error.
setupThe manual setup steps (Markdown) with the URL filled in. Add ?locale=en or ?locale=tr to the call to choose their language.
bindingsHow many agent triggers share the subscription.

Without the Connectors module, a write with type: "connector" is 400 invalid_trigger on type. While the Connectors licence or switch, or the Agents service, is off, a write that changes the connector, trigger, parameters or schedule is 400 invalid_trigger on connector.connector_id; other changes (name, prompt, events, enabled) are accepted.

Create ​

POST /api/client/v1/agents/{agentKey}/triggers
FieldType
namestringRequired, up to 200 characters.
descriptionstringUp to 2 000 characters.
enabledbooleanDefault true.
typestringRequired. schedule, once, manual, webhook or connector.
schedule, once, webhook, connectorobjectThe settings of the chosen type: schedule for type: "schedule", and so on. manual has none.
promptstringUp to 32 000 characters. Required unless the agent declares variables and variables is given. For a webhook or connector trigger: a template of at most 16 KiB, required unless include_payload is on or variables is given.
variablesobjectValidated against the agent's declared variables; defaults apply at fire time. For a webhook or connector trigger a mapping, checked at save: every name is declared, tags parse, other values have the declared type.
versionnumber | nullPin a published version.
classstringdefault (default) or deferred.
metadataobjectUp to 16 string pairs.
callback{ url, secret? }Same rules as on a run: public http(s) URL, secret 16–256 characters.
response_formatobjectOptional structured-output format.
bash
curl -X POST "$CONSOLE_URL/api/client/v1/agents/support-bot/triggers" \
  -H "Authorization: Bearer $COGNIPEER_API_TOKEN" -H "Content-Type: application/json" \
  -d '{
    "name": "Morning ticket digest",
    "type": "schedule",
    "schedule": { "cron": "0 9 * * 1-5", "timezone": "Europe/Istanbul" },
    "prompt": "Summarise the tickets opened since yesterday 09:00.",
    "class": "deferred"
  }'

201 with the trigger (and, for a webhook trigger, the one-time webhook.secret; for a connector trigger set up by hand, the one-time connector_subscription.secret). A connector trigger is saved even when its hook cannot be registered at the service: it then reads manual with the reason and the setup steps.

Errors: 400 invalid_trigger for any rejected field, with error.errors listing { "field", "message" } for each (schedule.cron, webhook.preset, webhook.secret, webhook.filter[0].op, connector.params.repository, connector.schedule.cron, prompt, variables.customer_id, …); 400 invalid_request when the body is not a JSON object and 400 invalid_json when it is not JSON; 404 agent_not_found.

An agent can have several triggers: call create again for each one.

Update ​

PATCH /api/client/v1/agents/{agentKey}/triggers/{triggerId}

Accepts any field of create; omitted fields are untouched, null clears a nullable one. callback: null removes the callback; inside callback, an omitted secret or the mask keeps the stored secret and "" removes it. Changing the type or its settings, or enabled, recomputes next_fire_at; enabled: false stops scheduled fires and makes a webhook trigger answer 200 with accepted: false (manual run still works). 200 with the trigger; 404 trigger_not_found; 400 invalid_trigger as on create.

Delete ​

DELETE …/triggers/{triggerId} removes the trigger and its delivery log. Runs it created stay. 200 { "id", "object": "agent.trigger.deleted", "deleted": true }; 404 trigger_not_found.

Run now ​

POST /api/client/v1/agents/{agentKey}/triggers/{triggerId}/run

Fires the trigger immediately, whatever its type or enabled state. The body is optional:

Field
variablesReplaces (merges over) the trigger's variables for this run.
metadataMerged over the trigger's metadata for this run.
waitSeconds to hold the request, as on the runs API. Prefer: wait=N works too.
payloadWebhook and connector triggers: a sample event (a JSON object or array). For a connector trigger, the event data; without it the package's sample event is used.
headersWebhook triggers only: sample headers (an object of string values, at most 50).
eventConnector triggers only: the event type of the sample, like pull_request.opened.
dry_runWebhook and connector triggers: true evaluates the sample and starts nothing.

An Idempotency-Key header makes the call safe to retry (client API only). 200 with the run if it finished inside wait, 202 otherwise (with Location and Retry-After). The wait stops if the client disconnects; the run carries on. The run has trigger: "manual" and trigger_id set, and counts as the trigger's last fire. Its spend, run limits, quota and usage are counted against the caller and the API token that pressed Run now (the other fires count against the trigger's last updater, or its creator while nobody has changed it); the session stays owned by system:trigger:<id>.

With a webhook or connector trigger. payload (and headers or event) are treated as a delivery would be, but they are data, never templates: the event name and delivery id are read from them as from a delivery (for a connector trigger the event type is event), the prompt template and the variable mapping are rendered over them, and the run is built the way a delivery's is (external-data wording included). Events and Filter are not applied and nothing is de-duplicated. Without a payload a webhook trigger's prompt is rendered over an empty event and nothing external is added; a connector trigger uses the package's sample event.

With dry_run: true the answer is 200:

json
{
  "object": "agent.trigger.dry_run",
  "matched": false,
  "reason": "rule 1 (payload.ticket.priority in) did not match (value: string)",
  "event": "ticket.created",
  "delivery_id": null,
  "prompt": "This run was started by an incoming webhook (generic · ticket.created). …",
  "variables": null,
  "errors": []
}

matched says whether Events and Filter would let the delivery through (reason is why not); prompt and variables are what a run would get, or null with errors listing { field, message } when the template or the mapping cannot be applied.

StatusCode
400invalid_variables, invalid_metadata, invalid_wait, invalid_requestA field was rejected. invalid_request also covers payload or dry_run sent to a trigger that is neither a webhook nor a connector trigger, headers sent to a connector trigger, and event sent to a trigger that is not a connector trigger or not shaped like an event type.
400invalid_payload, invalid_headersThe sample is not an object or array, or the headers are not an object of strings.
400template_error, invalid_variablesThe webhook turn cannot be built (error.errors has the fields).
400agent_inactiveThe agent is not active.
404trigger_not_found, agent_not_found
409idempotency_key_conflictThe key belongs to a different request.
409connector_triggers_unavailableA connector trigger, and the Connectors module is not there.
410webhook_preset_retiredA webhook trigger saved with a retired vendor preset.
429agent_run_concurrency_limit, spend_limit_exceeded, agent_quota_exceededCapacity, the spend limit, or the quota; with Retry-After.

Rotate the webhook secret ​

POST /api/client/v1/agents/{agentKey}/triggers/{triggerId}/webhook/rotate-secret
Field
grace_secondsA whole number from 0 to 86 400 (default 0): how long the current secret keeps working beside the new one. 0 also ends an earlier grace.
secretstandard_webhooks only, and required there: the sender's new whsec_… secret. Refused for other auth modes.

200:

json
{ "object": "agent.trigger.webhook_secret", "secret": "whsec_…", "secret_hint": "Qm4x", "previous_valid_until": 1792306800 }

secret is present only for a generated secret, and only in this answer. Errors: 400 trigger_not_webhook when the trigger is neither a webhook nor a connector trigger, 400 invalid_trigger for a bad grace_seconds or secret, 404 trigger_not_found, 410 webhook_preset_retired for a trigger saved with a retired vendor preset.

With a connector trigger (a webhook kind), only grace_seconds is read. The answer adds connector_subscription; secret is there for a hook set up by hand, and the grace period applies only to it: a hook Cognipeer registered is registered again with the new secret and the old one stops at once. Errors: 400 connector_no_secret when the trigger has no secret (a poll), 402 or 403 service_unavailable while the Connectors licence or switch, or the Agents service, is off, 409 account_required or 409 not_active when a hook Cognipeer registered cannot be removed from the service first (no connected account, the connector is disabled, or the package no longer offers the trigger), 409 connector_triggers_unavailable without the module, 502 connector_rotate_failed. A refusal the Connectors module makes with its own 4xx status is answered with that status and code.

Retry a connector trigger ​

POST /api/client/v1/agents/{agentKey}/triggers/{triggerId}/connector/retry

No body. Registers the hook at the service again (for a failed trigger, or a manual one other than no_subscribe and account), resumes a paused poll, or binds a trigger whose subscription is gone (reason_code: attach_failed) to a new one; when that new one is set up by hand, the answer carries its secret once. 200 with the trigger and its connector_subscription.

Errors: 400 trigger_not_connector, 404 trigger_not_found, 409 connector_triggers_unavailable without the module, 409 connector_subscription_missing, 409 not_active when the trigger has no subscription yet and its connector or the package's trigger is gone, 402 or 403 service_unavailable as for rotate, 502 connector_retry_failed.

Deliveries ​

GET /api/client/v1/agents/{agentKey}/triggers/{triggerId}/deliveries?limit=20&before={id}

The log of requests that reached a webhook trigger's URL, or of events a connector trigger received, newest first, kept for 7 days. limit is 1 to 100 (default 20; otherwise 400 invalid_limit); pass the last id as before for the next page while has_more is true.

json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "6720b4c3d2e1f0a9b8c7d6f0",
      "object": "agent.trigger.delivery",
      "received_at": 1792303200,
      "outcome": "accepted",
      "http_status": 202,
      "event": "ticket.created",
      "delivery_id": "72d3162e-cc78-11e3-81ab-4c9367dc0958",
      "run_id": "run_65f1c0a2b9d3e4f5a6b7c8d9",
      "reason": null,
      "bytes": 8123
    }
  ]
}
Field
outcomeaccepted (a run started), duplicate, filtered, ignored (the trigger or its agent is not active), unauthorized, rejected (a rate, capacity, spend or quota limit) or failed.
http_statusWhat Cognipeer answered.
event, delivery_idAs read from the delivery; null when not found or not valid.
run_idThe run that started, or the one a duplicate repeats.
reasonA short note of at most 300 characters, such as which filter rule did not match. It never holds payload text or a secret.
bytesThe body size.

Payloads are not stored. Rows other than accepted are sampled (up to 10 a minute per trigger on each node).

The public hook endpoint ​

POST /api/public/hooks/{tenantId}/{hookId}

The URL a sender posts to is webhook.url of a webhook trigger. There is no API token: the tenantId and the random hookId (wh_…) locate the trigger, and every delivery proves the trigger's secret.

AuthThe sender sends
bearerAuthorization: Bearer <secret>
header<header_name>: <secret>
signatureX-Cognipeer-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>">, with t within 5 minutes of now
standard_webhookswebhook-id, webhook-timestamp (within 5 minutes), webhook-signature: v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>"> with the base64-decoded secret

The body must be JSON (application/json or application/*+json, an object or an array, UTF-8, at most 64 levels deep) and at most AGENT_WEBHOOK_BODY_LIMIT_BYTES (default 5 MiB). Signatures are over the exact bytes received. The answers are tabulated in the guide: what Cognipeer answers. In short:

StatusAnswer
202{ "accepted": true, "run_id": "run_…", "status": "queued" }: a run was created.
200{ "accepted": false, "reason": "disabled" | "event_not_selected" | "filtered" | "duplicate", "run_id"? }.
400invalid_json, invalid_variables, template_error.
401webhook_unauthorized
404webhook_not_found
410webhook_preset_retired: the trigger was saved with a retired vendor preset. Answered before authentication.
413payload_too_large
415unsupported_media_type
429webhook_rate_limited (the request ceiling, or the run rate), agent_run_concurrency_limit, spend_limit_exceeded, agent_quota_exceeded. Always with Retry-After.
500internal_error
503webhook_unavailable, with Retry-After: 30

A started run has trigger: "webhook", channel: "trigger" and trigger_id, carries the labels webhook_event and webhook_delivery in its metadata, and is unattended. Environment: AGENT_WEBHOOK_BODY_LIMIT_BYTES, AGENT_WEBHOOK_RATE_LIMIT_PER_MINUTE (operator settings).

The public connector hook endpoint ​

POST /api/public/connector-hooks/{tenantId}/{hookId}

The callback URL of a connector trigger's subscription (connector_subscription.callback_url): the service posts its events here, after Cognipeer registered the hook or after you entered the URL at the service by hand. There is no API token: the tenantId and the random hookId (ch_…) locate the subscription, and every delivery proves its signing secret the way the connector's package declares (an HMAC over the exact bytes, a token, Basic, Bearer or Standard Webhooks). Cognipeer checks it before any package code sees the delivery. The body must be JSON and at most AGENT_WEBHOOK_BODY_LIMIT_BYTES.

StatusAnswer
202{ "accepted": <runs started>, "events": <events in the delivery> }: the events were handed to the agent triggers of the subscription.
200{ "ignored": true } for the service's ping; { "accepted": 0, "events": 0, "reason" } when the subscription is paused or still registering, or the delivery has no event the package can read.
401webhook_unauthorized: the signature or token is missing or wrong. Each agent trigger of the subscription gets an unauthorized row in its deliveries.
404webhook_not_found: no subscription at this URL, or the Connectors licence or switch, or the Agents service, is off.
413, 415The body is too large, or not JSON.
503webhook_unavailable, with Retry-After: 30.

Once the signature is right the answer is always 2xx, whatever each agent trigger does with the events (its own rows in the delivery log say), so the service does not switch the hook off over a refusal. A started run has trigger: "connector", channel: "trigger" and trigger_id, the metadata labels connector_id, connector_trigger, event_type and event_id, and is unattended.

Firing, misfires and exactly-once ​

The scheduler looks for due triggers every 30 seconds (AGENT_TRIGGER_TICK_MS). A fire claims its slot (trigger id and fire time) in the database and uses the run idempotency key trigger:<triggerId>:<fireTime>, so a trigger fires once even with several Cognipeer nodes. A slot missed by up to one hour (AGENT_TRIGGER_MISFIRE_GRACE_MS) fires once to catch up; an older slot is skipped. Each fire is a run in the trigger's class, with channel: "trigger" and trigger: "schedule", "once", "manual", "webhook" or "connector". A webhook delivery uses the key hook:<triggerId>:<hash> (de-duplication), a connector event ctrig:<triggerId>:<hash> of the subscription and the event's id.

Events: trigger.fired and trigger.failed. trigger.failed is sent at most once an hour for each trigger and reason, so a schedule that is refused on every tick does not flood a subscriber.

Errors ​

StatusCode
400invalid_triggerA trigger field was rejected on create or update; error.errors lists { field, message }.
400invalid_request, invalid_json, trigger_not_webhook, trigger_not_connector, connector_no_secret, invalid_limit, and those under Run nowThe body or a parameter is not valid.
402, 403service_unavailableRetry or rotate of a connector trigger while the Connectors licence or switch, or the Agents service, is off.
404agent_not_found, trigger_not_foundThe agent or trigger does not exist in the token's project.
409idempotency_key_conflict, connector_triggers_unavailable, connector_subscription_missing, account_required, not_activeidempotency_key_conflict on run-now only; the others on connector triggers, see rotate and retry.
410webhook_preset_retiredRun-now or rotate-secret of a webhook trigger saved with a retired vendor preset.
429agent_run_concurrency_limit, spend_limit_exceeded, agent_quota_exceededOn run-now: capacity, the spend limit, or the quota.
502connector_retry_failed, connector_rotate_failedThe Connectors module could not retry or rotate; try again.

SDK: client.agents.triggers.list() / create() / get() / update() / delete() / run() / rotateWebhookSecret() / deliveries() and signTriggerWebhook() (4.0.0+). See the SDK reference.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub · Contact Support