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

# Customer Accounts API

> Manage customer authentication and authorization in Text.

The Customer Accounts API handles authentication and authorization for customers in Text. Before a customer can send or receive messages through the [Customer Chat API](/api/customer-chat/), they need a valid access token — this API is how you issue, inspect, and revoke those tokens.

## Available grant types

There are three ways to obtain a customer access token:

* **`cookie`** — The customer's identity is tied to their browser via cookies (`__lc_cid` and `__lc_cst`). The most common approach for web apps, where returning visitors are automatically recognized.
* **`agent_token`** — A token is issued on behalf of a specific customer, authorized by an agent token. Best for backend integrations where you manage multiple customer identities from one place.
* **`identity_token`** — An identity transfer token is exchanged for a customer access token. Used when a customer switches devices or browsers mid-conversation and you want their session to follow them.

## Identity transfer

If a customer starts a chat on one device and switches to another, you can transfer their identity so the conversation continues without losing history. First call [Create an identity transfer token](/api/customer-accounts/tokens/create-an-identity-transfer-token), then exchange it for a fresh access token using [Create a token](/api/customer-accounts/tokens/create-a-token) with `grant_type=identity_token`.
