> For the complete documentation index, see [llms.txt](https://dataqueue.gitbook.io/voicehub-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dataqueue.gitbook.io/voicehub-docs/api-reference/whatsapp-text-call-api.md).

# WhatsApp Text Call API

#### **Triggering WhatsApp Text Calls through API**

After copying the API key, it is to be used as a header in the request to trigger the call or schedule it. `scheduleAt` is an optional date time field that is passed when the call is to be scheduled in the future. If past date is passed, an error will be raised.

The `from` number in configured in pathway in the Whatsapp start node.

```bash
curl --location 'https://voicehub.dataqueue.ai/api/v1/calls/whatsapp-call' \
--header 'x-dq-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "to": "<voip-call-phone-number-destination>",
  "agentId": "<agent-id-to-be-used>"
  "context": {<json-dict-of-context>}
  "scheduleAt": "yyyy-mm-ddThh:mm",
}'
```

It returns a json object containing details about the call triggered

```json
{
    "id": "<generated-call-id>",
    "status": "<call-status>", // Queued or Scheduled
    "type": "whatsapp-text"
}
```

#### Checking status of the call

The following endpoint allows to read through the status of the call triggered

```bash
curl --location 'https://voicehub.dataqueue.ai/api/v1/calls/status/<call-id>/' \
--header 'x-dq-api-key: <api-key>'
```

response returned is similar to that of the trigger call api response.
