# Events

**Events** are all conversation and workflows executed through the agent.

These can be individual sessions between either agent and user or actions performed by the agent (like sending a text message or email, or API request). Events can be triggered fully separate from one another.

There are currently four event types:&#x20;

* Inbound&#x20;
* Outbound&#x20;
* End Call Event&#x20;
* API Event

![](/files/R25aKkel5s5uAFfwWQov)

{% hint style="info" %}
*You can choose to add one event each from the event types. This means you can add one inbound session, one outbound session, one end call event and one API event all together in one agent!*
{% endhint %}

## Event Types

### Inbound Call Event

This event is triggered when the agent is being called directly.&#x20;

**Use case Example:** Virtual Agent handles incoming customer support queries, e.g. FAQs (opening hours, location, etc). In this case, the user is initiating the conversation with the VA.&#x20;

![](/files/hEnR4wBwY4LFHLxYodkB)

{% hint style="info" %}
*There are no node restrictions on nodes used in the flow.*&#x20;

*Note, that you can only create one inbound event per agent.*&#x20;
{% endhint %}

### Outbound Call Event

You can trigger this event by using our [<mark style="color:purple;">Outbound Call API</mark>](https://studio.docs.ai.vonage.com/voice/get-started/telephony) which will initiate an outbound call to a recipient.&#x20;

{% hint style="warning" %}
**Are you within the limits?**

*Studio’s outbound call limits that is! We currently only allow one call/session per second however if your virtual agent needs to make more calls we can increase the limit up to 5 outbound calls per second.*&#x20;

*If you require an increased limit, please email* [*<mark style="color:purple;">support@aistudio.vonage.com</mark>*](mailto:support@aistudio.vonage.com) *with the following details:-*

* *API key*&#x20;
* *Agent ID(/s)*
* *Increase request: You can choose to increase your limit to 3 or 5 calls per second* &#x20;

*Once you receive confirmation from our teams that your request has been processed, please publish your agents and wait for about 5 minutes before you start triggering new outbound calls.*

*Please note that if your agent is not approved for a higher limit, any call made over the 1 call per second limit will fail and return a 429 error!*
{% endhint %}

**Use Case Example:** Virtual Agent engages with your customers by sending notifications and updates, e.g. confirmation messages, appointment changes, special deals, etc. Here, the VA initiates the conversation with the user.

![](/files/xIiDbRvs5G5k38eWSIKR)

{% hint style="info" %}
*This event cannot be triggered without the* [*<mark style="color:purple;">correct configuration of the Outbound Call API</mark>.* ](https://studio.docs.ai.vonage.com/voice/get-started/telephony)

*There are no node restrictions on nodes used in the flow.*&#x20;

*Note, that you can only create **one Outbound event per agent**.*&#x20;
{% endhint %}

###

### End Call Event

The **End Call** **event** will be triggered automatically as soon as the main flow session ended, either when the agent terminated the call with the **End Call** node or when the user ended the conversation by hanging up the call.&#x20;

Using the **End Call** event you can continue the interaction with your customers after the initial conversation was terminated

**Use Case Example:** Sending out a post-call survey to your user once they leave the conversation.&#x20;

![](/files/RahND9PcGcuzKIOM6YbQ)

{% hint style="info" %}
*You can only use action-based nodes for this event, e.g. Webhooks, custom code, etc.*&#x20;

*Note, that you can only create **one End Call event per agent**.*&#x20;
{% endhint %}

#### Sending the Call Recordings via SMS/ Email

It is important to note, that the main inbound call event and the end call event have two different session IDs. This becomes relevant when we want to retrieve the audio URL and send it via SMS or Email.&#x20;

We'll query the [<mark style="color:purple;">Insights API</mark>](https://studio.docs.ai.vonage.com/api-integration/vai-integration-guide) for the call recording and can then send the call recording parameter via SMS/ Email.&#x20;

To do that, we will need the session ID of the main inbound call event that holds the conversation stored in the `TRIGGERED_BY_SESSION` parameter. Add this parameter to the query parameters in the *Webhook*. In the response parameter at the bottom, you can add a new parameter that will store the audio URL.&#x20;

### API Event

The **API event** flow will be triggered by an incoming API call. This HTTP-event-based flow can be initialized at any time completely separate from the main flow from an API call platform such as Postman.

**Use Case Example:** A customer inquires about a certain product. The customer's database receives that information and uses this event to trigger an email with discount opportunities to the customer.

To initiate this event, click on the node, copy the endpoint and all other request parameters to your API platform of choice.&#x20;

![](/files/ERAqMgR7DVCbc0TKBEbg)

{% hint style="info" %}
*You can only use action-based nodes for this event, e.g. Webhooks, Custom Code, etc.*

*You can create multiple API events per agent.*&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://studio.docs.ai.vonage.com/voice/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
