HTTP API

PubSub

GET/api/v1/pubsub/channels
GET
/api/v1/pubsub/channels

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/pubsub/channels"
[  "string"]
GET/api/v1/pubsub/channels/{channel}/info
GET
/api/v1/pubsub/channels/{channel}/info

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

channel*string

Channel name to get information for

Response Body

application/json

curl -X GET "https://example.com/api/v1/pubsub/channels/string/info"
{  "created_at": 0,  "name": "string",  "subscriber_count": 0}
GET/api/v1/pubsub/channels/{channel}/stats
GET
/api/v1/pubsub/channels/{channel}/stats

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

channel*string

Channel name to get statistics for

Response Body

application/json

curl -X GET "https://example.com/api/v1/pubsub/channels/string/stats"
{  "is_active": true,  "name": "string",  "redis_subscribers": 0,  "total_subscribers": 0,  "websocket_subscribers": 0}
GET/api/v1/pubsub/grants
GET
/api/v1/pubsub/grants

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

direction?string

granted (default) lists grants the caller issued; received lists grants made to them.

Value in

  • "granted"
  • "received"

Response Body

application/json

curl -X GET "https://example.com/api/v1/pubsub/grants"
{  "grants": [    {      "created_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z",      "grant_id": "string",      "grantee": "string",      "granter": "string",      "ops": [        "subscribe"      ],      "resource": "string"    }  ]}
POST/api/v1/pubsub/grants
POST
/api/v1/pubsub/grants

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to grant a capability to another principal.

Response Body

application/json

curl -X POST "https://example.com/api/v1/pubsub/grants" \  -H "Content-Type: application/json" \  -d '{    "grantee": "string",    "ops": [      "subscribe"    ],    "resource": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "grant_id": "string",  "grantee": "string",  "granter": "string",  "ops": [    "subscribe"  ],  "resource": "string"}
DELETE/api/v1/pubsub/grants
DELETE
/api/v1/pubsub/grants

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

grantee*string

Principal whose grants from the caller should all be revoked.

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/pubsub/grants?grantee=string"
{  "revoked": 0}
DELETE/api/v1/pubsub/grants/{grant_id}
DELETE
/api/v1/pubsub/grants/{grant_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

grant_id*string

Grant id to revoke

Response Body

curl -X DELETE "https://example.com/api/v1/pubsub/grants/string"
Empty
POST/api/v1/pubsub/publish
POST
/api/v1/pubsub/publish

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to publish a single message to many channels in one call

Response Body

application/json

curl -X POST "https://example.com/api/v1/pubsub/publish" \  -H "Content-Type: application/json" \  -d '{    "channels": [      "string"    ],    "payload": null  }'
{  "channels_published": 0,  "results": [    {      "channel": "string",      "message_id": "string",      "subscribers_notified": 0    }  ],  "total_subscribers_notified": 0}
POST/api/v1/pubsub/publish/{channel}
POST
/api/v1/pubsub/publish/{channel}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

channel*string

Channel name to publish to

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to publish a message to a channel

Response Body

application/json

curl -X POST "https://example.com/api/v1/pubsub/publish/string" \  -H "Content-Type: application/json" \  -d '{    "payload": null  }'
{  "channel": "string",  "message_id": "string",  "subscribers_notified": 0,  "timestamp": 0}
POST/api/v1/pubsub/rooms/{name}
POST
/api/v1/pubsub/rooms/{name}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

name*string

Room name; the channel is room.{name}

Response Body

application/json

curl -X POST "https://example.com/api/v1/pubsub/rooms/string"
{  "owner": "string",  "room": "string"}
POST/api/v1/pubsub/token
curl -X POST "https://example.com/api/v1/pubsub/token"
{  "expires_in": 0,  "namespace": "string",  "token": "string"}

On this page