create_agent_trigger
Create a trigger that dispatches the agent on an event. Pass exactly one event source: integration_id for a provider event (e.g. event_type…
Create a trigger that dispatches the agent on an event.
Pass exactly one event source: integration_id for a provider event (e.g.
event_type 'github.pull_request', 'shopify.orders/create', or
'stripe.invoice.payment_failed'; the prefix must match the integration's
provider), or runtime_id for an event a self-hosted runtime raises with
levain-runtime emit (free-form lowercase dot-separated event_type under
'runtime.', e.g. 'runtime.claude_code.stop').
event_filter narrows the event to the deliveries that matter: a JSON object of
dotted payload paths to a value or a list of values, all of which must match (a
list matches any of its entries; a path the payload lacks matches only null).
For example {"action": ["opened", "synchronize"], "pull_request.draft": true}
on 'github.pull_request', or
{"action": "completed", "workflow.name": "Deploy", "workflow_run.head_branch": "production"}
on 'github.workflow_run', which otherwise fires for every workflow run in the
installation (workflow.name is the workflow's name; workflow_run.name is the
run's title, which a workflow's run-name rewrites).
run_as=True makes the runs it starts act for you, with your person memory and rules, as a run you opened would; it is set only at creation and needs a signed-in user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
agent_id | string | yes | |
event_type | string | yes | |
integration_id | string | no | |
runtime_id | string | no | |
agent_version | integer | no | |
enabled | boolean | no | |
event_filter | object | no | |
run_as | boolean | no |
create_agent_slack_route
Route a Slack channel, or the app's direct messages, to an agent. kind is 'channel' (messages and mentions in slack_channel_id start a conversation with the…
create_agent_version
Fork a new draft version of an agent. Drafts are the only editable versions. Branches off the latest version unless ``parent_version`` says otherwise. For…