# Event catalog

Current API version: `2026-10-29`. Subscribe an endpoint to these types, or to `*` for all of them. `GET /v2/event-types` returns the same catalog.

| Type | When it fires |
| --- | --- |
| [`case.escalated`](#caseescalated) | An agent handed a case over to a person. Carries the contact, the reason and the last 20 messages. |
| [`case.closed`](#caseclosed) | A case was closed: by the inactivity sweep, by entering a closing stage, by the agent ending the conversation or by POST /v2/cases/{id}/close. It fires once per case that really changed, after the closing is saved. reason is the closing reason saved in the case (for example inactividad, inactividad_despedida, seguimiento_agotado or the reason of the stage) and is null when none was set. closedBy tells who closed it: system (sweeps and automatic flows), stage, agent, api or user (a person in the dashboard). Read or complete the case with GET and PATCH /v2/cases/{id}. |
| [`case.stage_entered`](#casestage_entered) | A case entered a stage of its pipeline. |
| [`message.created`](#messagecreated) | Any new message of a case: the contact, the agent, your team or an internal note. It includes the replies of the agent, so you do not need to poll. Files are not included: read them with GET /v2/cases/{id}/messages. |
| [`case.control_changed`](#casecontrol_changed) | A person took over a case, or the agent got it back, or the agent escalated it (escalated true). |
| [`message.received`](#messagereceived) | A person wrote to the organization. Carries no text, only where to read it. A cart sent from the WhatsApp catalog arrives with type order and its products; a tap on a button or list row arrives with type reply and the id and title tapped. A shared location arrives with type location, the answer of a WhatsApp Flow with type flow_response and a phone shared in answer to a contact_request with type contact: those three carry no data, because they are the personal data of the person. Read the note of the cart, the location, the Flow fields or the phone with GET /v2/cases/{id}/messages. |
| [`message.human_sent`](#messagehuman_sent) | A person of the team, or an integration, wrote to the contact. |
| [`message.agent_sent`](#messageagent_sent) | An agent wrote first to the contact because a trigger fired. |
| [`case.agent_failed`](#caseagent_failed) | The agent could not answer a message you sent with author contact. The message stays in the case. code budget_exceeded means the monthly budget ran out: stop writing until it resets or you raise the limit. Otherwise write again or take control of the case. requestId is the Request-Id of your POST. |
| [`case.turn_completed`](#caseturn_completed) | The agent finished a turn in a case. One turn can write several messages, so use this to know it is done instead of polling. Read what happened with GET /v2/cases/{id}/turns. It fires for completed, incomplete and failed turns. |
| [`budget.threshold_reached`](#budgetthreshold_reached) | The conversations used in a monthly budget reached its alert percent. It fires once per month and budget, and again after you raise the limit and reach the new threshold. |
| [`budget.exceeded`](#budgetexceeded) | A monthly budget with enforcement stop ran out and the agent stopped. It fires once per month and budget. Raise the limit with PATCH /v2/budgets/{id} to resume at once. |
| [`mcp_server.failed`](#mcp_serverfailed) | An MCP server rejected the credential of a tool call (expired or revoked token) and was marked as failed. Reconnect it before your customers notice. |
| [`message.status_changed`](#messagestatus_changed) | A WhatsApp template message moved to another status: sent, delivered, read, skipped or canceled. Failures arrive as message.failed. |
| [`message.failed`](#messagefailed) | A WhatsApp template message could not be delivered. message.failure.code says why. |
| [`contact.opted_out`](#contactopted_out) | A contact stopped receiving messages on a channel, by their own request or by yours. Nothing more is sent to them there. |
| [`contact.suppressed`](#contactsuppressed) | The erasure of a contact finished: its cases, messages, files and logs lost their content in our systems. Carries ids only. Erase the same person from every system where you copied them. |
| [`message.redacted`](#messageredacted) | A message was redacted: its text, file and copies were erased. Carries ids only. Redact the same message in every system where you copied it. |
| [`approval.requested`](#approvalrequested) | An agent asked to run an action that its tool policy puts behind a person. Nothing ran. Decide it with POST /v2/approvals/{id}/approve or /reject before approval.expiresAt. |
| [`approval.decided`](#approvaldecided) | An approval was approved or rejected. approval.decision says by whom (a member or an API key) and why. When it was approved the action runs right after: follow approval.status. |
| [`approval.expired`](#approvalexpired) | Nobody decided in time, so the action never ran and the agent told the person. Ask the agent again if it still applies. |
| [`approval.escalated`](#approvalescalated) | A pending approval passed the time its policy gives before escalating (escalateAfterMinutes). Nothing changed in the approval: remind or reassign in your system before it expires. Fires once per approval. |
| [`approval.canceled`](#approvalcanceled) | A pending approval was canceled because the person it is about asked to be erased. Nothing ran and it cannot be decided any more. Drop it from your queue. The approval no longer carries the arguments or the summary. |
| [`approval.review_requested`](#approvalreview_requested) | The person affected by an automated decision that went through an approval asked for a human review (Ley 21.719, art. 8 bis). Carries the reason they gave, also stored in approval.reviewReason. Review the decision and respond to the person in your system. |
| [`automated_decision.review_requested`](#automated_decisionreview_requested) | The person affected by an automated decision that no one approved asked for a human review (Ley 21.719, art. 8 bis). Carries the reason they gave, also stored in automatedDecision.reviewReason. Review the decision and respond to the person in your system. |
| [`team_question.created`](#team_questioncreated) | An agent left a question for the team and keeps attending. Answer it with POST /v2/team-questions/{id}/answer; the agent resumes and tells the person. |
| [`team_question.answered`](#team_questionanswered) | A team question received its answer. The agent is about to tell the person. status moves to delivered once it did. |
| [`meeting.scheduled`](#meetingscheduled) | A meeting was booked in an agenda, by this API, the dashboard or an agent. The attendee already got the invitation. Read it with GET /v2/scheduling/meetings/{id}. |
| [`meeting.rescheduled`](#meetingrescheduled) | A meeting moved to another slot. meeting.start and meeting.end are the new ones; the attendee was told by the calendar. |
| [`meeting.canceled`](#meetingcanceled) | A meeting was canceled and its slot is free again. meeting.cancelReason says why when there is one. |
| [`template.status_changed`](#templatestatus_changed) | WhatsApp reviewed a template, or paused it. rejectionReason says why when it was rejected. |
| [`campaign.status_changed`](#campaignstatus_changed) | A campaign started, paused, resumed, completed or was canceled. pauseReason says why it paused by itself, if it did. |
| [`trigger.attempted`](#triggerattempted) | An attempt of a trigger cadence ran, or the cadence ended. result is sent when a template message was queued, skipped when the attempt could not go out (reason says why and the cadence ends), or stopped when the contact replied, opted out, or the case changed stage or closed (reason says which). Fires once per attempt, and once more when a cadence is stopped. |
| [`copilot.turn`](#copilotturn) | Progress of a copilot turn: its status, or one of its steps. `kind` tells which. |
| [`run.started`](#runstarted) | A worker picked up a run and the agent started working on it. It carries the run. It is sent at least once, so a run that a worker lost halfway can announce it again. |
| [`run.waiting_for_answer`](#runwaiting_for_answer) | The agent paused the run to ask a person. run.question has the question; answer it with POST /v2/runs/{id}/answer and the run resumes. A run nobody answers within 30 days ends failed with stopReason abandoned. |
| [`run.completed`](#runcompleted) | The agent declared the job done. run.status is completed_unverified: nobody has checked it yet, so read run.result.summary and run.result.checks before you trust it. |
| [`run.stopped`](#runstopped) | The run was cut before the agent declared the job done. run.stopReason says why (rounds, time or cost: a limit ran out; no_conclusion: the agent never called its finish action; loop: the agent repeated itself) and run.result.partial keeps the last thing the agent wrote. |
| [`run.failed`](#runfailed) | The run ended with an error, or nobody answered its question in 30 days (stopReason abandoned). run.result.error says what happened. |
| [`run.canceled`](#runcanceled) | The run was canceled: nothing else will run. |
| [`schedule.fired`](#schedulefired) | A scheduled task reached its date and started a run. It carries the schedule and the run. A date the service missed is not replayed: the task fires once and moves to its next date. |
| [`schedule.skipped`](#scheduleskipped) | A scheduled task reached its date and did not start a run. reason says why: opted_out (the contact opted out of email), recipient_not_allowed (the contact is not in the recipient allowlist), agent_unavailable (the agent is paused, deleted or has no email channel) or contact_unavailable (the contact no longer exists or has no email). The task keeps its schedule and fires on its next date. |
| [`schedule.paused`](#schedulepaused) | A scheduled task was paused by the platform after three runs in a row that failed or were cut. reason is consecutive_failures. Fix the cause and turn it on again with PATCH /v2/schedules/{id} and enabled true. |
| [`knowledge_document.ready`](#knowledge_documentready) | A document finished processing and the agents that have its collection can search it. |
| [`knowledge_document.failed`](#knowledge_documentfailed) | A document could not be processed. document.error.code says why. The collection keeps working; upload the document again to retry. |
| [`phone_number.connected`](#phone_numberconnected) | A subaccount linked its WhatsApp number and its agent started answering on it. |
| [`phone_number.connection_failed`](#phone_numberconnection_failed) | The number linked is not the one requested, or it belongs to another account. Nothing was attached; connection.failure.code says why. |
| [`phone_number.disconnected`](#phone_numberdisconnected) | A WhatsApp number was disconnected, by you or by the provider. Its agent no longer answers on it. |
| [`webhook_endpoint.test`](#webhook_endpointtest) | Sent by POST /v2/webhook-endpoints/{id}/test to check that an endpoint receives and verifies events. |

## case.escalated

An agent handed a case over to a person. Carries the contact, the reason and the last 20 messages.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "channel": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "pipelineId",
        "channel"
      ]
    },
    "contact": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "ctc_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "externalRef": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "phone",
        "email",
        "externalRef"
      ]
    },
    "escalation": {
      "type": "object",
      "properties": {
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "type": [
            "string",
            "null"
          ]
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "reason",
        "priority",
        "summary"
      ]
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "role",
          "content",
          "createdAt"
        ]
      }
    }
  },
  "required": [
    "case",
    "contact",
    "escalation",
    "history"
  ]
}
```


## case.closed

A case was closed: by the inactivity sweep, by entering a closing stage, by the agent ending the conversation or by POST /v2/cases/{id}/close. It fires once per case that really changed, after the closing is saved. reason is the closing reason saved in the case (for example inactividad, inactividad_despedida, seguimiento_agotado or the reason of the stage) and is null when none was set. closedBy tells who closed it: system (sweeps and automatic flows), stage, agent, api or user (a person in the dashboard). Read or complete the case with GET and PATCH /v2/cases/{id}.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        }
      },
      "required": [
        "id",
        "pipelineId"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "closed"
      ]
    },
    "closedBy": {
      "type": "string",
      "enum": [
        "system",
        "stage",
        "agent",
        "api",
        "user"
      ]
    },
    "closedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "case",
    "reason",
    "status",
    "closedBy",
    "closedAt"
  ]
}
```


## case.stage_entered

A case entered a stage of its pipeline.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "pipelineName": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "pipelineId",
        "pipelineName"
      ]
    },
    "stage": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "stg_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "slug"
      ]
    },
    "previousStage": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "example": "stg_3PqA0x8bVw1TqS9mYp3RkL"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "name"
          ]
        }
      ]
    },
    "recipient": {
      "type": "object",
      "properties": {
        "externalSource": {
          "type": [
            "string",
            "null"
          ]
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "externalSource",
        "externalId"
      ]
    },
    "enteredAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "case",
    "stage",
    "previousStage",
    "recipient",
    "enteredAt"
  ]
}
```


## message.created

Any new message of a case: the contact, the agent, your team or an internal note. It includes the replies of the agent, so you do not need to poll. Files are not included: read them with GET /v2/cases/{id}/messages.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "message"
      ]
    },
    "id": {
      "type": "string",
      "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "caseId": {
      "type": "string",
      "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
    },
    "pipelineId": {
      "type": "string",
      "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "author": {
      "type": "string",
      "enum": [
        "contact",
        "agent",
        "team"
      ]
    },
    "authorName": {
      "type": [
        "string",
        "null"
      ]
    },
    "visibility": {
      "type": "string",
      "enum": [
        "public",
        "internal"
      ]
    },
    "text": {
      "type": "string"
    },
    "contentType": {
      "type": "string"
    },
    "hasAttachment": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "object",
    "id",
    "caseId",
    "pipelineId",
    "author",
    "authorName",
    "visibility",
    "text",
    "contentType",
    "hasAttachment",
    "createdAt"
  ]
}
```


## case.control_changed

A person took over a case, or the agent got it back, or the agent escalated it (escalated true).

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "stageId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "pipelineId",
        "stageId"
      ]
    },
    "control": {
      "type": "string",
      "enum": [
        "agent",
        "human"
      ]
    },
    "escalated": {
      "type": "boolean"
    },
    "controlledBy": {
      "type": [
        "string",
        "null"
      ]
    },
    "contactId": {
      "type": [
        "string",
        "null"
      ]
    },
    "externalRef": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "case",
    "control",
    "escalated",
    "controlledBy",
    "contactId",
    "externalRef"
  ]
}
```


## message.received

A person wrote to the organization. Carries no text, only where to read it. A cart sent from the WhatsApp catalog arrives with type order and its products; a tap on a button or list row arrives with type reply and the id and title tapped. A shared location arrives with type location, the answer of a WhatsApp Flow with type flow_response and a phone shared in answer to a contact_request with type contact: those three carry no data, because they are the personal data of the person. Read the note of the cart, the location, the Flow fields or the phone with GET /v2/cases/{id}/messages.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "stageId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "pipelineId",
        "stageId"
      ]
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "channel": {
          "type": [
            "string",
            "null"
          ]
        },
        "contentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "description": "order when the person sent a cart from the catalog, reply when they tapped a button or a list row, location when they shared a location, flow_response when they finished a WhatsApp Flow, contact when they shared their phone, otherwise the content type."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "reply": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "order": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "catalogId": {
                  "type": "string"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "quantity": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "price": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "currency": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "productId",
                      "quantity",
                      "price",
                      "currency"
                    ]
                  }
                }
              },
              "required": [
                "catalogId",
                "items"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "channel",
        "contentType",
        "type",
        "createdAt",
        "reply",
        "order"
      ]
    }
  },
  "required": [
    "case",
    "message"
  ]
}
```


## message.human_sent

A person of the team, or an integration, wrote to the contact.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": [
            "string",
            "null"
          ]
        },
        "channel": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "pipelineId",
        "channel"
      ]
    },
    "recipient": {
      "type": "object",
      "properties": {
        "externalSource": {
          "type": [
            "string",
            "null"
          ]
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "externalSource",
        "externalId"
      ]
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "sequenceNumber": {
          "type": [
            "integer",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "senderName": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasFile": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "sequenceNumber",
        "createdAt",
        "senderName",
        "hasFile"
      ]
    }
  },
  "required": [
    "case",
    "recipient",
    "message"
  ]
}
```


## message.agent_sent

An agent wrote first to the contact because a trigger fired.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "agent"
      ]
    },
    "openPanel": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        }
      },
      "required": [
        "id",
        "pipelineId"
      ]
    },
    "recipient": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "externalId"
      ]
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
        }
      },
      "required": [
        "id"
      ]
    },
    "trigger": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "event": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "event"
      ]
    }
  },
  "required": [
    "kind",
    "openPanel",
    "case",
    "recipient",
    "message",
    "trigger"
  ]
}
```


## case.agent_failed

The agent could not answer a message you sent with author contact. The message stays in the case. code budget_exceeded means the monthly budget ran out: stop writing until it resets or you raise the limit. Otherwise write again or take control of the case. requestId is the Request-Id of your POST.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "pipelineId": {
          "type": "string",
          "example": "ppl_3PqA0x8bVw1TqS9mYp3RkL"
        }
      },
      "required": [
        "id",
        "pipelineId"
      ]
    },
    "messageId": {
      "type": "string",
      "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "code": {
      "type": "string",
      "enum": [
        "agent_error",
        "budget_exceeded"
      ]
    },
    "requestId": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "case",
    "messageId",
    "code",
    "requestId"
  ]
}
```


## case.turn_completed

The agent finished a turn in a case. One turn can write several messages, so use this to know it is done instead of polling. Read what happened with GET /v2/cases/{id}/turns. It fires for completed, incomplete and failed turns.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "case": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        }
      },
      "required": [
        "id"
      ]
    },
    "turnId": {
      "type": "string",
      "example": "trn_7Hc2LmQ0x8bVw1TqS9mYp3"
    },
    "agentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "completed",
        "incomplete",
        "failed"
      ]
    },
    "model": {
      "type": [
        "string",
        "null"
      ]
    },
    "tokens": {
      "type": "object",
      "properties": {
        "input": {
          "type": "integer"
        },
        "output": {
          "type": "integer"
        }
      },
      "required": [
        "input",
        "output"
      ]
    },
    "toolCalls": {
      "type": "integer"
    }
  },
  "required": [
    "case",
    "turnId",
    "agentId",
    "status",
    "model",
    "tokens",
    "toolCalls"
  ]
}
```


## budget.threshold_reached

The conversations used in a monthly budget reached its alert percent. It fires once per month and budget, and again after you raise the limit and reach the new threshold.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "budget": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "bgt_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "scope": {
          "type": "string",
          "enum": [
            "organization",
            "subaccount",
            "agent",
            "contact"
          ]
        },
        "subjectId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "scope",
        "subjectId"
      ]
    },
    "alertPercent": {
      "type": "integer"
    },
    "monthlyLimitConversations": {
      "type": "integer"
    },
    "usedConversations": {
      "type": "integer"
    },
    "resetsAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "budget",
    "alertPercent",
    "monthlyLimitConversations",
    "usedConversations",
    "resetsAt"
  ]
}
```


## budget.exceeded

A monthly budget with enforcement stop ran out and the agent stopped. It fires once per month and budget. Raise the limit with PATCH /v2/budgets/{id} to resume at once.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "budget": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "bgt_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "scope": {
          "type": "string",
          "enum": [
            "organization",
            "subaccount",
            "agent",
            "contact"
          ]
        },
        "subjectId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "scope",
        "subjectId"
      ]
    },
    "monthlyLimitConversations": {
      "type": "integer"
    },
    "usedConversations": {
      "type": "integer"
    },
    "resetsAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "budget",
    "monthlyLimitConversations",
    "usedConversations",
    "resetsAt"
  ]
}
```


## mcp_server.failed

An MCP server rejected the credential of a tool call (expired or revoked token) and was marked as failed. Reconnect it before your customers notice.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "mcpServer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "mcp_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ]
    },
    "reason": {
      "type": "string",
      "enum": [
        "unauthorized"
      ]
    }
  },
  "required": [
    "mcpServer",
    "reason"
  ]
}
```


## message.status_changed

A WhatsApp template message moved to another status: sent, delivered, read, skipped or canceled. Failures arrive as message.failed.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "message": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "whatsapp_message"
          ]
        },
        "id": {
          "type": "string",
          "example": "wam_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "scheduled",
            "sending",
            "sent",
            "delivered",
            "read",
            "failed",
            "skipped",
            "canceled"
          ]
        },
        "templateId": {
          "type": [
            "string",
            "null"
          ]
        },
        "contactId": {
          "type": [
            "string",
            "null"
          ]
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "sendAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "skipReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "failure": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "templateId",
        "contactId",
        "caseId",
        "sendAt",
        "skipReason",
        "failure",
        "createdAt"
      ]
    },
    "previousStatus": {
      "type": "string",
      "enum": [
        "queued",
        "scheduled",
        "sending",
        "sent",
        "delivered",
        "read",
        "failed",
        "skipped",
        "canceled"
      ]
    }
  },
  "required": [
    "message",
    "previousStatus"
  ]
}
```


## message.failed

A WhatsApp template message could not be delivered. message.failure.code says why.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "message": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "whatsapp_message"
          ]
        },
        "id": {
          "type": "string",
          "example": "wam_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "scheduled",
            "sending",
            "sent",
            "delivered",
            "read",
            "failed",
            "skipped",
            "canceled"
          ]
        },
        "templateId": {
          "type": [
            "string",
            "null"
          ]
        },
        "contactId": {
          "type": [
            "string",
            "null"
          ]
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "sendAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "skipReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "failure": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "templateId",
        "contactId",
        "caseId",
        "sendAt",
        "skipReason",
        "failure",
        "createdAt"
      ]
    },
    "previousStatus": {
      "type": "string",
      "enum": [
        "queued",
        "scheduled",
        "sending",
        "sent",
        "delivered",
        "read",
        "failed",
        "skipped",
        "canceled"
      ]
    }
  },
  "required": [
    "message",
    "previousStatus"
  ]
}
```


## contact.opted_out

A contact stopped receiving messages on a channel, by their own request or by yours. Nothing more is sent to them there.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "contactId": {
      "type": "string",
      "example": "ctc_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "channel": {
      "type": "string",
      "enum": [
        "whatsapp",
        "email",
        "voice"
      ]
    },
    "source": {
      "type": "string",
      "enum": [
        "contact",
        "organization"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "contactId",
    "channel",
    "source",
    "createdAt"
  ]
}
```


## contact.suppressed

The erasure of a contact finished: its cases, messages, files and logs lost their content in our systems. Carries ids only. Erase the same person from every system where you copied them.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "contactId": {
      "type": "string",
      "example": "ctc_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "suppressionId": {
      "type": "string",
      "example": "sup_3PqA0x8bVw1TqS9mYp3RkL"
    }
  },
  "required": [
    "contactId",
    "suppressionId"
  ]
}
```


## message.redacted

A message was redacted: its text, file and copies were erased. Carries ids only. Redact the same message in every system where you copied it.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "caseId": {
      "type": "string",
      "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
    },
    "messageId": {
      "type": "string",
      "example": "msg_3PqA0x8bVw1TqS9mYp3RkL"
    }
  },
  "required": [
    "caseId",
    "messageId"
  ]
}
```


## approval.requested

An agent asked to run an action that its tool policy puts behind a person. Nothing ran. Decide it with POST /v2/approvals/{id}/approve or /reject before approval.expiresAt.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "approval"
  ]
}
```


## approval.decided

An approval was approved or rejected. approval.decision says by whom (a member or an API key) and why. When it was approved the action runs right after: follow approval.status.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "approval"
  ]
}
```


## approval.expired

Nobody decided in time, so the action never ran and the agent told the person. Ask the agent again if it still applies.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "approval"
  ]
}
```


## approval.escalated

A pending approval passed the time its policy gives before escalating (escalateAfterMinutes). Nothing changed in the approval: remind or reassign in your system before it expires. Fires once per approval.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "approval"
  ]
}
```


