Send Chat Announcement
Sends an announcement to the broadcaster's chat room.
Rate Limits: One announcement may be sent every 2 seconds.
NOTE: When sending announcements during a Shared Chat session, behaviors differ depending on your authentication token type:
-
When using an App Access Token, announcements will only be sent to the source channel (defined by the broadcaster_id parameter) by default. Announcements can be sent to all channels by using the for_source_only parameter and setting it to
false. -
When using a User Access Token, announcements will be sent to all channels in the shared chat session, including the source channel. This behavior cannot be changed with this token type.
Endpoint
POSThttps://api.twitch.tv/helix/chat/announcements
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:announcements scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:announcements, user:bot scopes for the user represented by the moderator_id query parameter.
- The channel:bot scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room to send the announcement to.moderator_idStringRequiredThe ID of a user who has permission to moderate the broadcaster's chat room, or the broadcaster's ID if they're sending the announcement. This ID must match the user ID in the user access token.
Request Body
messageStringRequiredThe announcement to make in the broadcaster's chat room. Announcements are limited to a maximum of 500 characters; announcements longer than 500 characters are truncated.colorStringThe color used to highlight the announcement.Possible values
bluegreenorangepurpleprimaryThis is the default value.
for_source_onlyBooleanNOTE: This parameter can only be set when utilizing an App Access Token. It cannot be specified when a User Access Token is used, and will instead result in an HTTP 400 error.
Determines if the chat announcement is sent only to the source channel (defined by broadcaster_id) during a shared chat session. This has no effect if the announcement is not sent during a shared chat session.
The default value when using an App Access Token is 'true'. If you prefer to send an announcement to all channels in a shared chat session, set this parameter to 'false'.
Response Codes
- 204No Content
- Twitch accepted the announcement, though it may still be dropped before it appears in chat (for example, if AutoMod blocks it).
- 400Bad Request
- The 'message' field in the request's body is required.
- The 'message' field may not contain an empty string.
- The string in the 'message' field failed review.
- The specified color is not valid.
- Cannot set 'for_source_only' if User Access Token is used.
- 401Unauthorized
- The Authorization header is required and must contain an access token.
- The ID in moderator_id must match the user ID in the user access token.
- The user access token is missing the moderator:manage:announcements scope.
- The OAuth token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
- The sender must have authorized the app with the moderator:manage:announcements and user:bot scopes.
- The broadcaster must have authorized the app with the channel:bot scope.
- 403Forbidden
- The user in moderator_id does not have permission to send announcements in the broadcaster's chat room.
- 429Too Many Requests
- The broadcaster's chat room exceeded the number of announcements it may receive within a given window, no matter who sent them.
curl -X POST 'https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"message":"Hello chat!","color":"purple"}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"message":"Hello chat!","color":"purple"}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"message": "Hello chat!",
"color": "purple"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/chat/announcements",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "11111",
"moderator_id": "44444",
},
json={
"message": "Hello chat!",
"color": "purple",
},
)
data = response.json()body := strings.NewReader(`{"message":"Hello chat!","color":"purple"}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444", body)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"message":"Hello chat!","color":"purple"}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"message\":\"Hello chat!\",\"color\":\"purple\"}",
Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.post("https://api.twitch.tv/helix/chat/announcements?broadcaster_id=11111&moderator_id=44444")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"message": "Hello chat!",
"color": "purple"
}))
.send()
.await?;
let data = response.text().await?;Get Channel Chat Badges
Gets the broadcaster's list of custom chat badges.
The list is empty if the broadcaster hasn't created custom chat badges. For information about custom badges, see subscriber badges and Bits badges.
Endpoint
GEThttps://api.twitch.tv/helix/chat/badges
Authorization
Requires one of the following:
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose chat badges you want to get.
Response Body
dataObject[]The list of chat badges. The list is sorted in ascending order by 'set_id', and within a set, the list is sorted in ascending order by 'id'. The IDs are compared as strings, not as numbers, so '10000' sorts before '5000'.Hide child attributesShow child attributes
data.set_idStringAn ID that identifies this set of chat badges. For example, Bits or Subscriber.data.versionsObject[]The list of chat badges in this set.Hide child attributesShow child attributes
data.versions.idStringAn ID that identifies this version of the badge. The ID can be any value. For example, for Bits, the ID is the Bits tier level, but for World of Warcraft, it could be Alliance or Horde.data.versions.image_url_1xStringA URL to the small version (18px x 18px) of the badge.data.versions.image_url_2xStringA URL to the medium version (36px x 36px) of the badge.data.versions.image_url_4xStringA URL to the large version (72px x 72px) of the badge.data.versions.titleStringThe title of the badge.data.versions.descriptionStringThe description of the badge.data.versions.click_actionStringNullableThe action to take when clicking on the badge. Set to 'null' if no action is specified.data.versions.click_urlStringNullableThe URL to navigate to when clicking on the badge. Set to 'null' if no URL is specified.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's custom chat badges.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/badges",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "135093069",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/badges?broadcaster_id=135093069")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"set_id": "bits",
"versions": [
{
"id": "1",
"image_url_1x": "https://static-cdn.jtvnw.net/badges/v1/743a0f3b-84b3-450b-96a0-503d7f4a9764/1",
"image_url_2x": "https://static-cdn.jtvnw.net/badges/v1/743a0f3b-84b3-450b-96a0-503d7f4a9764/2",
"image_url_4x": "https://static-cdn.jtvnw.net/badges/v1/743a0f3b-84b3-450b-96a0-503d7f4a9764/3",
"title": "cheer 1",
"description": "cheer 1",
"click_action": "visit_url",
"click_url": "https://bits.twitch.tv"
}
]
},
{
"set_id": "subscriber",
"versions": [
{
"id": "0",
"image_url_1x": "https://static-cdn.jtvnw.net/badges/v1/eb4a8a4c-eacd-4f5e-b9f2-394348310442/1",
"image_url_2x": "https://static-cdn.jtvnw.net/badges/v1/eb4a8a4c-eacd-4f5e-b9f2-394348310442/2",
"image_url_4x": "https://static-cdn.jtvnw.net/badges/v1/eb4a8a4c-eacd-4f5e-b9f2-394348310442/3",
"title": "Subscriber",
"description": "Subscriber",
"click_action": "subscribe_to_channel",
"click_url": null
}
]
}
]
}Get Global Chat Badges
Gets Twitch's list of chat badges, which users may use in any channel's chat room. For information about chat badges, see Twitch Chat Badges Guide.
Endpoint
GEThttps://api.twitch.tv/helix/chat/badges/global
Authorization
Requires one of the following:
Response Body
dataObject[]The list of chat badges. The list is sorted in ascending order by 'set_id', and within a set, the list is sorted in ascending order by 'id'. The IDs are compared as strings, not as numbers, so '10000' sorts before '5000'.Hide child attributesShow child attributes
data.set_idStringAn ID that identifies this set of chat badges. For example, Bits or Subscriber.data.versionsObject[]The list of chat badges in this set.Hide child attributesShow child attributes
data.versions.idStringAn ID that identifies this version of the badge. The ID can be any value. For example, for Bits, the ID is the Bits tier level, but for World of Warcraft, it could be Alliance or Horde.data.versions.image_url_1xStringA URL to the small version (18px x 18px) of the badge.data.versions.image_url_2xStringA URL to the medium version (36px x 36px) of the badge.data.versions.image_url_4xStringA URL to the large version (72px x 72px) of the badge.data.versions.titleStringThe title of the badge.data.versions.descriptionStringThe description of the badge.data.versions.click_actionStringNullableThe action to take when clicking on the badge. Set to 'null' if no action is specified.data.versions.click_urlStringNullableThe URL to navigate to when clicking on the badge. Set to 'null' if no URL is specified.
Response Codes
- 200OK
- Successfully retrieved the list of global chat badges.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/badges/global' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/badges/global" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/badges/global", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/badges/global",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/badges/global", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/badges/global");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/badges/global");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/badges/global")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
...
{
"set_id": "vip",
"versions": [
{
"id": "1",
"image_url_1x": "https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/1",
"image_url_2x": "https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/2",
"image_url_4x": "https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/3",
"title": "VIP",
"description": "VIP",
"click_action": "visit_url",
"click_url": "https://help.twitch.tv/customer/en/portal/articles/659115-twitch-chat-badges-guide"
}
]
},
...
]
}Get Chatters
Gets the list of users that are connected to the broadcaster's chat session.
To determine whether a user is a moderator or VIP, use the Get Moderators and Get VIPs endpoints. You can check the roles of up to 100 users.
There is a delay between when users join and leave a chat and when the list is updated accordingly.
Endpoint
GEThttps://api.twitch.tv/helix/chat/chatters
Authorization
Requires one of the following:
- A user access token that includes the moderator:read:chatters scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:read:chatters scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose list of chatters you want to get.moderator_idStringRequiredThe ID of the broadcaster or one of the broadcaster's moderators. This ID must match the user ID in the user access token.firstIntegerThe maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 1,000. The default is 100.afterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value. Read More
Response Body
dataObject[]The list of users that are connected to the broadcaster's chat room. The list is empty if no users are connected to the chat room.Hide child attributesShow child attributes
data.user_idStringThe ID of a user that's connected to the broadcaster's chat room.data.user_loginStringThe user's login name.data.user_nameStringThe user's display name.
paginationObjectContains the information used to page through the list of results. The object is empty if there are no more pages left to page through. Read MoreHide child attributesShow child attributes
pagination.cursorStringThe cursor used to get the next page of results. Use the cursor to set the request's after query parameter.
totalIntegerThe total number of users that are connected to the broadcaster's chat room. As you page through the list, the number of users may change as users join and leave the chat room.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's list of chatters.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The first query parameter is outside the allowed range of values.
- The cursor specified in the after query parameter is not valid.
- The cursor specified in the after query parameter is past the end of the list, which can happen if users left the chat room after you got the cursor.
- 401Unauthorized
- The ID in the moderator_id query parameter must match the user ID in the access token.
- The Authorization header is required and must contain a user access token or an app access token.
- The user access token must include the moderator:read:chatters scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:read:chatters scope.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
- 403Forbidden
- The user in the moderator_id query parameter is not one of the broadcaster's moderators.
- 404Not Found
- The ID in the broadcaster_id query parameter was not found.
curl -X GET 'https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/chatters",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "123456",
"moderator_id": "654321",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "128393656",
"user_login": "smittysmithers",
"user_name": "smittysmithers"
},
...
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6NX19"
},
"total": 8
}Get User Chat Color
Gets the color used for the user's name in chat.
Endpoint
GEThttps://api.twitch.tv/helix/chat/color
Authorization
Requires one of the following:
Query Parameters
user_idStringRequiredThe ID of the user whose username color you want to get. To specify more than one user, include the user_id parameter for each user to get. For example, '&user_id=1234&user_id=5678'. The maximum number of IDs that you may specify is 100.
The API ignores duplicate IDs and IDs that weren't found, but duplicate IDs count toward the maximum.
Response Body
dataObject[]NullableThe list of users and the color code they use for their name. Is null if none of the specified users were found.Hide child attributesShow child attributes
data.user_idStringAn ID that uniquely identifies the user.data.user_loginStringThe user's login name.data.user_nameStringThe user's display name.data.colorStringThe Hex color code that the user uses in chat for their name. If the user hasn't specified a color in their settings, the string is empty.
Response Codes
- 200OK
- Successfully retrieved the chat color used by the specified users.
- 400Bad Request
- The user_id query parameter is required.
- The ID in the user_id query parameter is not valid.
- The number of user_id query parameters exceeds the maximum allowed.
- 401Unauthorized
- The Authorization header is required and must contain an app access token or user access token.
- The OAuth token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/color?user_id=11111' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/color?user_id=11111" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/color?user_id=11111", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/color",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"user_id": "11111",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/color?user_id=11111", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/color?user_id=11111");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/color?user_id=11111");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/color?user_id=11111")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "11111",
"user_name": "SpeedySpeedster1",
"user_login": "speedyspeedster1",
"color": "#9146FF"
}
]
}Update User Chat Color
Updates the color used for the user's name in chat.
Endpoint
PUThttps://api.twitch.tv/helix/chat/color
Authorization
Requires one of the following:
- A user access token that includes the user:manage:chat_color scope.
Query Parameters
user_idStringRequiredThe ID of the user whose chat color you want to update. This ID must match the user ID in the access token.colorStringRequiredThe color to use for the user's name in chat. All users may specify one of the following named color values.Possible values
(any hex code)Turbo and Prime users may specify a named color or a Hex color code such as #9146FF. If you use a Hex color code, remember to URL encode it.blueblue_violetcadet_bluechocolatecoraldodger_bluefirebrickgolden_rodgreenhot_pinkorange_redredsea_greenspring_greenyellow_green
Response Codes
- 204No Content
- Successfully updated the user's chat color.
- 400Bad Request
- The ID in the user_id query parameter is not valid.
- The color query parameter is required.
- The named color in the color query parameter is not valid.
- To specify a Hex color code, the user must be a Turbo or Prime user.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the user:manage:chat_color scope.
- The OAuth token is not valid.
- The ID in the user_id query parameter must match the user ID in the access token.
- The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
curl -X PUT 'https://api.twitch.tv/helix/chat/color?user_id=123&color=blue' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/color?user_id=123&color=blue" `
-Method Put -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/color?user_id=123&color=blue", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.put(
"https://api.twitch.tv/helix/chat/color",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"user_id": "123",
"color": "blue",
},
)
data = response.json()req, _ := http.NewRequest("PUT", "https://api.twitch.tv/helix/chat/color?user_id=123&color=blue", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/color?user_id=123&color=blue");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.twitch.tv/helix/chat/color?user_id=123&color=blue");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.put("https://api.twitch.tv/helix/chat/color?user_id=123&color=blue")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Get Channel Emotes
Gets the broadcaster's list of custom emotes.
Broadcasters create these custom emotes for users who subscribe to or follow the channel or cheer Bits in the channel's chat window. Learn More
For information about the custom emotes, see subscriber emotes, Bits tier emotes, and follower emotes.
NOTE: With the exception of custom follower emotes, users may use custom emotes in any Twitch chat.
Endpoint
GEThttps://api.twitch.tv/helix/chat/emotes
Authorization
Requires one of the following:
Query Parameters
broadcaster_idStringRequiredAn ID that identifies the broadcaster whose emotes you want to get.
Response Body
dataObject[]The list of emotes that the specified broadcaster created. If the broadcaster hasn't created custom emotes, the list is empty.Hide child attributesShow child attributes
data.idStringAn ID that identifies this emote.data.nameStringThe name of the emote. This is the name that viewers type in the chat window to get the emote to appear.data.imagesObjectThe image URLs for the emote. These image URLs always provide a static, non-animated emote image with a light background. NOTE: You should use the templated URL in the 'template' field to fetch the image instead of using these URLs.Hide child attributesShow child attributes
data.images.url_1xStringA URL to the small version (28px x 28px) of the emote.data.images.url_2xStringA URL to the medium version (56px x 56px) of the emote.data.images.url_4xStringA URL to the large version (112px x 112px) of the emote.
data.tierStringThe subscriber tier at which the emote is unlocked. This field contains the tier information only if 'emote_type' is set to 'subscriptions', otherwise, it's an empty string.data.emote_typeStringThe type of emote.Possible values
noneNo emote type was assigned to this emote.bitstierA custom Bits tier emote.followerA custom follower emote.subscriptionsA custom subscriber emote.channelpointsAn emote granted by using channel points.rewardsAn emote granted to the user through a special event.hypetrainAn emote granted for participation in a Hype Train.primeAn emote granted for linking an Amazon Prime account.turboAn emote granted for having Twitch Turbo.smiliesEmoticons supported by Twitch.globalsAn emote accessible by everyone.owl2019Emotes related to Overwatch League 2019.twofactorEmotes granted by enabling two-factor authentication on an account.limitedtimeEmotes that were granted for only a limited time.
data.emote_set_idStringAn ID that identifies the emote set that the emote belongs to.data.formatString[]The formats that the emote is available in. For example, if the emote is available only as a static PNG, the array contains only 'static'. But if the emote is available as a static PNG and an animated GIF, the array contains 'static' and 'animated'. The possible formats are:
-
animated — An animated GIF is available for this emote.
-
static — A static PNG file is available for this emote.
-
data.scaleString[]The sizes that the emote is available in. For example, if the emote is available in small and medium sizes, the array contains 1.0 and 2.0. Possible sizes are:
-
1.0 — A small version (28px x 28px) is available.
-
2.0 — A medium version (56px x 56px) is available.
-
3.0 — A large version (112px x 112px) is available.
-
data.theme_modeString[]The background themes that the emote is available in. Possible themes are:
- dark
- light
templateStringA templated URL. Use the values from the 'id', 'format', 'scale', and 'theme_mode' fields to replace the like-named placeholder strings in the templated URL to create a CDN (content delivery network) URL that you use to fetch the emote. For information about what the template looks like and how to use it to fetch emotes, see Emote CDN URL format. You should use this template instead of using the URLs in the 'images' object.
Response Codes
- 200OK
- Successfully retrieved broadcaster's list of custom emotes.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/emotes",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "141981764",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/emotes?broadcaster_id=141981764")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "304456832",
"name": "twitchdevPitchfork",
"images": {
"url_1x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/1.0",
"url_2x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/2.0",
"url_4x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/3.0"
},
"tier": "1000",
"emote_type": "subscriptions",
"emote_set_id": "301590448",
"format": [
"static"
],
"scale": [
"1.0",
"2.0",
"3.0"
],
"theme_mode": [
"light",
"dark"
]
},
...
{
"id": "emotesv2_4c3b4ed516de493bbcd2df2f5d450f49",
"name": "twitchdevHyperPitchfork",
"images": {
"url_1x": "https://static-cdn.jtvnw.net/emoticons/v2/emotesv2_4c3b4ed516de493bbcd2df2f5d450f49/static/light/1.0",
"url_2x": "https://static-cdn.jtvnw.net/emoticons/v2/emotesv2_4c3b4ed516de493bbcd2df2f5d450f49/static/light/2.0",
"url_4x": "https://static-cdn.jtvnw.net/emoticons/v2/emotesv2_4c3b4ed516de493bbcd2df2f5d450f49/static/light/3.0"
},
"tier": "1000",
"emote_type": "subscriptions",
"emote_set_id": "318939165",
"format": [
"static",
"animated"
],
"scale": [
"1.0",
"2.0",
"3.0"
],
"theme_mode": [
"light",
"dark"
]
}
],
"template": "https://static-cdn.jtvnw.net/emoticons/v2/{{id}}/{{format}}/{{theme_mode}}/{{scale}}"
}Get Global Emotes
Gets the list of global emotes. Global emotes are Twitch-created emotes that users can use in any Twitch chat.
Endpoint
GEThttps://api.twitch.tv/helix/chat/emotes/global
Authorization
Requires one of the following:
Response Body
dataObject[]The list of global emotes.Hide child attributesShow child attributes
data.idStringAn ID that identifies this emote.data.nameStringThe name of the emote. This is the name that viewers type in the chat window to get the emote to appear.data.imagesObjectThe image URLs for the emote. These image URLs always provide a static, non-animated emote image with a light background.
NOTE: You should use the templated URL in the 'template' field to fetch the image instead of using these URLs.
Hide child attributesShow child attributes
data.images.url_1xStringA URL to the small version (28px x 28px) of the emote.data.images.url_2xStringA URL to the medium version (56px x 56px) of the emote.data.images.url_4xStringA URL to the large version (112px x 112px) of the emote.
data.formatString[]The formats that the emote is available in. For example, if the emote is available only as a static PNG, the array contains only 'static'. But if the emote is available as a static PNG and an animated GIF, the array contains 'static' and 'animated'. The possible formats are:
-
animated — An animated GIF is available for this emote.
-
static — A static PNG file is available for this emote.
-
data.scaleString[]The sizes that the emote is available in. For example, if the emote is available in small and medium sizes, the array contains 1.0 and 2.0. Possible sizes are:
-
1.0 — A small version (28px x 28px) is available.
-
2.0 — A medium version (56px x 56px) is available.
-
3.0 — A large version (112px x 112px) is available.
-
data.theme_modeString[]The background themes that the emote is available in. Possible themes are:
- dark
- light
templateStringA templated URL. Use the values from the 'id', 'format', 'scale', and 'theme_mode' fields to replace the like-named placeholder strings in the templated URL to create a CDN (content delivery network) URL that you use to fetch the emote. For information about what the template looks like and how to use it to fetch emotes, see Emote CDN URL format. You should use this template instead of using the URLs in the 'images' object.
Response Codes
- 200OK
- Successfully retrieved Twitch's list of global emotes.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/emotes/global' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/emotes/global" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/emotes/global", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/emotes/global",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/emotes/global", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/emotes/global");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/emotes/global");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/emotes/global")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "196892",
"name": "TwitchUnity",
"images": {
"url_1x": "https://static-cdn.jtvnw.net/emoticons/v2/196892/static/light/1.0",
"url_2x": "https://static-cdn.jtvnw.net/emoticons/v2/196892/static/light/2.0",
"url_4x": "https://static-cdn.jtvnw.net/emoticons/v2/196892/static/light/3.0"
},
"format": [
"static"
],
"scale": [
"1.0",
"2.0",
"3.0"
],
"theme_mode": [
"light",
"dark"
]
},
...
],
"template": "https://static-cdn.jtvnw.net/emoticons/v2/{{id}}/{{format}}/{{theme_mode}}/{{scale}}"
}Get Emote Sets
Gets emotes for one or more specified emote sets.
An emote set groups emotes that have a similar context. For example, Twitch places all the subscriber emotes that a broadcaster uploads for their channel in the same emote set.
Endpoint
GEThttps://api.twitch.tv/helix/chat/emotes/set
Authorization
Requires one of the following:
Query Parameters
emote_set_idStringRequiredAn ID that identifies the emote set to get. Include this parameter for each emote set you want to get. For example, 'emote_set_id=1234&emote_set_id=5678'. You may specify a maximum of 25 IDs. The response contains only the IDs that were found and ignores duplicate IDs.
To get emote set IDs, use the Get Channel Emotes API.
Response Body
dataObject[]The list of emotes found in the specified emote sets. The list is empty if none of the IDs were found. Emotes from the same set are listed together, but the sets aren't in any particular order and may not match the order of the IDs in the request. Each set contains one or more emoticons.Hide child attributesShow child attributes
data.idStringAn ID that uniquely identifies this emote.data.nameStringThe name of the emote. This is the name that viewers type in the chat window to get the emote to appear.data.imagesObjectThe image URLs for the emote. These image URLs always provide a static, non-animated emote image with a light background.
NOTE: You should use the templated URL in the 'template' field to fetch the image instead of using these URLs.
Hide child attributesShow child attributes
data.images.url_1xStringA URL to the small version (28px x 28px) of the emote.data.images.url_2xStringA URL to the medium version (56px x 56px) of the emote.data.images.url_4xStringA URL to the large version (112px x 112px) of the emote.
data.emote_typeStringThe type of emote.Possible values
noneNo emote type was assigned to this emote.bitstierA Bits tier emote.followerA follower emote.subscriptionsA subscriber emote.channelpointsAn emote granted by using channel points.rewardsAn emote granted to the user through a special event.hypetrainAn emote granted for participation in a Hype Train.primeAn emote granted for linking an Amazon Prime account.turboAn emote granted for having Twitch Turbo.smiliesEmoticons supported by Twitch.globalsAn emote accessible by everyone.owl2019Emotes related to Overwatch League 2019.twofactorEmotes granted by enabling two-factor authentication on an account.limitedtimeEmotes that were granted for only a limited time.
data.emote_set_idStringAn ID that identifies the emote set that the emote belongs to.data.owner_idStringThe ID of the broadcaster who owns the emote.data.formatString[]The formats that the emote is available in. For example, if the emote is available only as a static PNG, the array contains only 'static'. But if the emote is available as a static PNG and an animated GIF, the array contains 'static' and 'animated'. The possible formats are:
-
animated — An animated GIF is available for this emote.
-
static — A static PNG file is available for this emote.
-
data.scaleString[]The sizes that the emote is available in. For example, if the emote is available in small and medium sizes, the array contains 1.0 and 2.0. Possible sizes are:
-
1.0 — A small version (28px x 28px) is available.
-
2.0 — A medium version (56px x 56px) is available.
-
3.0 — A large version (112px x 112px) is available.
-
data.theme_modeString[]The background themes that the emote is available in. Possible themes are:
-
dark
-
light
-
templateStringA templated URL. Use the values from the 'id', 'format', 'scale', and 'theme_mode' fields to replace the like-named placeholder strings in the templated URL to create a CDN (content delivery network) URL that you use to fetch the emote. For information about what the template looks like and how to use it to fetch emotes, see Emote CDN URL format. You should use this template instead of using the URLs in the 'images' object.
Response Codes
- 200OK
- Successfully retrieved the emotes for the specified emote sets.
- 400Bad Request
- The emote_set_id query parameter is required.
- The number of emote_set_id query parameters exceeds the maximum allowed.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/emotes/set",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"emote_set_id": "301590448",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/emotes/set?emote_set_id=301590448")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "304456832",
"name": "twitchdevPitchfork",
"images": {
"url_1x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/1.0",
"url_2x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/2.0",
"url_4x": "https://static-cdn.jtvnw.net/emoticons/v2/304456832/static/light/3.0"
},
"emote_type": "subscriptions",
"emote_set_id": "301590448",
"owner_id": "141981764",
"format": [
"static"
],
"scale": [
"1.0",
"2.0",
"3.0"
],
"theme_mode": [
"light",
"dark"
]
},
...
],
"template": "https://static-cdn.jtvnw.net/emoticons/v2/{{id}}/{{format}}/{{theme_mode}}/{{scale}}"
}Get User Emotes
Retrieves emotes available to the user across all channels.
Endpoint
GEThttps://api.twitch.tv/helix/chat/emotes/user
Authorization
Requires one of the following:
- A user access token that includes the user:read:emotes scope.The User ID associated with the token must match the user_id in the query parameter.
Query Parameters
user_idStringRequiredThe ID of the user. This ID must match the user ID in the user access token.afterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value.broadcaster_idStringThe User ID of a broadcaster you wish to get follower emotes of. Using this query parameter adds the broadcaster's follower emotes to the first page of results, if the user has access to them, for example, because the user follows the broadcaster.
Note: The response includes a broadcaster's follower emotes only if you specify that broadcaster in this parameter. Subscribing to the broadcaster doesn't add them.
Response Body
dataObject[]Hide child attributesShow child attributes
data.idStringAn ID that uniquely identifies this emote.data.nameStringThe case-sensitive name of the emote. This is the name that viewers type in the chat window to get the emote to appear.data.emote_typeStringThe type of emote. If the emote's type is not one of the following values, this field is an empty string.Possible values
noneNo emote type was assigned to this emote.bitstierA Bits tier emote.followerA follower emote.subscriptionsA subscriber emote.channelpointsAn emote granted by using channel points.rewardsAn emote granted to the user through a special event.hypetrainAn emote granted for participation in a Hype Train.primeAn emote granted for linking an Amazon Prime account.turboAn emote granted for having Twitch Turbo.smiliesEmoticons supported by Twitch.globalsAn emote accessible by everyone.owl2019Emotes related to Overwatch League 2019.twofactorEmotes granted by enabling two-factor authentication on an account.limitedtimeEmotes that were granted for only a limited time.
data.emote_set_idStringAn ID that identifies the emote set that the emote belongs to. If the emote does not belong to a set, this field will be an empty string.data.owner_idStringThe ID of the broadcaster who owns the emote. If this emote does not have an owner, this field will be an empty string.data.formatString[]The formats that the emote is available in. For example, if the emote is available only as a static PNG, the array contains only static. But if the emote is available as a static PNG and an animated GIF, the array contains static and animated.
-
animated — An animated GIF is available for this emote.
-
static — A static PNG file is available for this emote.
-
data.scaleString[]The sizes that the emote is available in. The array always contains all three sizes.
-
1.0 — A small version (28px x 28px) is available.
-
2.0 — A medium version (56px x 56px) is available.
-
3.0 — A large version (112px x 112px) is available.
-
data.theme_modeString[]The background themes that the emote is available in. The array always contains both themes.
- dark
- light
templateStringA templated URL. Uses the values from the id, format, scale, and theme_mode fields to replace the like-named placeholder strings in the templated URL to create a CDN (content delivery network) URL that you use to fetch the emote. For information about what the template looks like and how to use it to fetch emotes, see Emote CDN URL format.paginationObjectContains the information used to page through the list of results. The object is empty if there are no more pages left to page through. For more information about pagination support, see Twitch API Guide - Pagination.Hide child attributesShow child attributes
pagination.cursorStringThe cursor used to get the next page of results. Use the cursor to set the request's after query parameter.
Response Codes
- 200OK
- Successfully retrieved the emotes.
- 400Bad Request
- The user_id query parameter is required.
- The ID in the user_id query parameter is not valid.
- The ID in the broadcaster_id query parameter is not valid.
- The cursor specified in the after query parameter is not valid.
- 401Unauthorized
- The ID in user_id must match the user ID in the user access token.
- The Authorization header is required and must contain a user access token.
- The user access token must include the user:read:emotes scope.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
curl -X GET 'https://api.twitch.tv/helix/chat/emotes/user?user_id=123456' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/emotes/user?user_id=123456" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/emotes/user?user_id=123456", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/emotes/user",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"user_id": "123456",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/emotes/user?user_id=123456", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/emotes/user?user_id=123456");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/emotes/user?user_id=123456");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/emotes/user?user_id=123456")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"emote_set_id": "",
"emote_type": "hypetrain",
"format": [
"static"
],
"id": "304420818",
"name": "HypeLol",
"owner_id": "477339272",
"scale": [
"1.0",
"2.0",
"3.0"
],
"theme_mode": [
"light",
"dark"
]
}
],
"template": "https://static-cdn.jtvnw.net/emoticons/v2/{{id}}/{{format}}/{{theme_mode}}/{{scale}}",
"pagination": {
"cursor": "eyJiIjpudWxsLJxhIjoiIn0gf5"
}
}Send Chat Message
Sends a message to the broadcaster's chat room.
NOTE: When sending messages to a Shared Chat session, behaviors differ depending on your authentication token type:
-
When using an App Access Token, messages will only be sent to the source channel (defined by the broadcaster_id parameter) by default starting on May 19, 2025. Messages can be sent to all channels by using the for_source_only parameter and setting it to
false. -
When using a User Access Token, messages will be sent to all channels in the shared chat session, including the source channel. This behavior cannot be changed with this token type.
Endpoint
POSThttps://api.twitch.tv/helix/chat/messages
Authorization
Requires one of the following:
- A user access token that includes the user:write:chat scope.
- An app access token.The application, through prior authorization, must have been granted:
- The user:write:chat, user:bot scopes for the user represented by the sender_id body field.
- The channel:bot scope for the user represented by the broadcaster_id body field.
Request Body
broadcaster_idStringRequiredThe ID of the broadcaster whose chat room the message will be sent to.sender_idStringRequiredThe ID of the user sending the message. This ID must match the user ID in the user access token.messageStringRequiredThe message to send. The message is limited to a maximum of 500 characters. Chat messages can also include emoticons. To include emoticons, use the name of the emote. The names are case sensitive. Don't include colons around the name (e.g., :bleedPurple:). If Twitch recognizes the name, Twitch converts the name to the emote before writing the chat message to the chat roomreply_parent_message_idStringThe ID of the chat message being replied to.for_source_onlyBooleanNOTE: This parameter can only be set when utilizing an App Access Token. It cannot be specified when a User Access Token is used, and will instead result in an HTTP 400 error.
Determines if the chat message is sent only to the source channel (defined by broadcaster_id) during a shared chat session. This has no effect if the message is not sent during a shared chat session.
If this parameter is not set, the default value when using an App Access Token is 'true'. If you prefer to send a chat message to all channels in a shared chat session, set this parameter to 'false'.
pinBooleanNEW If true, the message will be sent and immediately pinned. Default: false. Cannot be combined with 'reply_parent_message_id' or 'for_source_only'. When 'pin' is true, additionally requires the 'moderator:manage:chat_messages' scope and the sender must be the broadcaster or a moderator. Messages pinned via this endpoint are always pinned for 20 minutes. If the pin fails, the message is not sent.
Response Body
dataObject[]Hide child attributesShow child attributes
data.message_idStringThe message id for the message that was sent.data.is_sentBooleanIf the message passed all checks and was sent.data.drop_reasonObjectNullableThe reason the message was dropped, if any. Is null if the message was sent.Hide child attributesShow child attributes
data.drop_reason.codeStringCode for why the message was dropped.Possible values
msg_duplicateThe message is identical to the previous message the sender sent less than 30 seconds ago.user_bannedThe sender is permanently banned from the chat room.user_warnedThe sender has a warning they must acknowledge before they can chat.user_timed_outThe sender is timed out in the chat room.emote_only_modeThe chat room is in emote-only mode.slow_modeThe chat room is in slow mode and the sender is sending messages too quickly.followers_only_modeThe chat room is in followers-only mode.subs_only_modeThe chat room is in subscribers-only mode.unique_modeThe chat room is in unique-chat mode and the message is not unique.verified_accountThe chat room requires a verified account to chat.channel_settingsThe message conflicts with the channel's moderation settings.automod_heldAutoMod is holding the message for review.msg_rejectedThe message could not be sent. See message for details.msg_bad_charactersThe message contains too many characters that cannot be processed.banned_email_aliasThe sender's email address is banned from the channel.banned_phone_aliasThe sender's phone number is banned from the channel.verified_phone_numberThe chat room requires a verified phone number to chat.channel_suspendedThe channel does not exist or is suspended.
data.drop_reason.messageStringMessage for why the message was dropped.
Response Codes
- 200OK
- Successfully sent the specified broadcaster a message.
- 400Bad Request
- The broadcaster_id field is required.
- The ID in the broadcaster_id field is not valid.
- The sender_id field is required.
- The ID in the sender_id field is not valid.
- The message field is required.
- The ID in the reply_parent_message_id field is not valid.
- Cannot set for_source_only if User Access Token is used.
- The reply_parent_message_id parameter is not supported when pin is true.
- The for_source_only parameter is not supported when pin is true.
- If pin is true, a message that would otherwise be dropped returns this error instead of a drop_reason.
- 401Unauthorized
- The ID in sender_id must match the user ID in the user access token.
- The Authorization header is required and must contain a user access token or an app access token.
- The user access token must include the user:write:chat scope.
- Pinning requires the moderator:manage:chat_messages scope.
- If you use an app access token, the user in sender_id must have authorized your app with the user:write:chat and user:bot scopes, and also the moderator:manage:chat_messages scope if pin is true.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the channel:bot scope, unless the user in sender_id is the broadcaster or has moderator status.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
- 403Forbidden
- The sender is not permitted to send chat messages to the broadcaster's chat room.
- 422Unprocessable Entity
- The message is too large.
- 429Too Many Requests
- The rate limit has been exceeded.
curl -X POST 'https://api.twitch.tv/helix/chat/messages' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"broadcaster_id":"12826","sender_id":"141981764","message":"Hello, world! twitchdevHype","for_source_only":true}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"broadcaster_id":"12826","sender_id":"141981764","message":"Hello, world! twitchdevHype","for_source_only":true}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/messages" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/chat/messages", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"broadcaster_id": "12826",
"sender_id": "141981764",
"message": "Hello, world! twitchdevHype",
"for_source_only": true
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/chat/messages",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
json={
"broadcaster_id": "12826",
"sender_id": "141981764",
"message": "Hello, world! twitchdevHype",
"for_source_only": true,
},
)
data = response.json()body := strings.NewReader(`{"broadcaster_id":"12826","sender_id":"141981764","message":"Hello, world! twitchdevHype","for_source_only":true}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/chat/messages", body)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/messages");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"broadcaster_id":"12826","sender_id":"141981764","message":"Hello, world! twitchdevHype","for_source_only":true}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/chat/messages");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"broadcaster_id\":\"12826\",\"sender_id\":\"141981764\",\"message\":\"Hello, world! twitchdevHype\",\"for_source_only\":true}",
Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.post("https://api.twitch.tv/helix/chat/messages")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"broadcaster_id": "12826",
"sender_id": "141981764",
"message": "Hello, world! twitchdevHype",
"for_source_only": true
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"message_id": "abc-123-def",
"is_sent": true,
"drop_reason": null
}
]
}Get Pinned Chat Message
Gets the currently pinned message for the specified broadcaster's chat room, including message fragments. Only one mod-pinned message can be active per channel at a time.
Endpoint
GEThttps://api.twitch.tv/helix/chat/pins
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:chat_messages or moderator:read:chat_messages scope.
- An app access token.The application, through prior authorization, must have been granted:
- All of the following, for the user represented by the moderator_id query parameter:
- moderator:manage:chat_messages or moderator:read:chat_messages
- user:bot
- The channel:bot scope for the user represented by the broadcaster_id query parameter.
- All of the following, for the user represented by the moderator_id query parameter:
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's chat room. This ID must match the user ID in the user access token.
Response Body
dataObject[]Pinned messages. Empty if none pinned.Hide child attributesShow child attributes
data.message_idStringThe ID of the pinned chat message.data.broadcaster_idStringThe ID of the broadcaster.data.sender_user_idStringThe ID of the user who sent the pinned message.data.sender_user_loginStringThe login of the user who sent the pinned message.data.sender_user_nameStringThe display name of the user who sent the pinned message.data.pinned_by_user_idStringThe ID of the user who pinned the message.data.pinned_by_user_loginStringThe login of the user who pinned the message.data.pinned_by_user_nameStringThe display name of the user who pinned the message.data.messageObjectNullableThe pinned message content. Null if the content isn't available.Hide child attributesShow child attributes
data.message.textStringPlain text of the message.data.message.fragmentsObject[]Ordered list of message fragments.Hide child attributesShow child attributes
data.message.fragments.typeStringThe fragment type.Possible values
textemotecheermotemention
data.message.fragments.textStringFragment text.data.message.fragments.cheermoteObjectNullableCheermote metadata. Null if not a cheermote fragment.Hide child attributesShow child attributes
data.message.fragments.cheermote.prefixStringThe cheermote prefix.data.message.fragments.cheermote.bitsIntegerThe number of bits cheered.data.message.fragments.cheermote.tierIntegerThe cheermote tier.
data.message.fragments.emoteObjectNullableEmote metadata. Null if not an emote fragment.Hide child attributesShow child attributes
data.message.fragments.emote.idStringThe emote ID.data.message.fragments.emote.emote_set_idStringThe emote set ID.data.message.fragments.emote.owner_idStringThe ID of the emote owner.data.message.fragments.emote.formatString[]The emote's format, as a single-item list: 'animated' if the emote is animated; otherwise, 'static'.
data.message.fragments.mentionObjectNullableMention metadata. Null if not a mention fragment.Hide child attributesShow child attributes
data.message.fragments.mention.user_idStringThe mentioned user's ID.data.message.fragments.mention.user_loginStringThe mentioned user's login.data.message.fragments.mention.user_nameStringThe mentioned user's display name.
data.starts_atStringRFC3339 timestamp of when the message was pinned.data.ends_atStringNullableRFC3339 expiry timestamp. Null if pinned until stream ends.data.updated_atStringRFC3339 timestamp of last update.
Response Codes
- 200OK
- Successfully retrieved pinned message(s).
- 400Bad Request
- A required query parameter is missing.
- 401Unauthorized
- The Authorization header is required and must specify a user access token or app access token.
- The ID in moderator_id must match the user ID in the user access token.
- The user access token must include the moderator:manage:chat_messages or moderator:read:chat_messages scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the user:bot scope and either the moderator:manage:chat_messages or moderator:read:chat_messages scope.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the channel:bot scope.
- 403Forbidden
- The user in moderator_id doesn't have permission to pin messages in the broadcaster's chat room.
- 500Internal Server Error
- An unexpected error occurred.
curl -X GET 'https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/pins",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "197886470",
"moderator_id": "141981764",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"message_id": "abc-def-123-456",
"broadcaster_id": "197886470",
"sender_user_id": "12826",
"sender_user_login": "twitch",
"sender_user_name": "Twitch",
"pinned_by_user_id": "141981764",
"pinned_by_user_login": "twitchdev",
"pinned_by_user_name": "TwitchDev",
"message": {
"text": "Welcome! bleedPurple Type !rules",
"fragments": [
{
"type": "text",
"text": "Welcome! ",
"cheermote": null,
"emote": null,
"mention": null
},
{
"type": "emote",
"text": "bleedPurple",
"cheermote": null,
"emote": {
"id": "62835",
"emote_set_id": "0",
"owner_id": "0",
"format": [
"static"
]
},
"mention": null
},
{
"type": "text",
"text": " Type !rules",
"cheermote": null,
"emote": null,
"mention": null
}
]
},
"starts_at": "2026-05-06T12:30:00Z",
"ends_at": "2026-05-06T12:35:00Z",
"updated_at": "2026-05-06T12:30:00Z"
}
]
}Pin Chat Message
Pins a chat message to the top of the specified broadcaster's chat room. Only one mod-pinned message can be active per channel at a time. If a mod-pinned message already exists, it is automatically replaced.
Endpoint
PUThttps://api.twitch.tv/helix/chat/pins
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:chat_messages scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:chat_messages, user:bot scopes for the user represented by the moderator_id query parameter.
- The channel:bot scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's chat room. This ID must match the user ID in the user access token.message_idStringRequiredThe ID of the message to pin.duration_secondsIntegerThe number of seconds the message should be pinned for. Minimum: 30. Maximum: 1800. If not specified, the message will be pinned until the stream ends.
Response Codes
- 204No Content
- Successfully pinned the message.
- 400Bad Request
- A required query parameter is missing or invalid.
- The duration_seconds value is invalid.
- 401Unauthorized
- The Authorization header is required and must specify a user access token or app access token.
- The ID in moderator_id must match the user ID in the user access token.
- The user access token must include the moderator:manage:chat_messages scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:chat_messages and user:bot scopes.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the channel:bot scope.
- 403Forbidden
- The user does not have permission to pin messages in this channel.
- 404Not Found
- The specified message was not found.
- 409Conflict
- The message is already pinned.
- 429Too Many Requests
- The rate limit for pinning messages has been exceeded.
curl -X PUT 'https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300" `
-Method Put -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.put(
"https://api.twitch.tv/helix/chat/pins",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "197886470",
"moderator_id": "141981764",
"message_id": "4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f",
"duration_seconds": "300",
},
)
data = response.json()req, _ := http.NewRequest("PUT", "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.put("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=300")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;204 No ContentUpdate Pinned Chat Message
Updates the duration of an existing pinned chat message.
Endpoint
PATCHhttps://api.twitch.tv/helix/chat/pins
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:chat_messages scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:chat_messages, user:bot scopes for the user represented by the moderator_id query parameter.
- The channel:bot scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's chat room. This ID must match the user ID in the user access token.message_idStringRequiredThe ID of the pinned message to update.duration_secondsIntegerThe new number of seconds the message should remain pinned, starting from now. Minimum: 30. Maximum: 1800. If not specified, the message will be pinned until the stream ends.
Response Codes
- 204No Content
- Successfully updated the pinned message.
- 400Bad Request
- A required query parameter is missing or invalid.
- The duration_seconds value is invalid.
- The specified message must have been pinned by the broadcaster or a moderator.
- 401Unauthorized
- The Authorization header is required and must specify a user access token or app access token.
- The ID in moderator_id must match the user ID in the user access token.
- The user access token must include the moderator:manage:chat_messages scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:chat_messages and user:bot scopes.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the channel:bot scope.
- 403Forbidden
- The user does not have permission to update pinned messages in this channel.
- 404Not Found
- The specified pinned message was not found.
- 429Too Many Requests
- The rate limit for updating pinned messages has been exceeded.
curl -X PATCH 'https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600" `
-Method Patch -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.patch(
"https://api.twitch.tv/helix/chat/pins",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "197886470",
"moderator_id": "141981764",
"message_id": "4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f",
"duration_seconds": "600",
},
)
data = response.json()req, _ := http.NewRequest("PATCH", "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.patch("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f&duration_seconds=600")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;204 No ContentUnpin Chat Message
Unpins a pinned chat message from the specified broadcaster's chat room.
Endpoint
DELETEhttps://api.twitch.tv/helix/chat/pins
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:chat_messages scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:chat_messages, user:bot scopes for the user represented by the moderator_id query parameter.
- The channel:bot scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's chat room. This ID must match the user ID in the user access token.message_idStringRequiredThe ID of the message to unpin.
Response Codes
- 204No Content
- Successfully unpinned the message.
- 400Bad Request
- A required query parameter is missing.
- 401Unauthorized
- The Authorization header is required and must specify a user access token or app access token.
- The ID in moderator_id must match the user ID in the user access token.
- The user access token must include the moderator:manage:chat_messages scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:chat_messages and user:bot scopes.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the channel:bot scope.
- 403Forbidden
- The user does not have permission to unpin messages in this channel.
- 404Not Found
- The specified pinned message was not found.
- 429Too Many Requests
- The rate limit for unpinning messages has been exceeded.
curl -X DELETE 'https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.delete(
"https://api.twitch.tv/helix/chat/pins",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "197886470",
"moderator_id": "141981764",
"message_id": "4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.delete("https://api.twitch.tv/helix/chat/pins?broadcaster_id=197886470&moderator_id=141981764&message_id=4f2b6c1e-8a3d-4b7e-9c5f-2d1a0e3b7c9f")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;204 No ContentGet Chat Settings
Gets the broadcaster's chat settings.
For an overview of chat settings, see Chat Commands for Broadcasters and Moderators and Moderator Preferences.
Endpoint
GEThttps://api.twitch.tv/helix/chat/settings
Authorization
Requires one of the following:
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose chat settings you want to get.moderator_idStringThe ID of the broadcaster or one of the broadcaster's moderators.
This field is required only if you want to include the 'non_moderator_chat_delay' and 'non_moderator_chat_delay_duration' settings in the response.
To get these settings, this ID must match the user ID in the user access token. If it doesn't, or if you use an app access token, the request still succeeds but the response doesn't include these settings.
Response Body
dataObject[]The list of chat settings. The list contains a single object with all the settings.Hide child attributesShow child attributes
data.broadcaster_idStringThe ID of the broadcaster specified in the request.data.emote_modeBooleanA Boolean value that determines whether chat messages must contain only emotes. Is true if chat messages may contain only emotes; otherwise, false.data.follower_modeBooleanA Boolean value that determines whether the broadcaster restricts the chat room to followers only.
Is true if the broadcaster restricts the chat room to followers only; otherwise, false.
See the 'follower_mode_duration' field for how long users must follow the broadcaster before being able to participate in the chat room.
data.follower_mode_durationIntegerNullableThe length of time, in minutes, that users must follow the broadcaster before being able to participate in the chat room. Is null if 'follower_mode' is false.data.moderator_idStringThe moderator's ID. The response includes this field only if it also includes the 'non_moderator_chat_delay' and 'non_moderator_chat_delay_duration' fields.data.non_moderator_chat_delayBooleanA Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message. See the 'non_moderator_chat_delay_duration' field for the length of the delay. Is true if the broadcaster applies a delay; otherwise, false.
The response includes this field only if the request specifies a user access token that includes the moderator:read:chat_settings or moderator:manage:chat_settings scope, the ID in the moderator_id query parameter matches the user ID in the token, and that user is the broadcaster or a moderator with permission to view the chat delay settings.
data.non_moderator_chat_delay_durationIntegerNullableThe amount of time, in seconds, that messages are delayed before appearing in chat. Is null if 'non_moderator_chat_delay' is false.
The response includes this field only if the request specifies a user access token that includes the moderator:read:chat_settings or moderator:manage:chat_settings scope, the ID in the moderator_id query parameter matches the user ID in the token, and that user is the broadcaster or a moderator with permission to view the chat delay settings.
data.slow_modeBooleanA Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.
Is true if the broadcaster applies a delay; otherwise, false.
See the 'slow_mode_wait_time' field for the delay.
data.slow_mode_wait_timeIntegerNullableThe amount of time, in seconds, that users must wait between sending messages. Is null if slow_mode is false.data.subscriber_modeBooleanA Boolean value that determines whether only users that subscribe to the broadcaster's channel may talk in the chat room.
Is true if the broadcaster restricts the chat room to subscribers only; otherwise, false.
data.unique_chat_modeBooleanA Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.
Is true if the broadcaster requires unique messages only; otherwise, false.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's chat settings.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- 401Unauthorized
- The Authorization header is required and must specify a valid app access token or user access token.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
curl -X GET 'https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/chat/settings",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "1234",
"moderator_id": "5678",
"slow_mode": false,
"slow_mode_wait_time": null,
"follower_mode": true,
"follower_mode_duration": 0,
"subscriber_mode": false,
"emote_mode": false,
"unique_chat_mode": false,
"non_moderator_chat_delay": true,
"non_moderator_chat_delay_duration": 4
}
]
}Update Chat Settings
Updates the broadcaster's chat settings.
Endpoint
PATCHhttps://api.twitch.tv/helix/chat/settings
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:chat_settings scope.The User ID associated with the token must match the moderator_id in the query parameter.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:chat_settings scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose chat settings you want to update.moderator_idStringRequiredThe ID of a user that has permission to moderate the broadcaster's chat room, or the broadcaster's ID if they're making the update. This ID must match the user ID in the user access token.
Request Body
emote_modeBooleanA Boolean value that determines whether chat messages must contain only emotes. Set to true if only emotes are allowed; otherwise, false. The default is false.follower_modeBooleanA Boolean value that determines whether the broadcaster restricts the chat room to followers only.
Set to true if the broadcaster restricts the chat room to followers only; otherwise, false. The default is false.
To specify how long users must follow the broadcaster before being able to participate in the chat room, see the 'follower_mode_duration' field.
follower_mode_durationIntegerThe length of time, in minutes, that users must follow the broadcaster before being able to participate in the chat room. Set only if 'follower_mode' is true. Possible values are: 0 (no restriction) through 129600 (3 months). The default is 0.non_moderator_chat_delayBooleanA Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message.
Set to true if the broadcaster applies a delay; otherwise, false. The default is false.
To specify the length of the delay, see the 'non_moderator_chat_delay_duration' field.
non_moderator_chat_delay_durationIntegerThe amount of time, in seconds, that messages are delayed before appearing in chat. Set only if 'non_moderator_chat_delay' is true.Possible values
22 second delay (recommended)44 second delay66 second delay
slow_modeBooleanA Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages. Set to true if the broadcaster applies a wait period between messages; otherwise, false. The default is false.
To specify the delay, see the 'slow_mode_wait_time' field.
slow_mode_wait_timeIntegerThe amount of time, in seconds, that users must wait between sending messages. Set only if slow_mode is true.
Possible values are 3 (3 second delay) through 120 (2 minute delay). The default is 30 seconds.
subscriber_modeBooleanA Boolean value that determines whether only users that subscribe to the broadcaster's channel may talk in the chat room.
Set to true if the broadcaster restricts the chat room to subscribers only; otherwise, false. The default is false.
unique_chat_modeBooleanA Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.
Set to true if the broadcaster allows only unique messages; otherwise, false. The default is false.
Response Body
dataObject[]The list of chat settings. The list contains a single object with all the settings.Hide child attributesShow child attributes
data.broadcaster_idStringThe ID of the broadcaster specified in the request.data.emote_modeBooleanA Boolean value that determines whether chat messages must contain only emotes. Is true if chat messages may contain only emotes; otherwise, false.data.follower_modeBooleanA Boolean value that determines whether the broadcaster restricts the chat room to followers only.
Is true if the broadcaster restricts the chat room to followers only; otherwise, false.
See the 'follower_mode_duration' field for how long users must follow the broadcaster before being able to participate in the chat room.
data.follower_mode_durationIntegerThe length of time, in minutes, that users must follow the broadcaster before being able to participate in the chat room. Is null if 'follower_mode' is false.data.moderator_idStringThe ID of the moderator specified in the request.data.non_moderator_chat_delayBooleanA Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message. See the 'non_moderator_chat_delay_duration' field for the length of the delay. Is true if the broadcaster applies a delay; otherwise, false.data.non_moderator_chat_delay_durationIntegerThe amount of time, in seconds, that messages are delayed before appearing in chat. Is null if 'non_moderator_chat_delay' is false.data.slow_modeBooleanA Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.
Is true if the broadcaster applies a delay; otherwise, false.
See the 'slow_mode_wait_time' field for the delay.
data.slow_mode_wait_timeIntegerThe amount of time, in seconds, that users must wait between sending messages. Is null if slow_mode is false.data.subscriber_modeBooleanA Boolean value that determines whether only users that subscribe to the broadcaster's channel may talk in the chat room.
Is true if the broadcaster restricts the chat room to subscribers only; otherwise, false.
data.unique_chat_modeBooleanA Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.
Is true if the broadcaster requires unique messages only; otherwise, false.
Response Codes
- 200OK
- Successfully updated the broadcaster's chat settings.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- The moderator_id query parameter is required.
- The ID in the moderator_id query parameter is not valid.
- If slow_mode is true and the request includes slow_mode_wait_time, its value must be in the range 3 through 120.
- If follower_mode is true and the request includes follower_mode_duration, its value must be in the range 0 through 129600.
- If 'non_moderator_chat_delay' is true, the 'non_moderator_chat_delay_duration' field must be set to a valid value.
- If the request includes slow_mode_wait_time, it must also include slow_mode.
- If the request includes follower_mode_duration, it must also include follower_mode.
- If the request includes non_moderator_chat_delay_duration, it must also include non_moderator_chat_delay.
- 401Unauthorized
- The ID in the moderator_id query parameter must match the user ID in the user access token.
- The Authorization header is required and must contain a user access token or an app access token.
- The user access token must include the moderator:manage:chat_settings scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:chat_settings scope.
- The access token is not valid.
- The ID in the Client-Id header must match the client ID in the access token.
- 403Forbidden
- The user in the moderator_id query parameter must have moderator privileges in the broadcaster's channel.
curl -X PATCH 'https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"follower_mode":false}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"follower_mode":false}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678" `
-Method Patch -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"follower_mode": false
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://api.twitch.tv/helix/chat/settings",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
},
json={
"follower_mode": false,
},
)
data = response.json()body := strings.NewReader(`{"follower_mode":false}`)
req, _ := http.NewRequest("PATCH", "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678", body)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"follower_mode":false}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"follower_mode\":false}",
Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.patch("https://api.twitch.tv/helix/chat/settings?broadcaster_id=1234&moderator_id=5678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"follower_mode": false
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "1234",
"moderator_id": "5678",
"slow_mode": true,
"slow_mode_wait_time": 10,
"follower_mode": false,
"follower_mode_duration": null,
"subscriber_mode": false,
"emote_mode": false,
"unique_chat_mode": false,
"non_moderator_chat_delay": false,
"non_moderator_chat_delay_duration": null
}
]
}Send a Shoutout
Sends a Shoutout to the specified broadcaster.
Typically, you send Shoutouts when you or one of your moderators notice another broadcaster in your chat, the other broadcaster is coming up in conversation, or after they raid your broadcast.
Twitch's Shoutout feature is a great way for you to show support for other broadcasters and help them grow. Viewers who do not follow the other broadcaster will see a pop-up Follow button in your chat that they can click to follow the other broadcaster. Learn More
Rate Limits: The broadcaster may send a Shoutout once every 2 minutes. They may send the same broadcaster a Shoutout once every 60 minutes.
To receive notifications when a Shoutout is sent or received, subscribe to the channel.shoutout.create and channel.shoutout.receive subscription types. The channel.shoutout.create event includes cooldown periods that indicate when the broadcaster may send another Shoutout without exceeding the endpoint's rate limit.
Endpoint
POSThttps://api.twitch.tv/helix/chat/shoutouts
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:shoutouts scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:shoutouts, user:bot scopes for the user represented by the moderator_id query parameter.
- The channel:bot scope for the user represented by the from_broadcaster_id query parameter.
Query Parameters
from_broadcaster_idStringRequiredThe ID of the broadcaster that's sending the Shoutout.to_broadcaster_idStringRequiredThe ID of the broadcaster that's receiving the Shoutout.moderator_idStringRequiredThe ID of the broadcaster or a user that is one of the broadcaster's moderators. This ID must match the user ID in the access token.
Response Codes
- 204No Content
- Successfully sent the specified broadcaster a Shoutout.
- 400Bad Request
- The from_broadcaster_id query parameter is required.
- The ID in the from_broadcaster_id query parameter is not valid.
- The to_broadcaster_id query parameter is required.
- The ID in the to_broadcaster_id query parameter is not valid.
- The broadcaster may not give themselves a Shoutout.
- The broadcaster is not streaming live.
- 401Unauthorized
- The ID in moderator_id must match the user ID in the user access token.
- The Authorization header is required and must contain a user access token or an app access token.
- The user access token must include the moderator:manage:shoutouts scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:shoutouts and user:bot scopes.
- If you use an app access token, the user in from_broadcaster_id must have authorized your app with the channel:bot scope.
- The access token is not valid.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
- 403Forbidden
- The user in moderator_id is not one of the broadcaster's moderators.
- The broadcaster may not send the specified broadcaster a Shoutout.
- 429Too Many Requests
- The broadcaster exceeded the number of Shoutouts they may send within a given window. See the endpoint's Rate Limits.
- The broadcaster exceeded the number of Shoutouts they may send the same broadcaster within a given window. See the endpoint's Rate Limits.
curl -X POST 'https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765" `
-Method Post -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/chat/shoutouts",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"from_broadcaster_id": "12345",
"to_broadcaster_id": "626262",
"moderator_id": "98765",
},
)
data = response.json()req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.post("https://api.twitch.tv/helix/chat/shoutouts?from_broadcaster_id=12345&to_broadcaster_id=626262&moderator_id=98765")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Get Shared Chat Session
Retrieves the active shared chat session for a channel.
Endpoint
GEThttps://api.twitch.tv/helix/shared_chat/session
Authorization
Requires one of the following:
Query Parameters
broadcaster_idStringRequiredThe User ID of the channel broadcaster.
Response Body
dataObject[]Hide child attributesShow child attributes
data.session_idStringThe unique identifier for the shared chat session.data.host_broadcaster_idStringThe User ID of the host channel.data.participantsObject[]The list of channels that are active participants in the session. Channels that were invited but haven't joined, or that left the session, aren't included.Hide child attributesShow child attributes
data.participants.broadcaster_idStringThe User ID of the participant channel.
data.created_atStringThe UTC date and time (in RFC3339 format) for when the session was created. The timestamp may include fractional seconds.data.updated_atStringThe UTC date and time (in RFC3339 format) for when the session was last updated. The timestamp may include fractional seconds.
Response Codes
- 200OK
- Successfully retrieved the shared chat session. Returns an empty array if the broadcaster_id in the request isn't in an active shared chat session.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- 401Unauthorized
- The OAuth token is not valid.
- The Authorization header is required and must contain a user access token.
- 500Internal Error
- Internal Server Error.
curl -X GET 'https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.twitch.tv/helix/shared_chat/session",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "198704263",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Client-Id", "YOUR_CLIENT_ID")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)$ch = curl_init("https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Client-Id: YOUR_CLIENT_ID",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();let client = reqwest::Client::new();
let response = client
.get("https://api.twitch.tv/helix/shared_chat/session?broadcaster_id=198704263")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"session_id": "359bce59-fa4e-41a5-bd6f-9bc0c8360485",
"host_broadcaster_id": "198704263",
"participants": [{
"broadcaster_id": "198704263"
}, {
"broadcaster_id": "487263401"
}],
"created_at": "2024-09-29T19:45:37Z",
"updated_at": "2024-09-29T19:45:37Z"
}
]
}