> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lokutor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# After each call: success rules, data and your webhook

> Open the Customer care UK agent's Analysis tab, see what is worked out after each call and what it costs, write a success rule and a data field, and set up the webhook that sends each finished call to your own system, stopping before anything is saved.

A narrated video (4:27), filmed on the real dashboard in a demo workspace, then the same steps in writing.

<video controls playsInline preload="metadata" poster="https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/poster.jpg">
  <source src="https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/video.mp4" type="video/mp4" />
</video>

## What we will cover

In this video we look at what happens to every call once it ends, and how to send those calls to a system of your own. We will start on the agent called Customer care UK. Its Analysis tab is where all of this is set. Open the Customer care UK agent from the list, and you land on its overview. The sidebar on the left holds the agent sections, and the workspace is Grupo Alba.

1. Press **Customer care · UK**.

![What we will cover](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/intro.webp)

## Opening the Analysis tab

The agent has several sections along the top, such as Agent, Workflow, Tools, Phone and Tests. Analysis is the one we want, because it holds what is done with calls after they finish. Open it now, and the page shows the After each call section first.

1. Press **Analysis**.

![Opening the Analysis tab](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/open-analysis.webp)

## What is worked out

Under After each call there are three things that can be worked out for every call. Each of them has its own switch, so you can turn on only what you need. The page also shows the cost, so you can judge it before you switch anything on. It says about 0.11¢ for a call of a minute, in model tokens, which is the typical figure for a call of that length.

![What is worked out](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/after-each-call.webp)

## Summary, mood and success

The first one is Summary and mood. It records what happened in the call and how the caller sounded, and you see that in the list of calls and when the same caller rings again. The second is Success rules. These are checked on every call after it ends, each with a reason, and their pass rate appears in Insights, in flags and in A/B tests.

![Summary, mood and success](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/summary-and-success.webp)

## Data to keep

The third is Data. These are fields taken from every conversation, and the agent also tries to find them out while it talks. You can download them as a CSV file. The page already has a field called name, which holds the caller's full name. Each field is a name with a short description of what it is.

![Data to keep](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/data-switch.webp)

## Writing a success rule

Now we will write a success rule. Press Add rule, and a New rule form opens. Here the rule has a name, and a condition that says when the call counts as met. We will name this one Delivery date given.

1. Press **Add rule**.

![Writing a success rule](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/add-rule.webp)

Type the name Delivery date given into the Name field. That name is what you will see later in Insights and in the flags. Keep it short, so it reads clearly in a list.

1. In **Name**, write: “Delivery date given”

![Writing a success rule](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/rule-name.webp)

Next comes the condition. Type The caller is told the day their parcel arrives into the It is met when field. This is the test each call is checked against once it ends. The rule passes only when the caller hears that date.

1. In **It is met when**, write: “The caller is told the day their parcel arrives”

![Writing a success rule](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/rule-condition.webp)

We will not save this rule here, so we close the form for now. Closing it returns us to the Analysis page, where the Data section sits behind it.

1. Press **Close**.

![Writing a success rule](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/close-rule.webp)

## Keeping a data field

Next, Data to keep. The field already here is called name. It holds the caller's full name, and its short description, The caller's full name, tells the agent what to listen for.

![Keeping a data field](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/data-field-add.webp)

Now a new one. Press Add field to open its form. In Name, type order\_number. In What it is, write The order number the caller gives. That description is what the agent listens for while the caller talks, and what fills the field after the call.

1. Press **Add field**.
2. In **Name**, write: “order\_number”
3. In **What it is**, write: “The order number the caller gives”

![Keeping a data field](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/field-name.webp)

We'll leave this one unsaved too. Cancel closes the form, and the page is clear for the webhook.

1. Press **Cancel**.

![Keeping a data field](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/cancel-field.webp)

## Sending calls to your system

The last part is the webhook. It posts every finished call to a system of yours, with the outcome, summary, checks, data and cost. Press Set up to open its form. The Address field is where each call is posted, and it is empty here, so the workspace address is used when it has one.

1. Press **Set up**.

![Sending calls to your system](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/webhook.webp)

The address is the place your system listens for calls. With the transcript adds everything that was said to what is posted. Staging calls too sends calls from the draft as well, and marks them as staging. Turn these on only if your system needs them.

![Sending calls to your system](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/webhook-options.webp)

This is what arrives for each finished call. It is a message with an event name, a conversation id, the agent id, the channel and direction, the caller and line, when the call started, and how long it lasted. The outcome, checks, data and cost follow in the same message. Deliveries and the signing secret are kept under Developers.

![Sending calls to your system](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/what-arrives.webp)

## Wrapping up

That covers what is worked out after each call, a success rule, a data field and the webhook. We stopped before saving or publishing anything, so the agent is unchanged. You can come back to this Analysis tab whenever you are ready to turn these on.

![Wrapping up](https://lokutor-media-eu-west-1.s3.eu-west-1.amazonaws.com/tutorials/after-call/en/images/wrap-up.webp)

*Voice made with AI.*

Read more: [Webhooks for finished calls](https://docs.lokutor.com/guides/webhooks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.