## approval.canceled

A pending approval was canceled because the person it is about asked to be erased. Nothing ran and it cannot be decided any more. Drop it from your queue. The approval no longer carries the arguments or the summary.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "approval"
  ]
}
```


## approval.review_requested

The person affected by an automated decision that went through an approval asked for a human review (Ley 21.719, art. 8 bis). Carries the reason they gave, also stored in approval.reviewReason. Review the decision and respond to the person in your system.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "approval"
          ]
        },
        "id": {
          "type": "string",
          "example": "apr_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected",
            "expired",
            "canceled",
            "executing",
            "executed",
            "failed"
          ]
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "arguments": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "summary": {
          "type": "string"
        },
        "reasonCode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "policy_always",
            "policy_condition",
            "policy_accumulated",
            "policy_rule",
            null
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "automatedDecision": {
          "type": "boolean"
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "requestedByKeyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "decidedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "object"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "decidedAt",
                "by",
                "reason"
              ]
            }
          ]
        },
        "result": {
          "type": [
            "string",
            "null"
          ]
        },
        "executedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "escalatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "agentId",
        "caseId",
        "tool",
        "arguments",
        "summary",
        "reasonCode",
        "ruleIndex",
        "automatedDecision",
        "dataSeen",
        "approvers",
        "requestedByKeyId",
        "decision",
        "result",
        "executedAt",
        "expiresAt",
        "escalatedAt",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt",
        "updatedAt"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "approval",
    "reason"
  ]
}
```


