Get VIPs
Gets a list of the broadcaster's VIPs.
Endpoint
GEThttps://api.twitch.tv/helix/channels/vips
Authorization
Requires one of the following:
- A user access token that includes the channel:read:vips or channel:manage:vips scope.
Query Parameters
user_idStringFilters the list for specific VIPs. 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. Ignores the ID of those users in the list that aren't VIPs.broadcaster_idStringRequiredThe ID of the broadcaster whose list of VIPs you want to get. This ID must match the user ID in the 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 100. The default is 20. Ignored if you specify user_id.afterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value. Ignored if you specify user_id. Read More
Response Body
dataObject[]The list of VIPs. The list is empty if the broadcaster doesn't have VIP users.Hide child attributesShow child attributes
data.user_idStringAn ID that uniquely identifies the VIP user.data.user_nameStringThe user's display name.data.user_loginStringThe user's login name.
paginationObjectContains the information used to page through the list of results. The object is empty if the page contains no VIPs or you specified user_id. The last page of VIPs still contains a cursor; using it returns an empty page. 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.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's list of VIPs.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- The ID in the user_id query parameter is not valid.
- The number of user_id query parameters exceeds the maximum allowed.
- The first query parameter is outside the allowed range of values.
- The pagination cursor is not valid.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:read:vips or channel:manage:vips scope.
- The OAuth token is not valid.
- The ID in the broadcaster_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 GET 'https://api.twitch.tv/helix/channels/vips?broadcaster_id=123' \
-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/channels/vips?broadcaster_id=123" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/channels/vips?broadcaster_id=123", {
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/channels/vips",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "123",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/channels/vips?broadcaster_id=123", 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/channels/vips?broadcaster_id=123");
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/channels/vips?broadcaster_id=123");
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/channels/vips?broadcaster_id=123")
.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": "UserDisplayName",
"user_login": "userloginname"
},
...
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6NX19"
}
}Add Channel VIP
Adds the specified user as a VIP in the broadcaster's channel.
Rate Limits: The broadcaster may add a maximum of 10 VIPs within a 10-second window.
Endpoint
POSThttps://api.twitch.tv/helix/channels/vips
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:vips scope.
Query Parameters
user_idStringRequiredThe ID of the user to give VIP status to.broadcaster_idStringRequiredThe ID of the broadcaster that's adding the user as a VIP. This ID must match the user ID in the access token.
Response Codes
- 204No Content
- Successfully added the VIP.
- 400Bad Request
- The user in the user_id query parameter is banned from the broadcaster's channel.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:vips scope.
- The OAuth token is not valid.
- The ID in the broadcaster_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.
- 404Not Found
- The ID in broadcaster_id was not found.
- The ID in user_id was not found.
- 409Conflict
- The broadcaster doesn't have available VIP slots. Read More
- 422Unprocessable Entity
- The user in user_id is a moderator. To make them a VIP, you must first remove them as a moderator (see Remove Channel Moderator).
- The user in the user_id query parameter is already a VIP.
- 429Too Many Requests
- The broadcaster exceeded the number of VIP that they may add within a 10-second window. See Rate Limits for this endpoint above.
curl -X POST 'https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456' \
-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/channels/vips?broadcaster_id=123&user_id=456" `
-Method Post -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456", {
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/channels/vips",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "123",
"user_id": "456",
},
)
data = response.json()req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456", 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/channels/vips?broadcaster_id=123&user_id=456");
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/channels/vips?broadcaster_id=123&user_id=456");
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/channels/vips?broadcaster_id=123&user_id=456")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Remove Channel VIP
Removes the specified user as a VIP in the broadcaster's channel.
If the broadcaster is removing the user's VIP status, the ID in the broadcaster_id query parameter must match the user ID in the access token; otherwise, if the user is removing their VIP status themselves, the ID in the user_id query parameter must match the user ID in the access token.
Rate Limits: The broadcaster may remove a maximum of 10 VIPs within a 10-second window.
Endpoint
DELETEhttps://api.twitch.tv/helix/channels/vips
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:vips scope.
Query Parameters
user_idStringRequiredThe ID of the user to remove VIP status from.broadcaster_idStringRequiredThe ID of the broadcaster who owns the channel where the user has VIP status.
Response Codes
- 204No Content
- Successfully removed the VIP status from the user.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The user_id query parameter is required.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:vips scope.
- The OAuth token is not valid.
- The ID in the broadcaster_id query parameter must match the user ID in the access token, unless the user ID in the access token is removing themselves as a VIP.
- The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
- 404Not Found
- The ID in broadcaster_id was not found.
- 422Unprocessable Entity
- The user in user_id is not a VIP in the broadcaster's channel.
- 429Too Many Requests
- The broadcaster exceeded the number of VIPs that they may remove within a 10-second window. See Rate Limits for this endpoint above.
curl -X DELETE 'https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456' \
-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/channels/vips?broadcaster_id=123&user_id=456" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456", {
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/channels/vips",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "123",
"user_id": "456",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/channels/vips?broadcaster_id=123&user_id=456", 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/channels/vips?broadcaster_id=123&user_id=456");
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/channels/vips?broadcaster_id=123&user_id=456");
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/channels/vips?broadcaster_id=123&user_id=456")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Manage Held AutoMod Messages
Allow or deny the message that AutoMod flagged for review.
For information about AutoMod, see How to Use AutoMod.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/automod/message
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:automod scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:automod scope for the user represented by the user_id body field.
Request Body
user_idStringRequiredThe moderator who is approving or denying the held message. This ID must match the user ID in the access token.msg_idStringRequiredThe ID of the message to allow or deny.actionStringRequiredThe action to take for the message. The value is case insensitive.Possible values
ALLOWDENY
Response Codes
- 204No Content
- Successfully approved or denied the message.
- 400Bad Request
- The value in the 'action' field is not valid.
- The user_id field is required.
- The 'msg_id' field is required.
- The 'action' field is required.
- The message was already allowed or denied, or it can't be allowed (for example, because it expired).
- The message's status was changed by another request at the same time.
- 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 or an app access token.
- The user access token must include the moderator:manage:automod scope.
- If you use an app access token, the user in user_id must have authorized your app with the moderator:manage:automod 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 user_id is not one of the broadcaster's moderators.
- 404Not Found
- The message specified in the 'msg_id' field was not found.
curl -X POST 'https://api.twitch.tv/helix/moderation/automod/message' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"user_id":"9327994","msg_id":"836013710","action":"ALLOW"}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"user_id":"9327994","msg_id":"836013710","action":"ALLOW"}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/automod/message" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/automod/message", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"user_id": "9327994",
"msg_id": "836013710",
"action": "ALLOW"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/automod/message",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
json={
"user_id": "9327994",
"msg_id": "836013710",
"action": "ALLOW",
},
)
data = response.json()body := strings.NewReader(`{"user_id":"9327994","msg_id":"836013710","action":"ALLOW"}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/automod/message", 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/moderation/automod/message");
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, '{"user_id":"9327994","msg_id":"836013710","action":"ALLOW"}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/automod/message");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"user_id\":\"9327994\",\"msg_id\":\"836013710\",\"action\":\"ALLOW\"}",
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/moderation/automod/message")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"user_id": "9327994",
"msg_id": "836013710",
"action": "ALLOW"
}))
.send()
.await?;
let data = response.text().await?;Get AutoMod Settings
Gets the broadcaster's AutoMod settings. These settings are used to automatically block inappropriate or harassing messages from appearing in the broadcaster's chat room.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/automod/settings
Authorization
Requires one of the following:
- A user access token that includes the moderator:read:automod_settings or moderator:manage:automod_settings scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:read:automod_settings or moderator:manage:automod_settings scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose AutoMod settings you want to get.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[]The list of AutoMod settings. The list contains a single object that contains all the AutoMod settings.Hide child attributesShow child attributes
data.broadcaster_idStringThe broadcaster's ID.data.moderator_idStringThe moderator's ID.data.overall_levelIntegerNullableThe default AutoMod level for the broadcaster. This field is null if the individual settings don't match one of the default levels, such as when the broadcaster has set one or more of the individual settings. It's also null, and every individual setting is 0, if the broadcaster hasn't configured AutoMod.data.disabilityIntegerThe Automod level for discrimination against disability.data.aggressionIntegerThe Automod level for hostility involving aggression.data.sexuality_sex_or_genderIntegerThe AutoMod level for discrimination based on sexuality, sex, or gender.data.misogynyIntegerThe Automod level for discrimination against women.data.bullyingIntegerThe Automod level for hostility involving name calling or insults.data.swearingIntegerThe Automod level for profanity.data.race_ethnicity_or_religionIntegerThe Automod level for racial discrimination.data.sex_based_termsIntegerThe Automod level for sexual content.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's AutoMod settings.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The IDs in broadcaster_id and moderator_id must be positive integers.
- 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:read:automod_settings or moderator:manage:automod_settings scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:read:automod_settings or moderator:manage:automod_settings 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.
curl -X GET 'https://api.twitch.tv/helix/moderation/automod/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/moderation/automod/settings?broadcaster_id=1234&moderator_id=5678" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/automod/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/moderation/automod/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/moderation/automod/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/moderation/automod/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/moderation/automod/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/moderation/automod/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",
"overall_level": null,
"disability": 0,
"aggression": 0,
"sexuality_sex_or_gender": 0,
"misogyny": 0,
"bullying": 0,
"swearing": 0,
"race_ethnicity_or_religion": 0,
"sex_based_terms": 0
}
]
}Update AutoMod Settings
Updates the broadcaster's AutoMod settings.
The settings are used to automatically block inappropriate or harassing messages from appearing in the broadcaster's chat room.
Each setting, including overall_level, accepts a level from 0 through 4.
If you set individual settings, any individual setting that you don't include is set to 0. To change only some settings, get the current settings with Get AutoMod Settings and include all of them in the request.
Endpoint
PUThttps://api.twitch.tv/helix/moderation/automod/settings
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:automod_settings scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:automod_settings scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose AutoMod settings you want to update.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.
Request Body
aggressionIntegerThe Automod level for hostility involving aggression.bullyingIntegerThe Automod level for hostility involving name calling or insults.disabilityIntegerThe Automod level for discrimination against disability.misogynyIntegerThe Automod level for discrimination against women.overall_levelIntegerThe default AutoMod level for the broadcaster.race_ethnicity_or_religionIntegerThe Automod level for racial discrimination.sex_based_termsIntegerThe Automod level for sexual content.sexuality_sex_or_genderIntegerThe AutoMod level for discrimination based on sexuality, sex, or gender.swearingIntegerThe Automod level for profanity.
Response Body
dataObject[]The list of AutoMod settings. The list contains a single object that contains all the AutoMod settings.Hide child attributesShow child attributes
data.broadcaster_idStringThe broadcaster's ID.data.moderator_idStringThe moderator's ID.data.overall_levelIntegerNullableThe default AutoMod level for the broadcaster. This field is null if the broadcaster has set one or more of the individual settings.data.disabilityIntegerThe Automod level for discrimination against disability.data.aggressionIntegerThe Automod level for hostility involving aggression.data.sexuality_sex_or_genderIntegerThe AutoMod level for discrimination based on sexuality, sex, or gender.data.misogynyIntegerThe Automod level for discrimination against women.data.bullyingIntegerThe Automod level for hostility involving name calling or insults.data.swearingIntegerThe Automod level for profanity.data.race_ethnicity_or_religionIntegerThe Automod level for racial discrimination.data.sex_based_termsIntegerThe Automod level for sexual content.
Response Codes
- 200Ok
- Successfully updated the broadcaster's AutoMod settings.
- 400Bad Request
- The broadcaster_id is required.
- The moderator_id is required.
- The 'overall_level' setting or one or more individual settings like 'aggression' is required; the overall and individual settings are mutually exclusive, so don't set both.
- The value of one or more AutoMod settings is not valid.
- 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:automod_settings scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:automod_settings 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.
curl -X PUT 'https://api.twitch.tv/helix/moderation/automod/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 '{"overall_level":3}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"overall_level":3}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/automod/settings?broadcaster_id=1234&moderator_id=5678" `
-Method Put -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/automod/settings?broadcaster_id=1234&moderator_id=5678", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"overall_level": 3
}),
});
const data = await response.json();import requests
response = requests.put(
"https://api.twitch.tv/helix/moderation/automod/settings",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
},
json={
"overall_level": 3,
},
)
data = response.json()body := strings.NewReader(`{"overall_level":3}`)
req, _ := http.NewRequest("PUT", "https://api.twitch.tv/helix/moderation/automod/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/moderation/automod/settings?broadcaster_id=1234&moderator_id=5678");
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",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"overall_level":3}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.twitch.tv/helix/moderation/automod/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("{\"overall_level\":3}",
Encoding.UTF8, "application/json");
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/moderation/automod/settings?broadcaster_id=1234&moderator_id=5678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"overall_level": 3
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "1234",
"moderator_id": "5678",
"overall_level": 3,
"disability": 3,
"aggression": 3,
"sexuality_sex_or_gender": 3,
"misogyny": 3,
"bullying": 2,
"swearing": 0,
"race_ethnicity_or_religion": 3,
"sex_based_terms": 3
}
]
}Get Banned Users
Gets all users that the broadcaster banned or put in a timeout.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/banned
Authorization
Requires one of the following:
- A user access token that includes the moderation:read or moderator:manage:banned_users scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderation:read or moderator:manage:banned_users scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose list of banned users you want to get. This ID must match the user ID in the access token.user_idStringA list of user IDs used to filter the results. To specify more than one ID, include this parameter for each user you want to get. For example, 'user_id=1234&user_id=5678'. You may specify a maximum of 100 IDs.
The returned list includes only those users that were banned or put in a timeout. If you specify this parameter, the first and after query parameters are ignored and the response's pagination object is empty.
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 100 items per page. The default is 20.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 were banned or put in a timeout. The users in each page are in lexicographical order of user ID.Hide child attributesShow child attributes
data.user_idStringThe ID of the banned user.data.user_loginStringThe banned user's login name.data.user_nameStringThe banned user's display name.data.expires_atStringThe UTC date and time (in RFC3339 format) of when the timeout expires, or an empty string if the user is permanently banned.data.created_atStringThe UTC date and time (in RFC3339 format) of when the user was banned.data.reasonStringThe reason the user was banned or put in a timeout if the moderator provided one.data.moderator_idStringThe ID of the moderator that banned the user or put them in a timeout.data.moderator_loginStringThe moderator's login name.data.moderator_nameStringThe moderator'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.
Response Codes
- 200OK
- Successfully retrieved the list of banned users.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The cursor specified in the after query parameter is not valid.
- The first query parameter is outside the allowed range of values.
- The request specified too many user_id query parameters.
- 401Unauthorized
- The ID in broadcaster_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 moderation:read or moderator:manage:banned_users scope.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the moderation:read or moderator:manage:banned_users 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/moderation/banned?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/moderation/banned?broadcaster_id=198704263" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/banned?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/moderation/banned",
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/moderation/banned?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/moderation/banned?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/moderation/banned?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/moderation/banned?broadcaster_id=198704263")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "423374343",
"user_login": "glowillig",
"user_name": "glowillig",
"expires_at": "2022-03-15T02:00:28Z",
"created_at": "2022-03-15T01:30:28Z",
"reason": "Does not like pineapple on pizza.",
"moderator_id": "141981764",
"moderator_login": "twitchdev",
"moderator_name": "TwitchDev"
},
{
"user_id": "424596340",
"user_login": "quotrok",
"user_name": "quotrok",
"expires_at": "2022-08-07T02:07:55Z",
"created_at": "2022-08-07T02:02:55Z",
"reason": "Inappropriate words.",
"moderator_id": "141981764",
"moderator_login": "twitchdev",
"moderator_name": "TwitchDev"
},
...
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6IjEwMDQ3MzA2NDo4NjQwNjU3MToxSVZCVDFKMnY5M1BTOXh3d1E0dUdXMkJOMFcifX0"
}
}Ban User
Bans a user from participating in the specified broadcaster's chat room or puts them in a timeout.
For information about banning or putting users in a timeout, see Ban a User and Timeout a User
If the user is currently in a timeout, you can call this endpoint to change the duration of the timeout or ban them altogether. If the user is currently banned, you cannot call this method to put them in a timeout instead.
To remove a ban or end a timeout, see Unban user.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/bans
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:banned_users scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:banned_users, user:bot scopes for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose chat room the user is being banned from.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.
Request Body
dataObjectRequiredIdentifies the user and type of ban.Hide child attributesShow child attributes
data.user_idStringRequiredThe ID of the user to ban or put in a timeout.data.durationIntegerTo ban a user indefinitely, don't include this field or set it to 0.
To put a user in a timeout, include this field and specify the timeout period, in seconds. The minimum timeout is 1 second and the maximum is 1,209,600 seconds (2 weeks).
To end a user's timeout early, set this field to 1, or use the Unban user endpoint.
data.reasonStringThe reason the you're banning the user or putting them in a timeout. The text is user defined and is limited to a maximum of 500 characters.
Response Body
dataObject[]A list that contains the user you successfully banned or put in a timeout.Hide child attributesShow child attributes
data.broadcaster_idStringThe broadcaster whose chat room the user was banned from chatting in.data.moderator_idStringThe moderator that banned or put the user in the timeout.data.user_idStringThe user that was banned or put in a timeout.data.created_atStringThe UTC date and time (in RFC3339 format) that the ban or timeout was placed.data.end_timeStringThe UTC date and time (in RFC3339 format) that the timeout will end. Is null if the user was banned instead of being put in a timeout.
Response Codes
- 200OK
- Successfully banned the user or placed them in a timeout.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The user_id field is required.
- The text in the 'reason' field is too long.
- The text in the 'reason' field doesn't meet Twitch's moderation standards.
- The value in the 'duration' field is not valid.
- The user specified in the user_id field was not found.
- The user specified in the user_id field may not be banned.
- The user specified in the user_id field may not be put in a timeout.
- The user specified in the user_id field is already banned.
- 401Unauthorized
- The ID in moderator_id 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:manage:banned_users scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:banned_users and user:bot scopes.
- 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.
- 409Conflict
- You may not update the user's ban state while someone else is updating the state. For example, someone else is currently banning the user or putting them in a timeout, moving the user from a timeout to a ban, or removing the user from a ban or timeout. Please retry your request.
- 429Too Many Requests
- The app has exceeded the number of requests it may make per minute for this broadcaster.
curl -X POST 'https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"data":{"user_id":"9876","reason":"no reason"}}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"data":{"user_id":"9876","reason":"no reason"}}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"data": {
"user_id": "9876",
"reason": "no reason"
}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/bans",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
},
json={
"data": {"user_id":"9876","reason":"no reason"},
},
)
data = response.json()body := strings.NewReader(`{"data":{"user_id":"9876","reason":"no reason"}}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/bans?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/moderation/bans?broadcaster_id=1234&moderator_id=5678");
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, '{"data":{"user_id":"9876","reason":"no reason"}}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/bans?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("{\"data\":{\"user_id\":\"9876\",\"reason\":\"no reason\"}}",
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/moderation/bans?broadcaster_id=1234&moderator_id=5678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"data": {
"user_id": "9876",
"reason": "no reason"
}
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "1234",
"moderator_id": "5678",
"user_id": "9876",
"created_at": "2021-09-28T18:22:31Z",
"end_time": null
}
]
}Unban User
Removes the ban or timeout that was placed on the specified user. To ban a user, see Ban user.
Endpoint
DELETEhttps://api.twitch.tv/helix/moderation/bans
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:banned_users scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:banned_users, user:bot scopes for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose chat room the user is banned from chatting in.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.user_idStringRequiredThe ID of the user to remove the ban or timeout from.
Response Codes
- 204No Content
- Successfully removed the ban or timeout.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The user_id query parameter is required.
- The user specified in the user_id query parameter is not banned.
- 401Unauthorized
- The ID in moderator_id 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:manage:banned_users scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:banned_users and user:bot scopes.
- 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.
- 409Conflict
- You may not update the user's ban state while someone else is updating the state. For example, someone else is currently removing the ban or timeout, or they're moving the user from a timeout to a ban. Please retry your request.
- 429Too Many Requests
- The app has exceeded the number of requests it may make per minute for this broadcaster.
curl -X DELETE 'https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432' \
-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/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432", {
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/moderation/bans",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
"user_id": "5432",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432", 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/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432");
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/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432");
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/moderation/bans?broadcaster_id=1234&moderator_id=5678&user_id=5432")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"error": "Bad Request",
"status": 400,
"message": "The user in the user_id query parameter is not banned."
}Get Blocked Terms
Gets the broadcaster's list of blocked words or phrases. These are the terms that the broadcaster or moderator added manually or that were denied by AutoMod.
The list includes the broadcaster's private terms only if the ID in moderator_id is the broadcaster's ID. The response doesn't indicate which terms are private.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/blocked_terms
Authorization
Requires one of the following:
- A user access token that includes the moderator:read:blocked_terms or moderator:manage:blocked_terms scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:read:blocked_terms or moderator:manage:blocked_terms scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose blocked terms you're getting.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.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 100 items per page. The default is 20.afterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value.
Response Body
dataObject[]The list of blocked terms. The list is in descending order of when they were created (see the 'created_at' timestamp).Hide child attributesShow child attributes
data.broadcaster_idStringThe broadcaster that owns the list of blocked terms.data.moderator_idStringThe moderator that blocked the word or phrase from being used in the broadcaster's chat room.data.idStringAn ID that identifies this blocked term.data.textStringThe blocked word or phrase.data.created_atStringThe UTC date and time (in RFC3339 format) that the term was blocked.data.updated_atStringThe UTC date and time (in RFC3339 format) that the term was updated.
When the term is added, this timestamp is the same as 'created_at'. The timestamp changes as AutoMod continues to deny the term.
data.expires_atStringThe UTC date and time (in RFC3339 format) that the blocked term is set to expire. After the block expires, users may use the term in the broadcaster's chat room.
This field is null if the term was added manually or was permanently blocked by AutoMod.
paginationObjectContains the information used to page through the list of results. The object is empty if the page contains fewer terms than the page size (see first). A full page includes a cursor even if no more terms remain, in which case the next page is empty. 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.
Response Codes
- 200OK
- Successfully retrieved the list of blocked terms.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The cursor specified in the after query parameter is not valid.
- 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:read:blocked_terms or moderator:manage:blocked_terms scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:read:blocked_terms or moderator:manage:blocked_terms 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.
curl -X GET 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10' \
-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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10", {
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/moderation/blocked_terms",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
"first": "10",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10", 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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10");
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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10");
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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10")
.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",
"id": "520e4d4e-0cda-49c7-821e-e5ef4f88c2f2",
"text": "A phrase I'm not fond of",
"created_at": "2021-09-29T19:45:37Z",
"updated_at": "2021-09-29T19:45:37Z",
"expires_at": null
},
. . .
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6I..."
}
}Add Blocked Term
Adds a word or phrase to the broadcaster's list of blocked terms. These are the terms that the broadcaster doesn't want used in their chat room.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/blocked_terms
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:blocked_terms scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:blocked_terms scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the list of blocked terms.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.
Request Body
textStringRequiredThe word or phrase to block from being used in the broadcaster's chat room. The term may contain up to a maximum of 500 characters. Not counting spaces and wildcard characters, the term must contain a minimum of 2 characters, or 3 characters if it includes a wildcard character.
Terms may include a wildcard character (*). The wildcard character must appear at the beginning or end of a word or set of characters. For example, *foo or foo*.
If the blocked term already exists, the response contains the existing blocked term.
Response Body
dataObject[]A list that contains the single blocked term that the broadcaster added.Hide child attributesShow child attributes
data.broadcaster_idStringThe broadcaster that owns the list of blocked terms.data.moderator_idStringThe moderator that blocked the word or phrase from being used in the broadcaster's chat room.data.idStringAn ID that identifies this blocked term.data.textStringThe blocked word or phrase.data.created_atStringThe UTC date and time (in RFC3339 format) that the term was blocked.data.updated_atStringThe UTC date and time (in RFC3339 format) that the term was updated.
When the term is added, this timestamp is the same as 'created_at'. The timestamp changes as AutoMod continues to deny the term.
data.expires_atStringThe UTC date and time (in RFC3339 format) that the blocked term is set to expire. After the block expires, users may use the term in the broadcaster's chat room.
This field is null if the term was added manually or was permanently blocked by AutoMod.
Response Codes
- 200OK
- Successfully added the blocked term.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The 'text' field is required.
- The length of the term in the 'text' field is either too short or too long.
- The request conflicts with another pending change to the broadcaster's list of blocked terms. Please retry your request.
- 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:blocked_terms scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:blocked_terms 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.
- 409Conflict
- The blocked term is currently being updated. Please retry your request.
curl -X POST 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"text":"A phrase I'm not fond of"}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"text":"A phrase I'm not fond of"}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"text": "A phrase I'm not fond of"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/blocked_terms",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
},
json={
"text": "A phrase I'm not fond of",
},
)
data = response.json()body := strings.NewReader(`{"text":"A phrase I'm not fond of"}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/blocked_terms?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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678");
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, '{"text":"A phrase I'm not fond of"}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/blocked_terms?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("{\"text\":\"A phrase I'm not fond of\"}",
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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"text": "A phrase I'm not fond of"
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "1234",
"moderator_id": "5678",
"id": "3bb6e5d3-afb1-416c-ad4e-21af970ccfe7",
"text": "A phrase I'm not fond of",
"created_at": "2021-09-29T15:36:45Z",
"updated_at": "2021-09-29T15:36:45Z",
"expires_at": null
}
]
}Remove Blocked Term
Removes the word or phrase from the broadcaster's list of blocked terms.
Endpoint
DELETEhttps://api.twitch.tv/helix/moderation/blocked_terms
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:blocked_terms scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:blocked_terms scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the list of blocked terms.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.idStringRequiredThe ID of the blocked term to remove from the broadcaster's list of blocked terms.
Response Codes
- 204No Content
- Successfully removed the blocked term. Also returned if the ID is not found.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The id query parameter is required.
- 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:blocked_terms scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:blocked_terms 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.
curl -X DELETE 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2' \
-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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2", {
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/moderation/blocked_terms",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "1234",
"moderator_id": "5678",
"id": "c9fc79b8-0f63-4ef7-9d38-efd811e74ac2",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2", 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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2");
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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2");
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/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Get Moderated Channels
Gets a list of channels that the specified user has moderator privileges in.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/channels
Authorization
Requires one of the following:
- A user access token that includes the user:read:moderated_channels scope.That includes the user:read:moderated_channels. The user ID associated with the token must match the user_id in the query parameter.
- An app access token.The application, through prior authorization, must have been granted:
- The user:read:moderated_channels scope for the user represented by the user_id query parameter.
Query Parameters
user_idStringRequiredA user's ID. Returns the list of channels that this user has moderator privileges in. This ID must match the user ID in the user OAuth tokenafterStringThe cursor used to get the next page of results. The Pagination object in the response contains the cursor's value.firstIntegerThe maximum number of items to return per page in the response. Minimum page size is 1 item per page and the maximum is 100. The default is 20.
Response Body
dataObject[]The list of channels that the user has moderator privileges in. The list doesn't include the user's own channel or channels that are deleted or suspended.Hide child attributesShow child attributes
data.broadcaster_idStringAn ID that uniquely identifies the channel this user can moderate.data.broadcaster_loginStringThe channel's login name.data.broadcaster_nameStringThe channels' 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.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 list of moderated channels.
- 400Bad Request
- The user_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.
- 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 or an app access token.
- The user access token must include the user:read:moderated_channels scope.
- If you use an app access token, the user in user_id must have authorized your app with the user:read:moderated_channels 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/moderation/channels?user_id=931931' \
-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/moderation/channels?user_id=931931" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/channels?user_id=931931", {
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/moderation/channels",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"user_id": "931931",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/moderation/channels?user_id=931931", 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/moderation/channels?user_id=931931");
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/moderation/channels?user_id=931931");
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/moderation/channels?user_id=931931")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id" : "12345",
"broadcaster_login" : "grateful_broadcaster",
"broadcaster_name" : "Grateful_Broadcaster"
},
{
"broadcaster_id" : "98765",
"broadcaster_login" : "bashfulgamer",
"broadcaster_name" : "BashfulGamer"
},
...
],
"pagination" : {
"cursor" : "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6IjEwMDQ3MzA2NDo4NjQwNjU3MToxSVZCVDFKMnY5M1BTOXh3d1E0dUdXMkJOMFcifX0"
}
}Delete Chat Messages
Removes a single chat message or all chat messages from the broadcaster's chat room.
Endpoint
DELETEhttps://api.twitch.tv/helix/moderation/chat
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 scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room to remove messages from.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_idStringThe ID of the message to remove. The 'id' tag in the PRIVMSG tag contains the message's ID. Restrictions:
-
The message must have been created within the last 6 hours.
-
The message must not belong to the broadcaster.
-
The message must not belong to another moderator.
If you don't specify this parameter, the request removes all messages in the broadcaster's chat room.
-
Response Codes
- 204No Content
- Successfully removed the specified messages.
- 400Bad Request
- You may not delete another moderator's messages.
- You may not delete the broadcaster's messages.
- 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 is missing 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 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.
- 403Forbidden
- The user in moderator_id is not one of the broadcaster's moderators.
- 404Not Found
- The ID in broadcaster_id was not found.
- The ID in message_id was not found.
- The user who sent the message in message_id was not found.
- The specified message was created more than 6 hours ago.
curl -X DELETE 'https://api.twitch.tv/helix/moderation/chat?broadcaster_id=11111&moderator_id=44444' \
-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/moderation/chat?broadcaster_id=11111&moderator_id=44444" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/chat?broadcaster_id=11111&moderator_id=44444", {
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/moderation/chat",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "11111",
"moderator_id": "44444",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/moderation/chat?broadcaster_id=11111&moderator_id=44444", 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/moderation/chat?broadcaster_id=11111&moderator_id=44444");
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/moderation/chat?broadcaster_id=11111&moderator_id=44444");
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/moderation/chat?broadcaster_id=11111&moderator_id=44444")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Check AutoMod Status
Checks whether AutoMod would flag the specified message for review.
AutoMod is a moderation tool that holds inappropriate or harassing chat messages for moderators to review. Moderators approve or deny the messages that AutoMod flags; only approved messages are released to chat. AutoMod detects misspellings and evasive language automatically. For information about AutoMod, see How to Use AutoMod.
Rate Limits: Rates are limited per channel based on the account type rather than per access token. Each message in the request counts toward the limits, and the request fails if checking any one of the messages would exceed a limit.
| Account type | Limit per minute | Limit per hour |
|---|---|---|
| Normal | 5 | 50 |
| Affiliate | 10 | 100 |
| Partner | 30 | 300 |
The above limits are in addition to the standard Twitch API rate limits. The rate limit headers in the response represent the Twitch rate limits and not the above limits.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/enforcements/status
Authorization
Requires one of the following:
- A user access token that includes the moderation:read scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderation:read scope for the user represented by the broadcaster_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose AutoMod settings and list of blocked terms are used to check the message. This ID must match the user ID in the access token.
Request Body
dataObject[]RequiredThe list of messages to check. The list must contain at least one message and may contain up to a maximum of 100 messages.Hide child attributesShow child attributes
data.msg_idStringRequiredA caller-defined ID used to correlate this message with the same message in the response. Use a unique ID for each message; if messages share an ID, only the last of them is checked.data.msg_textStringRequiredThe message to check. The message may contain a maximum of 500 characters.
Response Body
dataObject[]The list of messages and whether Twitch would approve them for chat. The list is in no particular order.Hide child attributesShow child attributes
data.msg_idStringThe caller-defined ID passed in the request.data.is_permittedBooleanA Boolean value that indicates whether Twitch would approve the message for chat or hold it for moderator review or block it from chat. Is true if Twitch would approve the message; otherwise, false if Twitch would hold the message for moderator review or block it from chat.
Response Codes
- 200OK
- Successfully checked the messages.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The 'data' field is required and the list must contain one or more messages to check.
- The 'msg_id' field is required.
- The 'msg_text' field is required.
- The text in the 'msg_text' field is too long.
- 401Unauthorized
- The Authorization header is required and must contain a user access token or an app access token.
- The user access token must include the moderation:read scope.
- If you use an app access token, the user in broadcaster_id must have authorized your app with the moderation:read 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 ID in broadcaster_id must match the user ID in the user access token.
- 429Too Many Requests
- The broadcaster exceeded the number of chat message checks that they may make. See the endpoint's rate limits.
curl -X POST 'https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=12345' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"data":[{"msg_id":"123","msg_text":"Hello World!"},{"msg_id":"393","msg_text":"Boooooo!"}]}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"data":[{"msg_id":"123","msg_text":"Hello World!"},{"msg_id":"393","msg_text":"Boooooo!"}]}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=12345" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=12345", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"data": [
{
"msg_id": "123",
"msg_text": "Hello World!"
},
{
"msg_id": "393",
"msg_text": "Boooooo!"
}
]
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/enforcements/status",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "12345",
},
json={
"data": [{"msg_id":"123","msg_text":"Hello World!"},{"msg_id":"393","msg_text":"Boooooo!"}],
},
)
data = response.json()body := strings.NewReader(`{"data":[{"msg_id":"123","msg_text":"Hello World!"},{"msg_id":"393","msg_text":"Boooooo!"}]}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=12345", 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/moderation/enforcements/status?broadcaster_id=12345");
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, '{"data":[{"msg_id":"123","msg_text":"Hello World!"},{"msg_id":"393","msg_text":"Boooooo!"}]}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=12345");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"data\":[{\"msg_id\":\"123\",\"msg_text\":\"Hello World!\"},{\"msg_id\":\"393\",\"msg_text\":\"Boooooo!\"}]}",
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/moderation/enforcements/status?broadcaster_id=12345")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"data": [
{
"msg_id": "123",
"msg_text": "Hello World!"
},
{
"msg_id": "393",
"msg_text": "Boooooo!"
}
]
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"msg_id": "123",
"is_permitted": true
},
{
"msg_id": "393",
"is_permitted": false
}
]
}Get Moderators
Gets all users allowed to moderate the broadcaster's chat room.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/moderators
Authorization
Requires one of the following:
- A user access token that includes the moderation:read or channel:manage:moderators scope.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose list of moderators you want to get. This ID must match the user ID in the access token.user_idStringA list of user IDs used to filter the results. To specify more than one ID, include this parameter for each moderator you want to get. For example, 'user_id=1234&user_id=5678'. You may specify a maximum of 100 IDs.
The returned list includes only the users from the list who are moderators in the broadcaster's channel. The list is in no particular order, and duplicate IDs are ignored. If you specify this parameter, the first and after query parameters are ignored and the response's pagination object is empty.
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 100 items per page. The default is 20.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 moderators.Hide child attributesShow child attributes
data.user_idStringThe ID of the user that has permission to moderate the broadcaster's channel.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.
Response Codes
- 200OK
- Successfully retrieved the list of moderators.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The IDs in broadcaster_id and user_id must be positive integers.
- The cursor specified in the after query parameter is not valid.
- 401Unauthorized
- The ID in broadcaster_id must match the user ID found in the access token.
- The Authorization header is required and must contain a user access token.
- The user access token must include the moderation:read or channel:manage:moderators 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/moderation/moderators?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/moderation/moderators?broadcaster_id=198704263" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/moderators?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/moderation/moderators",
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/moderation/moderators?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/moderation/moderators?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/moderation/moderators?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/moderation/moderators?broadcaster_id=198704263")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "424596340",
"user_login": "quotrok",
"user_name": "quotrok"
},
...
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6IjEwMDQ3MzA2NDo4NjQwNjU3MToxSVZCVDFKMnY5M1BTOXh3d1E0dUdXMkJOMFcifX0"
}
}Add Channel Moderator
Adds a moderator to the broadcaster's chat room.
Rate Limits: The broadcaster may add a maximum of 10 moderators within a 10-second window.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/moderators
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:moderators scope.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room. This ID must match the user ID in the access token.user_idStringRequiredThe ID of the user to add as a moderator in the broadcaster's chat room.
Response Codes
- 204No Content
- Successfully added the moderator.
- 400Bad Request
- The ID in broadcaster_id was not found.
- The ID in user_id was not found.
- The user in user_id is already a moderator in the broadcaster's chat room.
- The user in user_id cannot become a moderator because they're banned from the channel.
- The user in user_id cannot become a moderator because they blocked the broadcaster or the broadcaster blocked them.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:moderators scope.
- The access token is not valid.
- The ID in the broadcaster_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 access token.
- 422Unprocessable Entity
- The user in user_id is a VIP. To make them a moderator, you must first remove them as a VIP (see Remove Channel VIP).
- The broadcaster's channel has reached the maximum number of moderators.
- 429Too Many Requests
- The broadcaster has exceeded the number of requests allowed within a 10-second window. See this endpoint's rate limits.
curl -X POST 'https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444' \
-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/moderation/moderators?broadcaster_id=11111&user_id=44444" `
-Method Post -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444", {
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/moderation/moderators",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "11111",
"user_id": "44444",
},
)
data = response.json()req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444", 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/moderation/moderators?broadcaster_id=11111&user_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",
]);
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444");
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/moderation/moderators?broadcaster_id=11111&user_id=44444")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Remove Channel Moderator
Removes a moderator from the broadcaster's chat room.
Rate Limits: The broadcaster may remove a maximum of 10 moderators within a 10-second window.
Endpoint
DELETEhttps://api.twitch.tv/helix/moderation/moderators
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:moderators scope.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that owns the chat room. This ID must match the user ID in the access token, unless a moderator is removing themselves; in that case, the ID in user_id must match the user ID in the access token.user_idStringRequiredThe ID of the user to remove as a moderator from the broadcaster's chat room.
Response Codes
- 204No Content
- Successfully removed the moderator.
- 400Bad Request
- The ID in broadcaster_id was not found.
- The ID in user_id was not found.
- The user in user_id is not a moderator in the broadcaster's chat room.
- 401Unauthorized
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:moderators scope.
- The access token is not valid.
- The ID in the broadcaster_id query parameter must match the user ID in the access token, unless the user in the access token is removing themselves as a moderator.
- The client ID specified in the Client-Id header does not match the client ID specified in the access token.
- 429Too Many Requests
- The broadcaster has exceeded the number of requests allowed within a 10-second window. See this endpoint's rate limits.
curl -X DELETE 'https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444' \
-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/moderation/moderators?broadcaster_id=11111&user_id=44444" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444", {
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/moderation/moderators",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "11111",
"user_id": "44444",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444", 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/moderation/moderators?broadcaster_id=11111&user_id=44444");
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/moderation/moderators?broadcaster_id=11111&user_id=44444");
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/moderation/moderators?broadcaster_id=11111&user_id=44444")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;Get Shield Mode Status
Gets the broadcaster's Shield Mode activation status.
To receive notification when the broadcaster activates and deactivates Shield Mode, subscribe to the channel.shield_mode.begin and channel.shield_mode.end subscription types.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/shield_mode
Authorization
Requires one of the following:
- A user access token that includes the moderator:read:shield_mode or moderator:manage:shield_mode 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:read:shield_mode or moderator:manage:shield_mode scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose Shield Mode activation status you want to get.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 Body
dataObject[]A list that contains a single object with the broadcaster's Shield Mode status.Hide child attributesShow child attributes
data.is_activeBooleanA Boolean value that determines whether Shield Mode is active. Is true if the broadcaster activated Shield Mode; otherwise, false.data.moderator_idStringAn ID that identifies the moderator that last activated Shield Mode. Is an empty string if Shield Mode hasn't been previously activated.data.moderator_loginStringThe moderator's login name. Is an empty string if Shield Mode hasn't been previously activated.data.moderator_nameStringThe moderator's display name. Is an empty string if Shield Mode hasn't been previously activated.data.last_activated_atStringThe UTC timestamp (in RFC3339 format) of when Shield Mode was last activated. Is an empty string if Shield Mode hasn't been previously activated.
Response Codes
- 200OK
- Successfully retrieved the broadcaster's Shield Mode activation status.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- 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:read:shield_mode or moderator:manage:shield_mode scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:read:shield_mode or moderator:manage:shield_mode 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.
curl -X GET 'https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&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/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765", {
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/moderation/shield_mode",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "12345",
"moderator_id": "98765",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&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/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765");
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/moderation/shield_mode?broadcaster_id=12345&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
.get("https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"is_active": true,
"moderator_id": "98765",
"moderator_name": "SimplySimple",
"moderator_login": "simplysimple",
"last_activated_at": "2022-07-26T17:16:03Z"
}
]
}Update Shield Mode Status
Activates or deactivates the broadcaster's Shield Mode.
Twitch's Shield Mode feature is like a panic button that broadcasters can push to protect themselves from chat abuse coming from one or more accounts. When activated, Shield Mode applies the overrides that the broadcaster configured in the Twitch UX. If the broadcaster hasn't configured Shield Mode, it applies default overrides.
Endpoint
PUThttps://api.twitch.tv/helix/moderation/shield_mode
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:shield_mode 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:shield_mode scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose Shield Mode you want to activate or deactivate.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.
Request Body
is_activeBooleanRequiredA Boolean value that determines whether to activate Shield Mode. Set to true to activate Shield Mode; otherwise, false to deactivate Shield Mode.
Response Body
dataObject[]A list that contains a single object with the broadcaster's updated Shield Mode status.Hide child attributesShow child attributes
data.is_activeBooleanA Boolean value that determines whether Shield Mode is active. Is true if Shield Mode is active; otherwise, false.data.moderator_idStringAn ID that identifies the moderator that last activated Shield Mode. Is an empty string if Shield Mode hasn't been previously activated.data.moderator_loginStringThe moderator's login name. Is an empty string if Shield Mode hasn't been previously activated.data.moderator_nameStringThe moderator's display name. Is an empty string if Shield Mode hasn't been previously activated.data.last_activated_atStringThe UTC timestamp (in RFC3339 format) of when Shield Mode was last activated. Is an empty string if Shield Mode hasn't been previously activated.
Response Codes
- 200OK
- Successfully updated the broadcaster's Shield Mode status.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The ID in the broadcaster_id query parameter is not valid.
- The 'is_active' field is required.
- The value in the 'is_active' field is not valid.
- 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:shield_mode scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:shield_mode 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.
curl -X PUT 'https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"is_active":false}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"is_active":false}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765" `
-Method Put -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"is_active": false
}),
});
const data = await response.json();import requests
response = requests.put(
"https://api.twitch.tv/helix/moderation/shield_mode",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "12345",
"moderator_id": "98765",
},
json={
"is_active": false,
},
)
data = response.json()body := strings.NewReader(`{"is_active":false}`)
req, _ := http.NewRequest("PUT", "https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765", 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/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765");
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",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"is_active":false}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"is_active\":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
.put("https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"is_active": false
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"is_active": false,
"moderator_id": "98765",
"moderator_name": "SimplySimple",
"moderator_login": "simplysimple",
"last_activated_at": "2022-07-26T17:16:03Z"
}
]
}Add Suspicious Status to Chat User
Adds a suspicious user status to a chatter on the broadcaster's channel.
Endpoint
POSThttps://api.twitch.tv/helix/moderation/suspicious_users
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:suspicious_users scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:suspicious_users scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe user ID of the broadcaster, indicating the channel where the status is being applied.moderator_idStringRequiredThe user ID of the moderator who is applying the status. This ID must match the user ID in the user access token.
Request Body
user_idStringRequiredThe ID of the user being given the suspicious status.statusStringRequiredThe type of suspicious status.Possible values
ACTIVE_MONITORINGRESTRICTED
Response Body
dataObject[]An array with one object containing information about the suspicious user action.Hide child attributesShow child attributes
data.user_idStringThe ID of the user being given the suspicious status.data.broadcaster_idStringThe user ID of the broadcaster indicating in which channel the status is being applied.data.moderator_idStringThe user ID of the moderator who applied the last status.data.updated_atStringThe UTC date and time (in RFC3339 format) of the last time this user's status was updated.data.statusStringThe type of suspicious status.Possible values
ACTIVE_MONITORINGRESTRICTED
data.typesString[]An array of strings representing the type(s) of suspicious user this is.Possible values
MANUALLY_ADDEDDETECTED_BAN_EVADERDETECTED_SUS_CHATTERBANNED_IN_SHARED_CHANNELUNKNOWN_TYPE
Response Codes
- 200OK
- Successfully applied a suspicious user status.
- 400Bad Request
- Validation errors: Missing required fields.
- The IDs in broadcaster_id and moderator_id must be positive integers.
- The status specified was invalid. Must either be ACTIVE_MONITORING or RESTRICTED
- The status update is not allowed for this user. You may not apply a status to the broadcaster, to the user in moderator_id, or to one of the broadcaster's moderators, or apply a status that the user already has.
- 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:suspicious_users scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:suspicious_users scope.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
- 403Forbidden
- The user in the moderator_id query parameter is not one of the broadcaster's moderators.
curl -X POST 'https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"user_id":"9876","status":"RESTRICTED"}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"user_id":"9876","status":"RESTRICTED"}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"user_id": "9876",
"status": "RESTRICTED"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/suspicious_users",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "141981764",
"moderator_id": "12826",
},
json={
"user_id": "9876",
"status": "RESTRICTED",
},
)
data = response.json()body := strings.NewReader(`{"user_id":"9876","status":"RESTRICTED"}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826", 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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826");
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, '{"user_id":"9876","status":"RESTRICTED"}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"user_id\":\"9876\",\"status\":\"RESTRICTED\"}",
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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"user_id": "9876",
"status": "RESTRICTED"
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "9876",
"broadcaster_id": "141981764",
"moderator_id": "12826",
"updated_at": "2025-12-01T23:08:18Z",
"status": "RESTRICTED",
"types": [
"MANUALLY_ADDED"
]
}
]
}Remove Suspicious Status From Chat User
Remove a suspicious user status from a chatter on broadcaster's channel.
Endpoint
DELETEhttps://api.twitch.tv/helix/moderation/suspicious_users
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:suspicious_users scope.
- An app access token.The application, through prior authorization, must have been granted:
- The moderator:manage:suspicious_users scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe user ID of the broadcaster, indicating the channel where the status is being removed.moderator_idStringRequiredThe user ID of the moderator who is removing the status. This ID must match the user ID in the user access token.user_idStringRequiredThe ID of the user having the suspicious status removed.
Response Body
dataObject[]An array with one object containing information about the suspicious user action.Hide child attributesShow child attributes
data.user_idStringThe ID of the user having the suspicious status removed.data.broadcaster_idStringThe user ID of the broadcaster indicating in which channel the status is being removed.data.moderator_idStringThe user ID of the moderator who modified the last status.data.updated_atStringThe timestamp of the last time this user's status was updated.data.statusStringThe type of suspicious status.Possible values
NO_TREATMENT
data.typesString[]An array of strings representing the type(s) of suspicious user this is.Possible values
MANUALLY_ADDEDDETECTED_BAN_EVADERDETECTED_SUS_CHATTERBANNED_IN_SHARED_CHANNELUNKNOWN_TYPE
Response Codes
- 200OK
- Successfully removed a suspicious user status.
- 400Bad Request
- Validation errors: Missing required fields.
- The status update is not allowed for this user.
- 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:suspicious_users scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:suspicious_users scope.
- The OAuth token is not valid.
- The ID in the Client-Id header must match the Client ID in the OAuth token.
- 403Forbidden
- The user in the moderator_id query parameter is not one of the broadcaster's moderators.
curl -X DELETE 'https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876' \
-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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876", {
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/moderation/suspicious_users",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "141981764",
"moderator_id": "12826",
"user_id": "9876",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876", 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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876");
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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876");
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/moderation/suspicious_users?broadcaster_id=141981764&moderator_id=12826&user_id=9876")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"user_id": "9876",
"broadcaster_id": "141981764",
"moderator_id": "12826",
"updated_at": "2025-12-01T23:08:18Z",
"status": "NO_TREATMENT",
"types": [
"MANUALLY_ADDED"
]
}
]
}Get Unban Requests
Gets a list of unban requests for a broadcaster's channel.
Endpoint
GEThttps://api.twitch.tv/helix/moderation/unban_requests
Authorization
Requires one of the following:
- A user access token that includes the moderator:read:unban_requests or moderator:manage:unban_requests scope.The User ID associated with the token must match the moderator_id in the query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose channel is receiving unban requests.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's unban requests. This ID must match the user ID in the user access token. To get your own unban requests, set this parameter and user_id to your user ID; the moderator_id, moderator_login and moderator_name fields in the response are then null.statusStringRequiredFilter by a status. The value is case sensitive.
- pending
- approved
- denied
- acknowledged
- canceled
user_idStringThe ID used to filter what unban requests are returned.afterStringCursor used to get next page of results. Pagination object in response contains cursor value.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 100. The default is 20.
Response Body
dataObject[]A list that contains information about the channel's unban requests. The list is empty if the user in moderator_id doesn't have permission to view the broadcaster's unban requests. Requests from users whose accounts are deleted or suspended aren't included, so a page may contain fewer than first items.Hide child attributesShow child attributes
data.idStringUnban request ID.data.broadcaster_idStringUser ID of broadcaster whose channel is receiving the unban request.data.broadcaster_loginStringThe broadcaster's login name.data.broadcaster_nameStringThe broadcaster's display name.data.moderator_idStringNullableUser ID of moderator who approved/denied the request. If the request was canceled, this is the requesting user's ID.data.moderator_loginStringNullableThe moderator's login name.data.moderator_nameStringNullableThe moderator's display name.data.user_idStringUser ID of the requestor who is asking for an unban.data.user_loginStringThe user's login name.data.user_nameStringThe user's display name.data.textStringText of the request from the requesting user.data.statusStringStatus of the request. One of:
- pending
- approved
- denied
- acknowledged
- canceled
data.created_atStringTimestamp of when the unban request was created.data.resolved_atStringNullableTimestamp of when moderator/broadcaster approved or denied the request.data.resolution_textStringNullableText input by the resolver (moderator) of the unban request
paginationObjectContains information used to page through a list of results. The object is empty if there are no more pages left to page through.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 list of unban requests.
- 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.
- The ID in the user_id query parameter is not valid.
- The status query parameter is required.
- The value in the status query parameter is not valid.
- The first query parameter is outside the allowed range of values.
- The pagination cursor is not valid.
- 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.
- The user access token must include the moderator:read:unban_requests or moderator:manage:unban_requests 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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending' \
-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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending" `
-Method Get -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending", {
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/moderation/unban_requests",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "274637212",
"moderator_id": "141981764",
"status": "pending",
},
)
data = response.json()req, _ := http.NewRequest("GET", "https://api.twitch.tv/helix/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending", 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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending");
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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending");
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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=141981764&status=pending")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "92af127c-7326-4483-a52b-b0da0be61c01",
"broadcaster_name": "torpedo09",
"broadcaster_login": "torpedo09",
"broadcaster_id": "274637212",
"moderator_id": null,
"moderator_login": null,
"moderator_name": null,
"user_id": "424596340",
"user_login": "quotrok",
"user_name": "quotrok",
"text": "Please unban me from the channel?",
"status": "pending",
"created_at": "2022-08-07T02:07:55Z",
"resolved_at": null,
"resolution_text": null
}
],
"pagination": {
"cursor": "eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6IjEwMDQ3MzA2NDo4NjQwNjU3MToxSVZCVDFKMnY5M1BTOXh3d1E0dUdXMkJOMFcifX0"
}
}Resolve Unban Requests
Resolves an unban request by approving or denying it.
Endpoint
PATCHhttps://api.twitch.tv/helix/moderation/unban_requests
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:unban_requests scope.The User ID associated with the token must match the moderator_id in the query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster whose channel is approving or denying the unban request. The request is identified by unban_request_id alone; the response's broadcaster_id echoes this ID, and broadcaster_login and broadcaster_name are empty strings if it isn't the request's broadcaster.moderator_idStringRequiredThe ID of the broadcaster or a user that has permission to moderate the broadcaster's unban requests. This ID must match the user ID in the user access token.unban_request_idStringRequiredThe ID of the Unban Request to resolve.statusStringRequiredResolution status.
- approved
- denied
resolution_textStringMessage supplied by the unban request resolver. The message is limited to a maximum of 500 characters.
Response Body
dataObject[]Hide child attributesShow child attributes
data.idStringUnban request ID.data.broadcaster_idStringUser ID of broadcaster whose channel is receiving the unban request.data.broadcaster_loginStringThe broadcaster's login name.data.broadcaster_nameStringThe broadcaster's display name.data.moderator_idStringNullableUser ID of moderator who approved/denied the request.data.moderator_loginStringNullableThe moderator's login name.data.moderator_nameStringNullableThe moderator's display name.data.user_idStringUser ID of the requestor who is asking for an unban.data.user_loginStringThe user's login name.data.user_nameStringThe user's display name.data.textStringText of the request from the requesting user.data.statusStringStatus of the request. One of:
- approved
- denied
- pending
The status is pending if you approved the request but the user couldn't be unbanned. The request stays pending, and the moderator_id, moderator_login, moderator_name, resolved_at and resolution_text fields are null.
data.created_atStringTimestamp of when the unban request was created.data.resolved_atStringNullableTimestamp of when moderator/broadcaster approved or denied the request.data.resolution_textStringNullableText input by the resolver (moderator) of the unban request.
Response Codes
- 200OK
- Successfully resolved the unban request.
- 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.
- The unban_request_id query parameter is required.
- The status query parameter is required.
- The value in the status query parameter is not valid.
- Invalid requested update
- 401Unauthorized
- The ID in moderator_id must match the user ID in the user access token.
- The user in moderator_id is not the broadcaster or a moderator with permission to resolve the broadcaster's unban requests.
- The Authorization header is required and must contain a user access token.
- The user access token must include the moderator:manage:unban_requests 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.
- 404Not Found
- The unban request ID was not found.
curl -X PATCH 'https://api.twitch.tv/helix/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved' \
-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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved" `
-Method Patch -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved", {
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/moderation/unban_requests",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "274637212",
"moderator_id": "274637212",
"unban_request_id": "92af127c-7326-4483-a52b-b0da0be61c01",
"status": "approved",
},
)
data = response.json()req, _ := http.NewRequest("PATCH", "https://api.twitch.tv/helix/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved", 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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved");
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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved");
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/moderation/unban_requests?broadcaster_id=274637212&moderator_id=274637212&unban_request_id=92af127c-7326-4483-a52b-b0da0be61c01&status=approved")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"id": "92af127c-7326-4483-a52b-b0da0be61c01",
"broadcaster_name": "torpedo09",
"broadcaster_login": "torpedo09",
"broadcaster_id": "274637212",
"moderator_id": "274637212",
"moderator_login": "torpedo09",
"moderator_name": "torpedo09",
"user_id": "424596340",
"user_login": "quotrok",
"user_name": "quotrok",
"text": "Please unban me from the channel?",
"status": "approved",
"created_at": "2022-08-07T02:07:55Z",
"resolved_at": "2022-08-09T02:07:55Z",
"resolution_text": ""
}
]
}Warn Chat User
Warns a user in the specified broadcaster's chat room, preventing them from chat interaction until the warning is acknowledged.
New warnings can be issued to a user when they already have a warning in the channel (new warning will replace old warning).
Endpoint
POSThttps://api.twitch.tv/helix/moderation/warnings
Authorization
Requires one of the following:
- A user access token that includes the moderator:manage:warnings 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:warnings scope for the user represented by the moderator_id query parameter.
Query Parameters
broadcaster_idStringRequiredThe ID of the channel in which the warning will take effect.moderator_idStringRequiredThe ID of the twitch user who requested the warning.
Request Body
dataObjectRequiredAn object that contains information about the warning.Hide child attributesShow child attributes
data.user_idStringRequiredThe ID of the twitch user to be warned.data.reasonStringRequiredA custom reason for the warning. Max 500 chars.
Response Body
dataObject[]A list that contains information about the warning.Hide child attributesShow child attributes
data.broadcaster_idStringThe ID of the channel in which the warning will take effect.data.user_idStringThe ID of the warned user.data.moderator_idStringThe ID of the user who applied the warning.data.reasonStringThe reason provided for warning.
Response Codes
- 200OK
- Successfully warn a user.
- 400Bad Request
- The broadcaster_id query parameter is required.
- The moderator_id query parameter is required.
- The user_id field is required.
- The reason field is required.
- The text in the reason field is too long.
- The text in the reason field fails moderation standards.
- The ID in the user_id field is not valid.
- The user specified in the user_id may not be warned.
- 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:warnings scope.
- If you use an app access token, the user in moderator_id must have authorized your app with the moderator:manage:warnings 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.
- 409Conflict
- You may not update the user's warning state while someone else is updating the state. For example, someone else is currently warning the user or the user is acknowledging an existing warning. Please retry your request.
- 429Too Many Requests
- The app has exceeded the number of requests it may make per minute for this broadcaster.
- 500Internal Server Error
- Internal Server Error.
curl -X POST 'https://api.twitch.tv/helix/moderation/warnings?broadcaster_id=404040&moderator_id=404041' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Client-Id: YOUR_CLIENT_ID' \
-H 'Content-Type: application/json' \
-d '{"data":{"user_id":"9876","reason":"stop doing that!"}}'$headers = @{
"Authorization" = "Bearer YOUR_ACCESS_TOKEN"
"Client-Id" = "YOUR_CLIENT_ID"
}
$body = '{"data":{"user_id":"9876","reason":"stop doing that!"}}'
$response = Invoke-RestMethod -Uri "https://api.twitch.tv/helix/moderation/warnings?broadcaster_id=404040&moderator_id=404041" `
-Method Post -Headers $headers `
-ContentType "application/json" -Body $bodyconst response = await fetch("https://api.twitch.tv/helix/moderation/warnings?broadcaster_id=404040&moderator_id=404041", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"data": {
"user_id": "9876",
"reason": "stop doing that!"
}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.twitch.tv/helix/moderation/warnings",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "404040",
"moderator_id": "404041",
},
json={
"data": {"user_id":"9876","reason":"stop doing that!"},
},
)
data = response.json()body := strings.NewReader(`{"data":{"user_id":"9876","reason":"stop doing that!"}}`)
req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/moderation/warnings?broadcaster_id=404040&moderator_id=404041", 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/moderation/warnings?broadcaster_id=404040&moderator_id=404041");
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, '{"data":{"user_id":"9876","reason":"stop doing that!"}}');
$response = curl_exec($ch);
curl_close($ch);using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.twitch.tv/helix/moderation/warnings?broadcaster_id=404040&moderator_id=404041");
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("Client-Id", "YOUR_CLIENT_ID");
request.Content = new StringContent("{\"data\":{\"user_id\":\"9876\",\"reason\":\"stop doing that!\"}}",
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/moderation/warnings?broadcaster_id=404040&moderator_id=404041")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.json(&serde_json::json!({
"data": {
"user_id": "9876",
"reason": "stop doing that!"
}
}))
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"broadcaster_id": "404040",
"user_id": "9876",
"moderator_id": "404041",
"reason": "stop doing that!"
}
]
}