---
title: Authentication & Base URL
slug: voice-apis/authentication-and-base-url
description: Explore Exotel's Legs APIs for advanced voice orchestration in contact centers, enabling detailed control over call legs and media with seamless authentication and management.
createdAt: 2026-01-19T06:37:37.747Z
---

### Introduction

**ExoML** provides developers with APIs that give low-level control over call legs, media, and bridges.

These APIs are designed for advanced voice orchestration, real-time call control, and custom contact center or voice workflows.

### Base URL

All ExoML Aare served from the Exotel CPaaS API host.

**Base URL format**

:::BlockQuote
https\://cpaas-api.in.exotel.com/v2/accounts/&#x7B;account\_sid}
:::

**Example**

:::BlockQuote
https\://cpaas-api.in.exotel.com/v2/accounts/ameyo5m
:::

::::BlockQuote
**Important**

:::Paragraph{listStyleType="disc" indent="1"}
ameyo5m is an example Account SID&#x20;
:::

:::Paragraph{listStyleType="disc" indent="1"}
Always use &#x7B;account\_sid} as a placeholder&#x20;
:::
::::

### How to get your API credentials

To use the ExoML, developers must generate API credentials from the Exotel dashboard.

**Steps**

1. Log in to **https\://my.exotel.com**
2. Go to **Developer Settings → API Settings**&#x20;
3. Copy:&#x20;
   - Account SID&#x20;
   - API Key&#x20;
   - API Token&#x20;

These credentials are required for all Call Control API requests.

### Authentication

All ExoML use **HTTP Basic Authentication**.

- **Username:** API Key&#x20;
- **Password:** API Token&#x20;

**Example**

:::BlockQuote
curl -u "\<API\_KEY>:\<API\_TOKEN>" \\
https\://cpaas-api.in.exotel.com/v2/accounts/\<account\_sid>/legs
:::

**Notes**

- Credentials are not embedded in the URL&#x20;
- Credentials are not passed in request bodies&#x20;
- Every request must include Basic Authentication&#x20;

### Request Format

**Required headers**

:::BlockQuote
Content-Type: application/json
Authorization: Basic \<base64(API\_KEY\:API\_TOKEN)>
:::

**URL structure**

:::BlockQuote
/v2/accounts/&#x7B;account\_sid}/&#x7B;resource}
:::

**Common resources**

- /legs&#x20;
- /legs/&#x7B;leg\_sid}&#x20;
- /legs/&#x7B;leg\_sid}/actions&#x20;
- /bridges&#x20;
- /bridges/&#x7B;bridge\_sid}&#x20;
- /bridges/&#x7B;bridge\_sid}/actions&#x20;

### Example: Create a Leg

**Endpoint**

:::BlockQuote
POST /legs
:::

**Full URL**

:::BlockQuote
https\://cpaas-api.in.exotel.com/v2/accounts/&#x7B;account\_sid}/legs
:::

**Example request**

:::BlockQuote
curl -u "\<API\_KEY>:\<API\_TOKEN>" \\
-H "Content-Type: application/json" \\
-X POST \\
https\://cpaas-api.in.exotel.com/v2/accounts/\<account\_sid>/legs \\
-d '\{
&#x20; "contact\_uri": "09163816621",
&#x20; "exophone": "08030752400",
&#x20; "leg\_event\_endpoint": "grpc://127.0.0.1:9001"
}'
:::

### Next Steps

Once authentication is set up, you can:

- Create and manage call legs&#x20;
- Bridge multiple legs&#x20;
- Control media (play, say, record, stream)&#x20;
- Receive real-time call events via HTTPs event endpoint.

Proceed to the **ExoML** **Introduction** section to explore individual endpoints.