## automated_decision.review_requested

The person affected by an automated decision that no one approved asked for a human review (Ley 21.719, art. 8 bis). Carries the reason they gave, also stored in automatedDecision.reviewReason. Review the decision and respond to the person in your system.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "automatedDecision": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "automated_decision"
          ]
        },
        "id": {
          "type": "string",
          "example": "dec_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ]
        },
        "tool": {
          "type": "string"
        },
        "outcome": {
          "type": "string",
          "enum": [
            "allowed",
            "rejected"
          ]
        },
        "reasonCode": {
          "type": "string",
          "enum": [
            "policy_rule",
            "policy_not_required"
          ]
        },
        "ruleIndex": {
          "type": [
            "integer",
            "null"
          ]
        },
        "dataSeen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "caseId",
        "tool",
        "outcome",
        "reasonCode",
        "ruleIndex",
        "dataSeen",
        "reviewRequestedAt",
        "reviewReason",
        "createdAt"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "automatedDecision",
    "reason"
  ]
}
```


## team_question.created

An agent left a question for the team and keeps attending. Answer it with POST /v2/team-questions/{id}/answer; the agent resumes and tells the person.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "question": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "team_question"
          ]
        },
        "id": {
          "type": "string",
          "example": "tqn_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "answered",
            "delivered",
            "discarded"
          ]
        },
        "caseId": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "question": {
          "type": "string"
        },
        "context": {
          "type": [
            "string",
            "null"
          ]
        },
        "answer": {
          "type": [
            "string",
            "null"
          ]
        },
        "answeredAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "deliveredAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "caseId",
        "question",
        "context",
        "answer",
        "answeredAt",
        "deliveredAt",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "question"
  ]
}
```


