Levain LabsLevain Labs
API ReferenceAgents

Create Agent Trigger

Create a trigger that dispatches the agent on an event.

The integration must belong to the same workspace as the agent and be in the active state. If a trigger already exists for this agent, integration, and event combination, returns 409. Use PATCH /api/v1/triggers/{trigger_id} to update the existing trigger instead.

POST
/api/v1/agents/{agent_id}/triggers

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_id*Agent Id

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/agents/string/triggers" \  -H "Content-Type: application/json" \  -d '{    "integration_id": "55d7337e-1d0a-49fc-9826-925ba40df035",    "event_type": "string"  }'
{
  "id": "string",
  "agent_id": "string",
  "integration_id": "string",
  "integration_provider": "string",
  "integration_display_name": "string",
  "event_type": "string",
  "enabled": true,
  "agent_version": 0,
  "created_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}