Triggers
Event → condition → action automations: assign, tag, move stage or notify without a person doing it by hand.
Download the full API pública projection: openapi.json.
Set SLAs and automate actions explains this resource in prose, with runnable examples.
| Method | Path | What it does |
|---|---|---|
GET | /triggers | List automation triggers |
POST | /triggers | Create an automation trigger |
DELETE | /triggers/{id} | Delete an automation trigger |
GET | /triggers/{id} | Fetch one automation trigger |
PUT | /triggers/{id} | Update an automation trigger |
GET /triggers
List automation triggers
Every trigger in the workspace, enabled and disabled alike, with its run_count and last_run_at.
curl https://api.vitrinadev.com/api/v1/triggers \
-H "Authorization: Bearer $VITRINA_KEY"Example response (200)
{
"data": [
{
"id": "d8d8d8d8-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Avisar si nadie responde en 2 horas",
"description": "Asigna al equipo de guardia cuando una conversación queda inactiva.",
"event": "conversation_idle",
"conditions": {
"logic": "all",
"items": [
{
"id": "c1",
"field": "channel",
"op": "eq",
"value": "whatsapp"
}
]
},
"actions": [
{
"id": "a1",
"type": "assign_team",
"value": "cccccccc-0000-4000-8000-000000000001"
}
],
"enabled": true,
"fire_once_per_conversation": true,
"stop_after_run": false,
"duration_hours": 2,
"run_count": 18,
"last_run_at": "2026-09-15T18:20:00.000Z",
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
],
"meta": {
"total": 1
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
POST /triggers
Create an automation trigger
Each condition’s op must fit its field’s type — an operator that does not belong to that field is a 400 naming it. event: "conversation_idle" requires duration_hours (1–720); every other event ignores it. enabled defaults to true.
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | mín. 1, máx. 200 |
description | string | null | — | máx. 2000 |
event | conversation_created \ | message_from_customer \ | conversation_resolved \ |
conditions | object | — | |
actions | object[] | — | |
enabled | boolean | — | |
fire_once_per_conversation | boolean | — | |
stop_after_run | boolean | — | |
duration_hours | integer | null | — | ≥ 1, ≤ 720 |
curl -X POST https://api.vitrinadev.com/api/v1/triggers \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Avisar si nadie responde en 2 horas",
"event": "conversation_idle",
"duration_hours": 2,
"actions": [
{
"id": "a1",
"type": "assign_team",
"value": "cccccccc-0000-4000-8000-000000000001"
}
]
}'Example response (201)
{
"data": {
"id": "d8d8d8d8-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Avisar si nadie responde en 2 horas",
"description": "Asigna al equipo de guardia cuando una conversación queda inactiva.",
"event": "conversation_idle",
"conditions": {
"logic": "all",
"items": [
{
"id": "c1",
"field": "channel",
"op": "eq",
"value": "whatsapp"
}
]
},
"actions": [
{
"id": "a1",
"type": "assign_team",
"value": "cccccccc-0000-4000-8000-000000000001"
}
],
"enabled": true,
"fire_once_per_conversation": true,
"stop_after_run": false,
"duration_hours": 2,
"run_count": 18,
"last_run_at": "2026-09-15T18:20:00.000Z",
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 201 · 400 · 401 · 403 · 404 · 409 · 429
DELETE /triggers/{id}
Delete an automation trigger
Stops it from firing again; past runs are not undone.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
curl -X DELETE https://api.vitrinadev.com/api/v1/triggers/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Answers: 204 · 400 · 401 · 403 · 404 · 409 · 429
GET /triggers/{id}
Fetch one automation trigger
The full trigger, including its conditions tree and ordered actions list, plus run_count and last_run_at.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
curl https://api.vitrinadev.com/api/v1/triggers/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Example response (200)
{
"data": {
"id": "d8d8d8d8-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Avisar si nadie responde en 2 horas",
"description": "Asigna al equipo de guardia cuando una conversación queda inactiva.",
"event": "conversation_idle",
"conditions": {
"logic": "all",
"items": [
{
"id": "c1",
"field": "channel",
"op": "eq",
"value": "whatsapp"
}
]
},
"actions": [
{
"id": "a1",
"type": "assign_team",
"value": "cccccccc-0000-4000-8000-000000000001"
}
],
"enabled": true,
"fire_once_per_conversation": true,
"stop_after_run": false,
"duration_hours": 2,
"run_count": 18,
"last_run_at": "2026-09-15T18:20:00.000Z",
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
PUT /triggers/{id}
Update an automation trigger
A PUT that behaves as a PATCH: only the fields present are applied and at least one is required. conditions and actions are each replaced wholesale when sent.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | — | mín. 1, máx. 200 |
description | string | null | — | máx. 2000 |
event | conversation_created \ | message_from_customer \ | conversation_resolved \ |
conditions | object | — | |
actions | object[] | — | |
enabled | boolean | — | |
fire_once_per_conversation | boolean | — | |
stop_after_run | boolean | — | |
duration_hours | integer | null | — | ≥ 1, ≤ 720 |
curl -X PUT https://api.vitrinadev.com/api/v1/triggers/<id> \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'Example response (200)
{
"data": {
"id": "d8d8d8d8-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Avisar si nadie responde en 2 horas",
"description": "Asigna al equipo de guardia cuando una conversación queda inactiva.",
"event": "conversation_idle",
"conditions": {
"logic": "all",
"items": [
{
"id": "c1",
"field": "channel",
"op": "eq",
"value": "whatsapp"
}
]
},
"actions": [
{
"id": "a1",
"type": "assign_team",
"value": "cccccccc-0000-4000-8000-000000000001"
}
],
"enabled": false,
"fire_once_per_conversation": true,
"stop_after_run": false,
"duration_hours": 2,
"run_count": 18,
"last_run_at": "2026-09-15T18:20:00.000Z",
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429