Send a Channel Broadcast¶
POST /broadcast¶
Requires a broadcaster, admin, or backend JWT.
Authorization¶
Send Authorization: <Twitch Extension Client ID> <Muxy JWT>. The JWT role must satisfy the endpoint requirements shown in the examples.
Request body¶
Content type: application/json
Schema¶
{
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "PubSub target; use broadcast for a channel-wide message."
},
"event": {
"type": "string",
"default": "default"
},
"user_id": {
"type": "string",
"description": "Target Twitch channel ID for channel broadcasts."
},
"data": {
"type": "object",
"additionalProperties": true
}
},
"required": [
"data"
]
}
Example¶
{
"event": "score-updated",
"data": {
"score": 42
},
"target": "broadcast",
"user_id": "12345678"
}
Responses¶
200 Response¶
Message accepted for delivery.
Content type: application/json
Schema¶
{
"type": "object"
}
Example¶
{}
400 Error¶
The request body or poll configuration is invalid.
Content type: application/json
Schema¶
{
"type": "object",
"properties": {
"reason": {
"type": "string"
}
}
}
Example¶
{
"reason": "Invalid body"
}
403 Error¶
The JWT role is not allowed to perform this operation.
Content type: application/json
Schema¶
{
"type": "object",
"properties": {
"reason": {
"type": "string"
}
}
}
Example¶
{
"reason": "role is not authorized"
}
Generated API reference
This endpoint is generated from rest-v1.yaml.