## team_question.answered

A team question received its answer. The agent is about to tell the person. status moves to delivered once it did.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "question": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "team_question"
          ]
        },
        "id": {
          "type": "string",
          "example": "tqn_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "answered",
            "delivered",
            "discarded"
          ]
        },
        "caseId": {
          "type": "string",
          "example": "cse_7Hc2LmQ0x8bVw1TqS9mYp3"
        },
        "question": {
          "type": "string"
        },
        "context": {
          "type": [
            "string",
            "null"
          ]
        },
        "answer": {
          "type": [
            "string",
            "null"
          ]
        },
        "answeredAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "deliveredAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "status",
        "caseId",
        "question",
        "context",
        "answer",
        "answeredAt",
        "deliveredAt",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "question"
  ]
}
```


## meeting.scheduled

A meeting was booked in an agenda, by this API, the dashboard or an agent. The attendee already got the invitation. Read it with GET /v2/scheduling/meetings/{id}.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "meeting": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "meeting"
          ]
        },
        "id": {
          "type": "string",
          "example": "mtg_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agendaId": {
          "type": "string",
          "example": "agd_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "confirmed",
            "completed",
            "canceled",
            "no_show",
            "rescheduled"
          ]
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "durationMinutes": {
          "type": "integer"
        },
        "timezone": {
          "type": "string"
        },
        "attendeeEmail": {
          "type": "string"
        },
        "attendeeName": {
          "type": "string"
        },
        "attendeePhone": {
          "type": [
            "string",
            "null"
          ]
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "context": {
          "type": [
            "string",
            "null"
          ]
        },
        "meetLink": {
          "type": [
            "string",
            "null"
          ]
        },
        "canceledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agendaId",
        "status",
        "start",
        "end",
        "durationMinutes",
        "timezone",
        "attendeeEmail",
        "attendeeName",
        "attendeePhone",
        "companyName",
        "context",
        "meetLink",
        "canceledAt",
        "cancelReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "meeting"
  ]
}
```


