Create Agent Trigger
POST
/v1/agents/{agentId}/triggersPOST
/v1/agents/{agentId}/triggersYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | Yes |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
tenantId | string | No | |
name | string | No | |
triggerType | string | No | |
cronExpression | string | No | |
cronTimezone | string | No | |
eventSourceAgentId | string | No | |
eventType | string | No | |
eventFilter | object | No | |
inputTemplate | string | No | |
maxRetries | integer | No | |
retryDelaySeconds | integer | No | |
timeoutSeconds | integer | No | |
maxConcurrent | integer | No |
Responses
200 Create a trigger for an agent
| Property | Type | Description |
|---|---|---|
trigger | object | |
webhookSecret | string | |
webhookUrl | string |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
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"
}
]
}
