Lincoln Cannon LLC

Trigger API Integration Guide

Schemas and Try it: API Reference (trigger). This page is an Integration Guide. Related: Workflow API Integration Guide · SSO Integration Guide

Status: available. A trigger fires (on a schedule, or when your system calls its webhook) and starts the workflows and/or agents you link as consumers. Confirm with your Lincoln Cannon LLC integration contact that Trigger is enabled for your account before integrating. Workflows are described in Workflow API Integration Guide; agent turns use your agent’s standing trigger bindings. Sign-in tokens are described in SSO Integration Guide.

Intended base URL: https://api.lincolncannon.co/trigger. If your integration contact gives you a non-production API base, use https://api-dev.lincolncannon.co/trigger instead.

Authentication

Send one of:

HeaderWho
Authorization: Bearer <id_token>Organization owner account, or an additional mailbox your integration contact configures. Obtain tokens per SSO Integration Guide.
x-api-keyAPI key your integration contact issued for your account.

Do not send an invalid or expired Bearer token together with an API key — a present Bearer that fails is not ignored. Missing credentials → 401 authorization required. The webhook delivery route is the exception: it uses a signature, not these headers.

CORS: the trigger management routes echo a valid Origin on responses. Browser preflight is handled automatically. The webhook delivery route (POST /hooks/{triggerId}) does not use CORS.

Concepts

TermMeaning
TriggerSomething that fires. A trigger has a kind, a name, and an enabled flag. Lincoln Cannon LLC assigns the trigger id (UUID).
schedule triggerFires on a schedule expression. Available now.
webhook triggerFires when your system sends a signed HTTPS request to the trigger's webhook URL. No expression. See Webhook triggers.
ConsumerA target the trigger fires. Every consumer is { "kind": "agent" | "workflow", "id": "<uuid>" }.

A trigger only fires. It carries no prompt. What happens next is defined by the consumer you link (Workflow API Integration Guide for workflows; your agent's standing trigger bindings for agents). A webhook JSON body is untrusted data: it is appended for agent consumers (data only — not instructions) and is not passed into workflow runs.

Consumers and what fires today

Consumer kindBehavior when the trigger fires
workflowStarts a run of that workflow definition on your account. If the definition is disabled or missing, no run starts. The webhook body is not passed into the run.
agentStarts an unattended agent turn when that agent has a trigger binding for this trigger id (standing prompt on the agent — not on the trigger). A webhook JSON body is appended as untrusted data (not instructions). Missing ownership or binding → no turn.

A trigger may have at most 16 consumers. Firing is asynchronous: a fire does not wait for the run to finish.

Schedule expressions

expression is a schedule expression evaluated in UTC:

FormExample
cron(...)cron(0 14 * * ? *) — every day at 14:00 UTC
rate(...)rate(1 hour)
at(...)at(2027-01-15T09:30:00) — one time

Maximum length is 256 characters. An invalid expression returns 400. Schedule expressions apply to schedule triggers only.

Webhook triggers

Create a webhook trigger with POST /triggers and { "kind": "webhook", "name": "...", "enabled": true }. Do not send expression (it returns 400 expression is not allowed for webhook triggers).

The 201 response includes webhookSecret, a random URL-safe string (43 characters). It is returned only once. Store it securely: it is never returned by GET, list, or PUT, and it cannot be retrieved later. To replace a lost or compromised secret without deleting the trigger, call POST /triggers/{triggerId}/rotate-secret with an empty JSON body ({}). The response includes a new webhookSecret once; the previous secret stops working immediately. If the trigger was removed before the new secret was stored, the call returns 404 trigger was not found. If another rotation stored a secret first, the call returns 409 trigger changed; retry and does not include a secret; call it again.

Webhook URL

POST https://api.lincolncannon.co/trigger/hooks/{triggerId}

Use https://api-dev.lincolncannon.co/trigger/hooks/{triggerId} for a non-production API base. {triggerId} is the trigger id.

The webhook URL is for server-to-server calls. It does not support browser (CORS) requests, and it does not accept a Bearer token or x-api-key. Authentication is the signature below.

Signing a request

HeaderValue
Content-Typeapplication/json
X-LCLLC-TimestampCurrent unix time in seconds. Requests more than 300 seconds from the server clock are rejected.
X-LCLLC-Signaturesha256=<hex>, where <hex> is the lowercase hex HMAC-SHA256 of timestamp + "." + rawBody, keyed with webhookSecret.
X-Idempotency-KeyOptional. Up to 256 characters. See Duplicates.

Sign the exact bytes you send as the body. The body must be valid JSON and at most 65536 bytes.

const crypto = require("crypto");
const body = JSON.stringify({ event: "order.created" });
const timestamp = String(Math.floor(Date.now() / 1000));
const signature = "sha256=" + crypto
  .createHmac("sha256", webhookSecret)
  .update(`${timestamp}.${body}`)
  .digest("hex");
await fetch(`https://api.lincolncannon.co/trigger/hooks/${triggerId}`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-LCLLC-Timestamp": timestamp,
    "X-LCLLC-Signature": signature,
  },
  body,
});

