Create or Update Poll Configuration¶
POST /vote_config¶
Creates or replaces poll configuration. Requires an admin, backend, or broadcaster 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",
"required": [
"id",
"config"
],
"properties": {
"id": {
"type": "string",
"maxLength": 64
},
"config": {
"type": "object",
"properties": {
"userIDVoting": {
"type": "boolean"
},
"distinctOptionsPerUser": {
"type": "integer",
"minimum": 1,
"maximum": 258,
"default": 1
},
"totalVotesPerUser": {
"type": "integer",
"minimum": 1,
"maximum": 1024,
"default": 1
},
"votesPerOption": {
"type": "integer",
"minimum": 1,
"maximum": 1024,
"default": 1
},
"global": {
"type": "boolean"
},
"disabled": {
"type": "boolean"
},
"prompt": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"userData": {},
"endsAt": {
"type": "integer",
"description": "Unix timestamp in seconds."
},
"startsAt": {
"type": "integer",
"description": "Unix timestamp in seconds."
},
"status": {
"type": "string",
"enum": [
"pending",
"active",
"expired"
],
"readOnly": true
}
}
}
}
}
Example¶
{
"id": "next-game",
"config": {
"prompt": "Choose the next game",
"options": [
"A",
"B"
],
"startsAt": 1760000000,
"endsAt": 1760003600
}
}
Responses¶
200 Response¶
Operation accepted. The current service returns an empty JSON object.
Content type: application/json
Schema¶
{
"type": "object",
"maxProperties": 0
}
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"
}
500 Error¶
The service could not complete the operation because an internal or storage dependency failed.
Content type: application/json
Schema¶
{
"type": "object",
"additionalProperties": true
}
Example¶
{
"reason": ""
}
Generated API reference
This endpoint is generated from rest-v1.yaml.