## meeting.rescheduled

A meeting moved to another slot. meeting.start and meeting.end are the new ones; the attendee was told by the calendar.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "meeting": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "meeting"
          ]
        },
        "id": {
          "type": "string",
          "example": "mtg_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agendaId": {
          "type": "string",
          "example": "agd_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "confirmed",
            "completed",
            "canceled",
            "no_show",
            "rescheduled"
          ]
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "durationMinutes": {
          "type": "integer"
        },
        "timezone": {
          "type": "string"
        },
        "attendeeEmail": {
          "type": "string"
        },
        "attendeeName": {
          "type": "string"
        },
        "attendeePhone": {
          "type": [
            "string",
            "null"
          ]
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "context": {
          "type": [
            "string",
            "null"
          ]
        },
        "meetLink": {
          "type": [
            "string",
            "null"
          ]
        },
        "canceledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agendaId",
        "status",
        "start",
        "end",
        "durationMinutes",
        "timezone",
        "attendeeEmail",
        "attendeeName",
        "attendeePhone",
        "companyName",
        "context",
        "meetLink",
        "canceledAt",
        "cancelReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "meeting"
  ]
}
```


## meeting.canceled

A meeting was canceled and its slot is free again. meeting.cancelReason says why when there is one.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "meeting": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "meeting"
          ]
        },
        "id": {
          "type": "string",
          "example": "mtg_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agendaId": {
          "type": "string",
          "example": "agd_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "confirmed",
            "completed",
            "canceled",
            "no_show",
            "rescheduled"
          ]
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "durationMinutes": {
          "type": "integer"
        },
        "timezone": {
          "type": "string"
        },
        "attendeeEmail": {
          "type": "string"
        },
        "attendeeName": {
          "type": "string"
        },
        "attendeePhone": {
          "type": [
            "string",
            "null"
          ]
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "context": {
          "type": [
            "string",
            "null"
          ]
        },
        "meetLink": {
          "type": [
            "string",
            "null"
          ]
        },
        "canceledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agendaId",
        "status",
        "start",
        "end",
        "durationMinutes",
        "timezone",
        "attendeeEmail",
        "attendeeName",
        "attendeePhone",
        "companyName",
        "context",
        "meetLink",
        "canceledAt",
        "cancelReason",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "meeting"
  ]
}
```


