Skip to main content
POST
/
triggers
Create Trigger
curl --request POST \
  --url https://api.example.com/triggers/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_resource_id": "<string>",
  "runner_resource_id": "<string>",
  "trigger_type": "event",
  "target_organization_id": "<string>",
  "event_filters": [
    {
      "provider": "<string>",
      "resource_type": "<string>",
      "event_type": "<string>",
      "resource_name": "<string>"
    }
  ],
  "cron_expression": "<string>",
  "is_main_agent": false,
  "enabled": true
}
'
{
  "organization_id": "<string>",
  "agent_resource_id": "<string>",
  "runner_resource_id": "<string>",
  "trigger_type": "event",
  "id": "<string>",
  "target_organization_id": "<string>",
  "event_filters": [
    {
      "provider": "<string>",
      "resource_type": "<string>",
      "event_type": "<string>",
      "resource_name": "<string>"
    }
  ],
  "cron_expression": "<string>",
  "is_main_agent": false,
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Body

application/json

Request body for creating an agent trigger.

Attributes: agent_resource_id: SurrealDB ID of the agno agent resource. runner_resource_id: SurrealDB ID of the agno runner resource. trigger_type: How this trigger fires. target_organization_id: Organization whose events this trigger watches. When set, the trigger fires on events from this org but the agent resource lives in the authenticated org. When None, watches own org. event_filters: Filters for matching lifecycle events (event triggers only). cron_expression: Cron schedule expression (schedule triggers only). is_main_agent: Whether this is the org's main conversation agent. enabled: Whether the trigger starts active.

agent_resource_id
string
required
runner_resource_id
string
required
trigger_type
enum<string>
required

Types of agent triggers.

Available options:
event,
schedule,
conversation
target_organization_id
string | null
event_filters
EventFilter · object[] | null
cron_expression
string | null
is_main_agent
boolean
default:false
enabled
boolean
default:true

Response

Successful Response

Configuration for triggering an agent via events, schedules, or conversations.

Attributes: id: SurrealDB record ID (populated by database). organization_id: Tenant that owns the trigger and the agent resource. target_organization_id: Organization whose events this trigger watches. When set, the trigger fires on events from this org but the agent resource lives in organization_id. When None, watches organization_id. agent_resource_id: SurrealDB ID of the agno agent resource. runner_resource_id: SurrealDB ID of the agno runner resource. trigger_type: How this trigger fires. event_filters: Filters for matching lifecycle events (event triggers only). cron_expression: Cron schedule expression (schedule triggers only). is_main_agent: Whether this is the org's main conversation agent. enabled: Whether the trigger is active. created_at: When the trigger was created. updated_at: When the trigger was last modified.

organization_id
string
required
agent_resource_id
string
required
runner_resource_id
string
required
trigger_type
enum<string>
required

Types of agent triggers.

Available options:
event,
schedule,
conversation
id
string | null
target_organization_id
string | null
event_filters
EventFilter · object[] | null
cron_expression
string | null
is_main_agent
boolean
default:false
enabled
boolean
default:true
created_at
string<date-time>
updated_at
string<date-time>