# Triggering an outbound WhatsApp virtual agent

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

*Studio’s outbound call limits that is! We currently only allow one session per second however if your virtual agent needs to make more calls we can increase the limit up to 5 outbound sessions 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 sessions 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 any new outbound sessions.*

*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 %}

You can jumpstart the outbound session from any platform of your choosing, e.g. Postman.&#x20;

{% hint style="warning" %}
*Please make sure that you have configured and set up your WhatsApp template messages correctly. Learn more about creating WhatsApp templates* [*<mark style="color:purple;">here.</mark>*](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines)
{% endhint %}

You can add dynamic parameters to your template that will change according to the value you add to your query. See the example below for "`PARAM1_VALUE`".

The query will look like the following -&#x20;

#### Endpoint (mandatory)

The endpoint depends on the region you selected for your agent

For EU agents --> `https://studio-api-eu.ai.vonage.com/messaging/conversation`

For US agents --> `https://studio-api-us.ai.vonage.com/messaging/conversation`

#### Method (mandatory)

POST

#### Headers (mandatory)

`X-Vgai-Key`

{% hint style="info" %}
*You can find the* `X-Vgai-Key` *on the top right of your canvas. Click on the "user" icon, and then "Generate API Key".*
{% endhint %}

#### Request Body

{% hint style="danger" %}
*Namespace, template, locale, to, agent ID, channel, and status URL are mandatory to include within the request body.*
{% endhint %}

```
{
    "components": [
        {
            "type": "header",
            "parameters": [
                {
                    "type": "text",
                    "text": "PARAM1_VALUE"
                }
            ]
        },
        {
            "type": "body",
            "parameters": [
                {
                    "type": "text",
                    "text": "PARAM2_VALUE"
                }
            ]
        }
    ],
    "namespace": "NAMESPACE_ID",
    "template": "TEMPLATE_NAME",
    "locale": "en",
    "to": "TO_NUMBER",
    "agent_id": "AGENT_ID",
    "channel": "whatsapp",
    "status_url": "string",
    "session_parameters": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}
```

Details surrounding **Namespace** and  **Template** can be found on your [<mark style="color:purple;">WhatApp Business Account</mark>](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/) under the template you want to use.

For testing purposes, we recommend using the [<mark style="color:purple;">Webhook site</mark> ](https://webhook.site/)for a dummy Status URL so that you can make sure you are receiving the status of your messages (sent, delivered, read, etc) accurately.&#x20;

Once you have tested out this functionality, you can replace the **Status URL** with the actual URL you want to receive the message statuses on.&#x20;

{% hint style="warning" %}
*Please do not use the Status URL that can be found within the Application associated with your Virtual Assistant on the Main API Dashboard as this will result in endless looping errors*
{% 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/whatsapp/get-started/triggering-an-outbound-whatsapp-virtual-agent.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.