## template.status_changed

WhatsApp reviewed a template, or paused it. rejectionReason says why when it was rejected.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "template": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "template"
          ]
        },
        "id": {
          "type": "string",
          "example": "tpl_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "category": {
          "type": "string",
          "enum": [
            "marketing",
            "utility",
            "authentication"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "in_review",
            "approved",
            "rejected",
            "paused"
          ]
        },
        "rejectionReason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "object",
        "id",
        "name",
        "language",
        "category",
        "status",
        "rejectionReason"
      ]
    },
    "previousStatus": {
      "type": "string",
      "enum": [
        "in_review",
        "approved",
        "rejected",
        "paused"
      ]
    }
  },
  "required": [
    "template",
    "previousStatus"
  ]
}
```


## campaign.status_changed

A campaign started, paused, resumed, completed or was canceled. pauseReason says why it paused by itself, if it did.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "campaign"
          ]
        },
        "id": {
          "type": "string",
          "example": "cmp_3PqA0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "scheduled",
            "sending",
            "paused",
            "completed",
            "canceled"
          ]
        },
        "pauseReason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "object",
        "id",
        "name",
        "status",
        "pauseReason"
      ]
    },
    "previousStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "draft",
        "scheduled",
        "sending",
        "paused",
        "completed",
        "canceled",
        null
      ]
    }
  },
  "required": [
    "campaign",
    "previousStatus"
  ]
}
```


## trigger.attempted

