Skip to content

PubSub

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

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: name. Default: name.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/pubsub/channels"
{  "channels": [    "string"  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
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

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

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"    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
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"}