Skip to main content
POST
/
api
/
realtime
/
channels
Create Channel
curl --request POST \
  --url https://api.example.com/api/realtime/channels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "pattern": "order:*",
  "description": "Order updates channel",
  "webhookUrls": [
    "https://example.com/webhook"
  ],
  "enabled": true
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "pattern": "order:*",
  "description": "Order updates channel",
  "webhookUrls": [
    "https://example.com/webhook"
  ],
  "enabled": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
pattern
string
required

Channel pattern for subscription matching

Minimum string length: 1
Example:

"order:*"

description
string

Human-readable description of the channel

Example:

"Order updates channel"

webhookUrls
string<uri>[]

URLs to receive webhook notifications

Example:
["https://example.com/webhook"]
enabled
boolean
default:true

Whether the channel should be active upon creation

Example:

true

Response

Channel created successfully

id
string<uuid>
required

Unique identifier for the channel

Example:

"550e8400-e29b-41d4-a716-446655440000"

pattern
string
required

Channel pattern for subscription matching (supports wildcards like "order:*")

Minimum string length: 1
Example:

"order:*"

enabled
boolean
required

Whether the channel is currently active

Example:

true

createdAt
string<date-time>
required

Timestamp when the channel was created

Example:

"2024-01-15T10:30:00Z"

updatedAt
string<date-time>
required

Timestamp when the channel was last updated

Example:

"2024-01-15T10:30:00Z"

description
string | null

Human-readable description of the channel

Example:

"Order updates channel"

webhookUrls
string<uri>[] | null

URLs to receive webhook notifications for messages on this channel

Example:
["https://example.com/webhook"]