Everstack
API ReferenceAgentsCreate Agent Trigger

Create Agent Trigger

POST/v1/agents/{agentId}/triggers
POST/v1/agents/{agentId}/triggers

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Parameters

NameInTypeRequiredDescription
agentIdpathstringYes

Request Body

PropertyTypeRequiredDescription
tenantIdstringNo
namestringNo
triggerTypestringNo
cronExpressionstringNo
cronTimezonestringNo
eventSourceAgentIdstringNo
eventTypestringNo
eventFilterobjectNo
inputTemplatestringNo
maxRetriesintegerNo
retryDelaySecondsintegerNo
timeoutSecondsintegerNo
maxConcurrentintegerNo

Responses

200 Create a trigger for an agent

PropertyTypeDescription
triggerobject
webhookSecretstring
webhookUrlstring

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/v1/agents/{agentId}/triggers" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tenantId":"string","name":"string","triggerType":"string","cronExpression":"string","cronTimezone":"string","eventSourceAgentId":"string","eventType":"string","inputTemplate":"string","maxRetries":0,"retryDelaySeconds":0,"timeoutSeconds":0,"maxConcurrent":0}'
const response = await fetch("http://localhost:8089/v1/agents/{agentId}/triggers", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "tenantId": "string",
  "name": "string",
  "triggerType": "string",
  "cronExpression": "string",
  "cronTimezone": "string",
  "eventSourceAgentId": "string",
  "eventType": "string",
  "inputTemplate": "string",
  "maxRetries": 0,
  "retryDelaySeconds": 0,
  "timeoutSeconds": 0,
  "maxConcurrent": 0
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/v1/agents/{agentId}/triggers",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "tenantId": "string",
  "name": "string",
  "triggerType": "string",
  "cronExpression": "string",
  "cronTimezone": "string",
  "eventSourceAgentId": "string",
  "eventType": "string",
  "inputTemplate": "string",
  "maxRetries": 0,
  "retryDelaySeconds": 0,
  "timeoutSeconds": 0,
  "maxConcurrent": 0
},
)
data = response.json()

Response

{
  "trigger": {
    "id": "string",
    "tenantId": "string",
    "agentId": "string",
    "name": "string",
    "triggerType": "string",
    "enabled": true,
    "cronExpression": "string",
    "cronTimezone": "string",
    "webhookPath": "string",
    "eventSourceAgentId": "string",
    "eventType": "string",
    "inputTemplate": "string",
    "maxRetries": 0,
    "timeoutSeconds": 0,
    "maxConcurrent": 0,
    "circuitState": "string",
    "consecutiveFailures": 0,
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z",
    "retryDelaySeconds": 0
  },
  "webhookSecret": "string",
  "webhookUrl": "string"
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}