Send a call report to a webhook
Build an automation that judges each completed conversation of one Assistant and posts the report to your endpoint. You create a Process with two steps, a Trigger on exchange.completed, and then read the Run that a conversation produces.
Prerequisites
- A project-scoped API key.
- The ID of an Assistant in that Project. The Quickstart creates one.
- An HTTPS endpoint that accepts
POSTrequests with a JSON body. For a first test, a request inspection service works. The endpoint must have a public address: a Process cannot reach private or internal addresses.
Step 1: Create the Process
The Process has two steps:
- An Agent step reads the transcript and returns a structured report. Its
outputname,report, makes the result available to the next step. - A Request step posts the report to your endpoint with the Exchange ID and duration.
Create the Process
Replace the url with your endpoint. gpt-6-luna is a reasoning model: it ignores temperature and can take longer than the default 30-second step timeout, so the step sets timeout to 60 seconds, the Agent step's own limit.
The Process reads the conversation from the exchange.completed System event:
event.data.messagesis the transcript. Thejsonhelper turns it into text for the Agent step.event.refIdis the Exchange ID.report.outputis the object the Agent step returned. A field holding only one template keeps the value's type, so the report is sent as an object. See Templating language.
Copy the id of the response for the next step.
Step 2: Create the Trigger
Link the Process to exchange.completed, and limit it to your Assistant with a condition:
Create the Trigger
Copy the id of the response. The Trigger starts the Process for every conversation of this Assistant that ends from now on.
Step 3: Hold a conversation
Talk to the Assistant and end the conversation, for example with a browser call from the dashboard. When the Exchange is complete, Reecall announces exchange.completed and the Trigger creates a Run.
Step 4: Read the Run
List the Runs of the Trigger:
List the Runs of the Trigger
The newest Run comes first. Its refId is the ID of the Exchange. Read it to see each step:
Read the Run
A Run that worked has status: "succeeded", and its two step records are succeeded. The request step's record shows the status code your endpoint answered in params.status. See Read a Run for every field.
Result
Your endpoint receives one request per completed conversation:
Request body
The request carries an Idempotency-Key header. Store it to ignore a request you already received.
Troubleshooting
| Symptom | Check |
|---|---|
| No Run after the conversation | The Trigger's enabled field, the Assistant ID in the condition, and the filter name. A misspelled filter never matches. |
status: "failed" with REQUEST_ERROR | Your endpoint answered an error or could not be reached. errorMessage gives the status code, such as Request failed with status code 503 (Service Unavailable). |
REQUEST_BLOCKED | The URL points to a private or internal address. Use a public HTTPS endpoint. |
AGENT_ERROR or AGENT_VALIDATION_ERROR | The Agent step failed or its configuration is invalid. Read errorMessage, then compare the step with the Agent step reference. |
TEMPLATE_ERROR | A template could not be rendered. errorMessage names the field and the expression. See Templating language. |
Next steps
- Turn on retries so a
503from your endpoint does not lose a report. The Agent step runs again on each retry. - Keep an endpoint token in a secret Variable and send it with
{{ variables.KEY }}in the request headers. See Processes. - Read Runs for statuses, limits, and data retention.