--- title: "Get Token Pair" url: https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/get-token-pair/ description: "This API generates a token pair for a Datastream channel. The token pair is required to establish a WebSocket connection for any specific client or application to subscribe to the channel." last_updated: 2026-07-07T05:22:22Z service: Cloud Scale type: api --- # Get Token Pair ### Description This API generates a token pair for a [Datastream channel](https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/introduction/). The token pair is required to establish a WebSocket connection for any specific client or application to subscribe to the channel. > **Note:** `app_user_id` is the unique identifier of an application user in your Catalyst project. You can obtain the value of `app_user_id` from Catalyst Authentication, which represents who is subscribing to the Data Streams channel. Check out [this page](https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/authentication/get-specific-user/) for more details. ### Request Details #### Request URL `POST` {api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_id}/tokenpair - **api-domain** (URL): The DC-specific domain used to access Catalyst APIs - **project_id** (Numerical): The [unique ID](https://docs.catalyst.zoho.com/en/getting-started/set-up-a-catalyst-project/general-settings/) of the Catalyst project - **channel_id** (Numerical): The unique ID of the Datastream channel #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Content-Type:** application/json **Optional Headers** **CATALYST-ORG:** {org_id} **Environment:** Development #### Request Body - **app_user_id** (Numerical, mandatory): The unique ID of the application user for whom the token pair is generated #### Scope ZohoCatalyst.datastreams.connections.token.CREATE ### Response Details On successful execution, the response returns a token pair that can be used by the specified application user to establish a WebSocket connection and subscribe to the Datastream channel. **Sample Request** ```bash curl -X POST \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/20084000000662015/tokenpair \ -H "Authorization: Zoho-oauthtoken 1000.06adcc79fa822856dc0668e88d297d45.252b0f4d750669be5965252623d40004" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" \ -H "Content-Type: application/json" \ -d '{ "app_user_id": 20084000000888047 }' ``` ### SDK Documentation [Generate Token Pair- Java SDK](https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/generate-token-pair/) [Generate Token Pair- Node.js SDK](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/generate-token-pair/) [Generate Token Pair- Python SDK](https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/generate-token-pair/)