Webhooks
ModelsExpand Collapse
unsafe_unwrap_webhook_event: object { data, timestamp, type }
The envelope for an objective event webhook delivery. Contains timestamp, event type, and the webhook data payload.
data: object { agent, agentVariation, objective, objectiveEvent }
The webhook data payload with flat top-level keys for agent, variation, objective, and event.
agent: object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
agentVariation: object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
objective: object { id, accountId, createdAt, 4 more }
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
objectiveEvent: object { data, metadata, contextWindowId, info }
data: object { assistantMessage, cancelled, contextWindowCompacted, 13 more }
assistantMessage: optional object { content, toolCalls }
tool: optional object { agent, cadenyaProvidedTool, tool }
CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides).
agent: optional object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
cadenyaProvidedTool: optional object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
tool: optional object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
cancelled: optional object { message }
ObjectiveCancelled is the terminal event written when an objective is cancelled. After this event, the objective is super-terminal: no further iterations, compaction, or continuation are permitted.
contextWindowCompacted: optional object { messagesCompacted, newContextWindow, strategies, summary }
newContextWindow: optional object { completionTokens, objectiveId, previousWindowContinueInstructions, 2 more }
The new context window created by this compaction
completionTokens: optional number
A calculated value for how many completion tokens (output tokens) have been used in this context window
previousWindowContinueInstructions: optional string
The instructions for this window to continue from a previous window’s chat history.
finalized: optional object { output }
ObjectiveFinalized is the terminal event written when an objective is finalized. After this event, the objective is super-terminal: no further iterations, compaction, or continuation are permitted.
memoryRead: optional object { memoryEntryId, memoryLayerId, message }
MemoryRead is emitted each time the agent resolves a key against the memory stack and loads an entry. Lookups that miss (key not found in any layer) do not emit this event.
subAgentSpawned: optional object { agent, objective, task }
agent: optional object { id, accountId, createdAt, 6 more }
Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
name: string
Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly
bundleKey: optional string
Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
objective: optional object { id, accountId, createdAt, 4 more }
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
subAgentUpdated: optional object { agent, message, objective, status }
agent: optional object { id, name }
BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.
objective: optional object { id, name }
BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.
metadata: object { id, accountId, createdAt, 4 more }
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
info: optional object { createdBy, objective }
createdBy: optional object { metadata, spec }
A profile identifies a user or non-human principal (such as an API key) at the account level. Profiles are account-scoped and can be granted access to multiple workspaces.
metadata: object { id, accountId, name, 3 more }
AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.
objective: optional object { id, accountId, createdAt, 4 more }
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)