An attempt of a trigger cadence ran, or the cadence ended. result is sent when a template message was queued, skipped when the attempt could not go out (reason says why and the cadence ends), or stopped when the contact replied, opted out, or the case changed stage or closed (reason says which). Fires once per attempt, and once more when a cadence is stopped.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "triggerId": {
      "type": "string",
      "example": "trg_1Qa0x8bVw1TqS9mYp3RkLd"
    },
    "contactId": {
      "type": "string",
      "example": "ctc_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "caseId": {
      "type": [
        "string",
        "null"
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "attempts": {
      "type": "integer"
    },
    "result": {
      "type": "string",
      "enum": [
        "sent",
        "skipped",
        "stopped"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "messageId": {
      "type": [
        "string",
        "null"
      ]
    },
    "nextAttemptAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "triggerId",
    "contactId",
    "caseId",
    "attempt",
    "attempts",
    "result",
    "reason",
    "messageId",
    "nextAttemptAt"
  ]
}
```


## copilot.turn

Progress of a copilot turn: its status, or one of its steps. `kind` tells which.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "status",
        "step"
      ]
    },
    "userId": {
      "type": [
        "string",
        "null"
      ]
    },
    "turnId": {
      "type": [
        "string",
        "null"
      ]
    },
    "seq": {
      "type": [
        "integer",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "finished",
        "stopped",
        "failed"
      ]
    },
    "messageIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "order": {
      "type": "integer"
    },
    "slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "read",
        "write"
      ]
    },
    "stepStatus": {
      "type": "string",
      "enum": [
        "running",
        "done",
        "failed"
      ]
    }
  },
  "required": [
    "kind",
    "userId",
    "turnId",
    "seq"
  ]
}
```


## run.started

A worker picked up a run and the agent started working on it. It carries the run. It is sent at least once, so a run that a worker lost halfway can announce it again.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## run.waiting_for_answer

The agent paused the run to ask a person. run.question has the question; answer it with POST /v2/runs/{id}/answer and the run resumes. A run nobody answers within 30 days ends failed with stopReason abandoned.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## run.completed

The agent declared the job done. run.status is completed_unverified: nobody has checked it yet, so read run.result.summary and run.result.checks before you trust it.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## run.stopped

The run was cut before the agent declared the job done. run.stopReason says why (rounds, time or cost: a limit ran out; no_conclusion: the agent never called its finish action; loop: the agent repeated itself) and run.result.partial keeps the last thing the agent wrote.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## run.failed

The run ended with an error, or nobody answered its question in 30 days (stopReason abandoned). run.result.error says what happened.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## run.canceled

The run was canceled: nothing else will run.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "run"
  ]
}
```


## schedule.fired

A scheduled task reached its date and started a run. It carries the schedule and the run. A date the service missed is not replayed: the task fires once and moves to its next date.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "schedule": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "schedule"
          ]
        },
        "id": {
          "type": "string",
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "contactId": {
          "type": "string",
          "example": "ctc_5RvP2aKq9XwLmN3tYbZc01"
        },
        "name": {
          "type": "string"
        },
        "cron": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "goal": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "email"
          ]
        },
        "from": {
          "type": [
            "string",
            "null"
          ]
        },
        "onReply": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "instructions": {
                  "type": "string"
                }
              },
              "required": [
                "instructions"
              ]
            }
          ]
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "pausedReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "nextRunAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastRunAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "contactId",
        "name",
        "cron",
        "timezone",
        "goal",
        "channel",
        "from",
        "onReply",
        "limits",
        "enabled",
        "pausedReason",
        "nextRunAt",
        "lastRunAt",
        "createdAt",
        "updatedAt"
      ]
    },
    "run": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "run"
          ]
        },
        "id": {
          "type": "string",
          "example": "run_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "waiting_for_answer",
            "completed_unverified",
            "stopped",
            "failed",
            "canceled"
          ]
        },
        "stopReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rounds",
            "cost",
            "time",
            "no_conclusion",
            "loop",
            "abandoned",
            null
          ],
          "description": "rounds: the run used all the rounds allowed by limits.maxRounds. cost: the run reached the spending limit Lelemon sets for every run. time: the run lasted all the minutes allowed by limits.maxMinutes. no_conclusion: the agent answered four times in a row without calling its finish action, so it never declared the job done. Its last answer is in result.partial. loop: the agent kept repeating the same action, so the run was cut. abandoned: with status failed: the agent asked a question and nobody answered it in 30 days."
        },
        "question": {
          "type": [
            "string",
            "null"
          ]
        },
        "rounds": {
          "type": "integer"
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "result": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "errorCode": {
                  "type": "string"
                }
              },
              "required": []
            }
          ]
        },
        "cancelRequested": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "string",
            "null"
          ],
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "actor": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "end_user",
                    "staff",
                    "admin"
                  ]
                },
                "declaredBy": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "declaredBy"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "status",
        "stopReason",
        "question",
        "rounds",
        "limits",
        "result",
        "cancelRequested",
        "schedule",
        "actor",
        "createdAt",
        "startedAt",
        "finishedAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "schedule",
    "run"
  ]
}
```


## schedule.skipped

