---
title: "Authorize channel subscription"
url: https://docs.gleap.ai/en/reference/rest-api/auth
method: POST
path: "/s2s/stream/auth"
api: "API Reference"
tag: "S2S Stream"
operationId: "Auth"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Authorize channel subscription

`POST https://api.gleap.io/v3/s2s/stream/auth`

Channel authorization — point your Pusher client's channel auth here with your server key as the Authorization header. A new consumerId takes over from the previous consumer (its connection is terminated).

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Request body (`application/json`, required)

- `socket_id` (string, required)
- `channel_name` (string, required)
- `consumerId` (string, required): Identifies the connecting backend instance; a new consumerId takes over.
- `typingEvents` (boolean): Opt this stream into agent.typing.\* events (high volume; default off).

## Example request

```bash
curl --request POST \
  --url https://api.gleap.io/v3/s2s/stream/auth \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "socket_id": "<socket_id>",
  "channel_name": "<channel_name>",
  "consumerId": "<consumerId>"
}'
```

## Responses

### 200 (`application/json`)

Ok
