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

# Authorize a Web Agent Call

> Create a single-use session token for a client to talk with your web agent.

### Headers

**authorization** `string` *required*

Your API key for authentication.

Example web call usage (client side):

```javascript theme={null}
import { BlandWebClient } from 'bland-client-js-sdk';

const agentId = 'YOUR-AGENT-ID';
const sessionToken = 'YOUR-SESSION-TOKEN';


document.addEventListener('DOMContentLoaded', async () => {
    document.getElementById('btn').addEventListener('click', async () => {
        const blandClient = new BlandWebClient(
            agentId,
            sessionToken
        );
        await blandClient.initConversation({
            sampleRate: 44100,
        });
    });
});
```

### Path

**agent\_id** `string` *required*

The web agent to authorize a call for.

Special note: While in Beta, this request must be made to the `api.bland.ai` domain.

### Body

**request\_data** `object`

Variables to be passed to this session.

Example:

```json theme={null}
{
  "name": "John Doe"
}
```

### Response

**token** `string`

The single-use session token that can be sent to the client.

**status** `string`

Can be `success` or `error`.

**message** `string`

A message saying whether the token creation succeeded, or a helpful message describing why it failed.

```json theme={null}
{
  "token": "22480c52-0ff1-4214-bcb7-50649b508432"
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


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