***

title: createToken
slug: /reference/typescript/rest/chat/create-token
description: Chat API namespace — token creation.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Chat API namespace — token creation.

<EndpointSchemaSnippet endpoint="POST /api/chat/tokens" />

## **Response Example**

<EndpointResponseSnippet endpoint="POST /api/chat/tokens" />

## **Example**

```typescript {4}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient();
const result = await client.chat.createToken({ channels: ['general'] });
console.log(result);
```