Responses

StatusBodyWhen
202{ "ok": true, "accepted": true }The delivery was accepted and linked workflow and/or agent consumers are being started. Firing is asynchronous.
200{ "ok": true, "duplicate": true }A delivery you already sent was recognized (see Duplicates). Nothing was started again.
400{ "message": "..." }The signature was valid, but the request is not acceptable: Content-Type must be application/json or Invalid request body.
401{ "message": "Authorization required" }Missing or wrong signature headers, stale or future timestamp, or an unknown, disabled, or non-webhook trigger. These cases are intentionally indistinguishable.
413{ "message": "Payload too large" }Body over 65536 bytes.
429{ "message": "Too many requests" }Rate limit exceeded: 30 requests per minute and 500 per day, per trigger. Retry later with the same request.
500{ "message": "Internal error." }The trigger could not be started. The delivery is not recorded as a duplicate, so you may retry.

Duplicates

A delivery is a duplicate when it repeats an earlier delivery within about 24 hours: the same X-Idempotency-Key if you send one, otherwise the same timestamp and body. Duplicates return 200 and do not start consumers again (workflows or agents). Send a new X-Idempotency-Key (or a new timestamp) for each distinct event.

Payload handling

The request body is untrusted. For agent consumers it is appended to the agent's standing trigger-binding prompt as data only (not instructions; size-capped on the agent side). For workflow consumers the body is not passed into the run — a webhook delivery only starts the linked workflow runs (and agent consumers on the same fire). Do not put secrets or instructions you would not want a model to see in the body.

Routes

All paths are relative to the base URL.

Method / pathPurpose
GET /triggersList triggers (200, { "items": [...] })
POST /triggersCreate a trigger (201). A webhook trigger's response includes webhookSecret once.
GET /triggers/{triggerId}Read a trigger
PUT /triggers/{triggerId}Replace name and enabled, plus expression for schedule triggers. kind cannot change. The webhook secret is not changed here.
POST /triggers/{triggerId}/rotate-secretWebhook triggers only. Empty body. Returns a new webhookSecret once (200). The previous secret stops working immediately. Schedule triggers → 400. Removed during the call → 404. Another rotation finished first → 409 trigger changed; retry (no secret; call again).
DELETE /triggers/{triggerId}Delete the trigger, stop its schedule (schedule triggers), and unlink its consumers (200, { "deleted": true, "id": "..." })
GET /triggers/{triggerId}/consumersList consumers (200, { "items": [{ "kind", "id" }] })
PUT /triggers/{triggerId}/consumersReplace the full consumer set

POST https://…/trigger/hooks/{triggerId} is the webhook delivery route, authenticated by signature only (see Webhook triggers).

Trigger shape

{
  "id": "<trigger-uuid>",
  "kind": "schedule",
  "name": "Morning content review",
  "enabled": true,
  "expression": "cron(0 14 * * ? *)",
  "createdAt": "2027-01-01T00:00:00.000Z",
  "updatedAt": "2027-01-01T00:00:00.000Z"
}

A webhook trigger has "kind": "webhook" and no expression. webhookSecret never appears in this shape; it is only in the one-time create response and the one-time rotate-secret response.

Create a webhook trigger:

{
  "kind": "webhook",
  "name": "Order events",
  "enabled": true
}

Create / replace body

{
  "kind": "schedule",
  "name": "Morning content review",
  "expression": "cron(0 14 * * ? *)",
  "enabled": true
}
FieldRules
nameRequired. Up to 128 characters. No control characters.
expressionRequired for schedule triggers (see Schedule expressions). Not allowed for webhook triggers.
enabledOptional boolean. Defaults to true. false pauses firing without deleting the trigger.
kindOptional on create (schedule or webhook; defaults to schedule). On PUT, if sent, it must match the existing kind.

Unknown fields are rejected.

Consumers body

PUT /triggers/{triggerId}/consumers is a replace-set. Send the full desired set; consumers you omit are unlinked. Send an empty array to unlink all.

{
  "consumers": [
    { "kind": "workflow", "id": "<workflow-definition-uuid>" },
    { "kind": "agent", "id": "<agent-uuid>" }
  ]
}

Duplicate { kind, id } pairs are collapsed.

Errors

StatusWhen
400Invalid body or id. Examples: name is required, expression is required, expression is invalid, expression must be a cron(), rate(), or at() schedule expression, enabled must be a boolean, kind cannot be changed, expression is not allowed for webhook triggers, rotate-secret is only allowed for webhook triggers, consumers must be an array, consumer kind must be one of agent, workflow, consumer id is required, consumers must not exceed 16, triggerId is invalid
401Missing credentials, an invalid or expired Bearer token, or an unregistered API key
403Authenticated but not permitted for this account
404trigger was not found, or an unknown route
409trigger changed; retry — another webhook secret rotation finished first. Call rotate-secret again.
503Trigger temporarily unavailable — contact your integration contact.