A scheduled task reached its date and did not start a run. reason says why: opted_out (the contact opted out of email), recipient_not_allowed (the contact is not in the recipient allowlist), agent_unavailable (the agent is paused, deleted or has no email channel) or contact_unavailable (the contact no longer exists or has no email). The task keeps its schedule and fires on its next date.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "schedule": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "schedule"
          ]
        },
        "id": {
          "type": "string",
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "contactId": {
          "type": "string",
          "example": "ctc_5RvP2aKq9XwLmN3tYbZc01"
        },
        "name": {
          "type": "string"
        },
        "cron": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "goal": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "email"
          ]
        },
        "from": {
          "type": [
            "string",
            "null"
          ]
        },
        "onReply": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "instructions": {
                  "type": "string"
                }
              },
              "required": [
                "instructions"
              ]
            }
          ]
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "pausedReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "nextRunAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastRunAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "contactId",
        "name",
        "cron",
        "timezone",
        "goal",
        "channel",
        "from",
        "onReply",
        "limits",
        "enabled",
        "pausedReason",
        "nextRunAt",
        "lastRunAt",
        "createdAt",
        "updatedAt"
      ]
    },
    "reason": {
      "type": "string",
      "enum": [
        "opted_out",
        "recipient_not_allowed",
        "agent_unavailable",
        "contact_unavailable"
      ]
    }
  },
  "required": [
    "schedule",
    "reason"
  ]
}
```


## schedule.paused

A scheduled task was paused by the platform after three runs in a row that failed or were cut. reason is consecutive_failures. Fix the cause and turn it on again with PATCH /v2/schedules/{id} and enabled true.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "schedule": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "schedule"
          ]
        },
        "id": {
          "type": "string",
          "example": "sch_5RvP2aKq9XwLmN3tYbZc01"
        },
        "agentId": {
          "type": "string",
          "example": "agt_5RvP2aKq9XwLmN3tYbZc01"
        },
        "contactId": {
          "type": "string",
          "example": "ctc_5RvP2aKq9XwLmN3tYbZc01"
        },
        "name": {
          "type": "string"
        },
        "cron": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "goal": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "email"
          ]
        },
        "from": {
          "type": [
            "string",
            "null"
          ]
        },
        "onReply": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "instructions": {
                  "type": "string"
                }
              },
              "required": [
                "instructions"
              ]
            }
          ]
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxRounds": {
              "type": "integer"
            },
            "maxMinutes": {
              "type": "integer"
            }
          },
          "required": [
            "maxRounds",
            "maxMinutes"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "pausedReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "nextRunAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastRunAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "agentId",
        "contactId",
        "name",
        "cron",
        "timezone",
        "goal",
        "channel",
        "from",
        "onReply",
        "limits",
        "enabled",
        "pausedReason",
        "nextRunAt",
        "lastRunAt",
        "createdAt",
        "updatedAt"
      ]
    },
    "reason": {
      "type": "string",
      "enum": [
        "consecutive_failures"
      ]
    }
  },
  "required": [
    "schedule",
    "reason"
  ]
}
```


## knowledge_document.ready

A document finished processing and the agents that have its collection can search it.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "document": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "knowledge_document"
          ]
        },
        "id": {
          "type": "string",
          "example": "kbd_9Hs3x8bVw1TqS9mYp3RkLd"
        },
        "collectionId": {
          "type": "string",
          "example": "kbc_2LpX0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "sizeBytes": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "ready",
            "failed"
          ]
        },
        "chunkCount": {
          "type": "integer"
        },
        "error": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "collectionId",
        "name",
        "mimeType",
        "sizeBytes",
        "status",
        "chunkCount",
        "error",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "document"
  ]
}
```


## knowledge_document.failed

A document could not be processed. document.error.code says why. The collection keeps working; upload the document again to retry.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "document": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "knowledge_document"
          ]
        },
        "id": {
          "type": "string",
          "example": "kbd_9Hs3x8bVw1TqS9mYp3RkLd"
        },
        "collectionId": {
          "type": "string",
          "example": "kbc_2LpX0x8bVw1TqS9mYp3RkL"
        },
        "name": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "sizeBytes": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "ready",
            "failed"
          ]
        },
        "chunkCount": {
          "type": "integer"
        },
        "error": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "collectionId",
        "name",
        "mimeType",
        "sizeBytes",
        "status",
        "chunkCount",
        "error",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "document"
  ]
}
```


## phone_number.connected

A subaccount linked its WhatsApp number and its agent started answering on it.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "phoneNumber": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "phone_number"
          ]
        },
        "id": {
          "type": "string",
          "example": "pn_4Zq0x8bVw1TqS9mYp3RkLd"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "verifiedName": {
          "type": [
            "string",
            "null"
          ]
        },
        "agentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "phone",
        "verifiedName",
        "agentId",
        "active",
        "createdAt",
        "updatedAt"
      ]
    },
    "connectionId": {
      "type": "string"
    }
  },
  "required": [
    "phoneNumber",
    "connectionId"
  ]
}
```


## phone_number.connection_failed

The number linked is not the one requested, or it belongs to another account. Nothing was attached; connection.failure.code says why.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "connection": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "whatsapp_connection"
          ]
        },
        "id": {
          "type": "string",
          "example": "wcn_4Zq0x8bVw1TqS9mYp3RkLd"
        },
        "phone": {
          "type": "string"
        },
        "agentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "connectionType": {
          "type": "string",
          "enum": [
            "coexistence",
            "dedicated"
          ]
        },
        "status": {
          "type": "string"
        },
        "setupUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "phoneNumberId": {
          "type": [
            "string",
            "null"
          ]
        },
        "failure": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "phone",
        "agentId",
        "connectionType",
        "status",
        "setupUrl",
        "expiresAt",
        "phoneNumberId",
        "failure",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "connection"
  ]
}
```


## phone_number.disconnected

A WhatsApp number was disconnected, by you or by the provider. Its agent no longer answers on it.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "phoneNumber": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "phone_number"
          ]
        },
        "id": {
          "type": "string",
          "example": "pn_4Zq0x8bVw1TqS9mYp3RkLd"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "verifiedName": {
          "type": [
            "string",
            "null"
          ]
        },
        "agentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "phone",
        "verifiedName",
        "agentId",
        "active",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "phoneNumber"
  ]
}
```


## webhook_endpoint.test

Sent by POST /v2/webhook-endpoints/{id}/test to check that an endpoint receives and verifies events.

JSON Schema of `data`:

```json title="data"
{
  "type": "object",
  "properties": {
    "endpointId": {
      "type": "string",
      "example": "whk_3PqA0x8bVw1TqS9mYp3RkL"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "endpointId",
    "message"
  ]
}
```


