Skip to content
Codeberg

Adapter Schema

This is the complete field reference for adapter YAML files. For a narrative guide on how to use these fields, see Agent Adapters. For annotated production examples, see Example Adapters.

Adapters are validated against a JSON schema at agent startup. Typos and missing required fields fail immediately with precise error locations.


FieldTypeRequiredDescription
idstringNoOverride for the adapter ID. Defaults to the filename stem (e.g. donetick.yaml -> donetick). Pattern: [a-z0-9][a-z0-9_-]*. Becomes the {webhook_id} segment of the serving URL.
ownerstringYesTipOff user ID that owns this adapter. Becomes the {user_id} segment of the serving URL /webhooks/{user_id}/{webhook_id}.
id_fromstring[]NoDot-notation field paths used to generate stable notification IDs via SHA-256(field1 + "\x00" + field2 + ...). Produces gen_ prefixed IDs.
webhookobjectYesWebhook endpoint configuration. See Webhook.
actionsmap[string, Action]NoMap of action ID to action definition. See Action.
errorsobjectNoAdapter-level error notification handlers. See Error handlers.
varsmap[string, any]NoStatic data exposed to every expression as vars.*. Use for base URLs, user mappings, feature flags. Secrets should use $\{VAR\} directly, not through vars.

The webhook endpoint configuration. Serving URL: /webhooks/{owner}/{adapter_id}/*.

FieldTypeRequiredDescription
authobjectNoComposable authentication layers. See Auth. Zero layers = unsigned (logged as WARN).
fetchesFetch[]NoShared fetches run once per inbound event. Available to all notification entries as fetched.<name>. See Fetch.
notificationsNotification[]YesOne or more notification entries. At least one required. See Notification.
log_requestsstringNoWhen to include full request detail in structured logs. Enum: always, on_filter, on_error, never. Overrides the agent-wide TIPOFF_AGENT_LOG_REQUESTS default.

One entry in webhook.notifications[]. Two mutually exclusive modes:

  • Body mode (body + actions required): creates or updates a visible notification
  • Signal mode (signal required): sends a signal about an existing notification (e.g. "clear")
FieldTypeRequiredDescription
ifstringNoExpr expression returning bool. Entry fires only when true. Absent = always fires. Context: payload, vars, now.
idstringYesExpr expression returning a stable, non-empty string. Used for upsert (body mode) or to identify the target (signal mode). Context: payload, vars, now.
signalstringSignal modeSignal to send. Currently supported: "clear". Mutually exclusive with body/actions.
actionsstring[]Body modeAction IDs this notification exposes as buttons. Each must exist in the adapter’s actions map. Pattern per item: [a-z0-9][a-z0-9_]*.
fetchesFetch[]NoPer-entry fetches. Run only when this entry matches. Results are merged with webhook-level fetches. See Fetch.
letLetBinding[]NoComputed bindings evaluated after fetches, before body. See Let bindings.
bodystringBody modeExpr expression producing the notification object. Must NOT include category (injected by the agent). Context: payload, id, vars, fetched, now, plus any let bindings.

One entry in the actions map. Combines the button definition (title, traits, params) with the handler logic (fetches, let, request).

FieldTypeRequiredDescription
titlestringYesButton label displayed to the user. Never inherited via extends.
extendsstringNoAction ID of the base action to inherit from (same adapter). Inherits fetches, request, traits, let, on_error. Target must not itself extend. Pattern: [a-z0-9][a-z0-9_]*.
traitsstring[]NoSemantic traits for client rendering: confirm, destructive, auth_required, defer. Inherited via extends if not declared.
paramsmap[string, any]NoStatic parameters available as action.* in the request expression. Never inherited via extends.
fetchesFetch[]NoHTTP requests run before the request expression. Inherited via extends if not declared. See Fetch.
letLetBinding[]NoComputed bindings evaluated after fetches, before request. Merged by name when inherited via extends. See Let bindings.
requeststringYes*Expr expression producing {method, url, headers?, body?}. *Inherited via extends if not declared. Context: state, action, user, vars, fetched, now, plus any let bindings.
on_errorobjectNoPer-action error handler. Inherited via extends if not declared. See Error handlers.
  • title and params: never inherited — every action declares its own
  • fetches, request, traits, on_error: inherited if not declared on the extending action; declaring the field replaces the inherited value entirely
  • let: merged by name — matching names override in-place (same position in sequence), new names append at the end
  • Chains forbidden: the target must not itself use extends
  • Same adapter: the target must exist in the same adapter file

Ordered list of named computed values. Each binding is evaluated sequentially — later bindings can reference earlier ones. Bound names are available as bare identifiers in the body or request expression.

FieldTypeRequiredDescription
namestringYesBinding name. Must be a valid identifier ([a-zA-Z_][a-zA-Z0-9_]*). Must not shadow built-in names. Must be unique within the block.
exprstringYesExpr expression whose result is bound to the name.

Names that cannot be used as let binding names:

ContextReserved
Notificationpayload, id, vars, fetched, now
Actionstate, action, user, vars, fetched, now
  • Forward references rejected: a binding can only reference names defined above it in the sequence
  • Duplicates rejected: each name must be unique within a single let block
  • Reserved names rejected: binding names matching built-in environment variables are rejected
  • All validation happens at adapter load time (agent startup), not at webhook delivery time

HTTP request run before expression evaluation. Available at webhook level (shared), per-notification, and per-action.

FieldTypeRequiredDescription
namestringYesIdentifier for the result. Available as fetched.<name> in expressions. Pattern: [a-zA-Z_][a-zA-Z0-9_]*.
methodstringYesHTTP method. Enum: GET, POST, PUT, PATCH, DELETE.
urlstringYesURL with optional {{ expr }} interpolation.
headersmap[string, string]NoHeader values with optional {{ expr }} interpolation.
optionalbooleanNoDefault: false. When true, a failed fetch binds fetched.<name> to nil and continues. When false, a failed fetch aborts the pipeline.

Each fetched.<name> entry has the following shape at runtime:

FieldTypeDescription
statusintHTTP status code
headersmap[string, string]Response headers
dataanyParsed JSON response body
rawstringRaw response body

Composable webhook authentication. At least one auth layer is required. Three independently optional layers — all present layers must pass.

If your webhook source cannot provide authentication, explicitly opt in with unsigned: true:

FieldTypeRequiredDescription
unsignedbooleanNoSet to true to accept unsigned webhooks. Adapters without any auth layer will fail to load unless this is set.

Shared secret via header or URL path. Exactly one of header or path must be set.

FieldTypeRequiredDescription
headerstringXOR with pathHTTP header name containing the secret.
pathbooleanXOR with headerWhen true, the trailing URL segment is the secret.
secretstringYesExpected secret value. Typically $\{VAR\}.

HMAC message integrity verification.

FieldTypeRequiredDescription
algorithmstringYesSigning algorithm. Currently only hmac-sha256.
headerstringYesHeader containing the signature.
secretstringYesHMAC key.

Freshness check via timestamp.

FieldTypeRequiredDescription
modestringYesCurrently only timestamp.
headerstringYes (when mode=timestamp)Header containing the timestamp.
tolerancestringYes (when mode=timestamp)Go duration string (e.g. "300s", "5m").

Optional error notification handlers defined at adapter level (errors.webhook, errors.action) or per-action (on_error). The agent injects category: agent_error automatically.

FieldTypeRequiredDescription
fetchesFetch[]NoAdditional fetches to run on error.
bodystringYesExpr expression producing the error notification object.
VariableTypeDescription
error.phasestringWhere the failure occurred: auth, parse, id, fetch, expr, schema, call
error.messagestringError message
error.stepanyPhase-specific detail (e.g. HTTP status code for call)
adapterstringAdapter ID
payloadmapWebhook payload (may be nil for action errors)
statemapAction state (may be nil for webhook errors)
actionmapAction metadata (action errors only)
userstringTipOff user ID (action errors only)
varsmapAdapter vars
fetchedmapFetch results available at the point of failure
nowTimeCurrent time

Quick reference for which variables are available in each expression context.

Variableif / idbodyrequestError handlers
payloadyesyes-yes (may be nil)
id-yes-yes
varsyesyesyesyes
fetched-yesyesyes
nowyesyesyesyes
state--yesyes (may be nil)
action--yesyes (may be nil)
user--yesyes (action only)
error---yes
adapter---yes
let bindings-yesyes-