Start a raid
Raid another channel by sending the broadcaster's viewers to the targeted channel.
When you call the API from a chat bot or extension, the Twitch UX pops up a window at the top of the chat room that identifies the number of viewers in the raid. The raid occurs when the broadcaster clicks Raid Now or after the 90-second countdown expires.
To determine whether the raid successfully occurred, you must subscribe to the Channel Raid event. For more information, see Get notified when a raid begins.
To cancel a pending raid, use the Cancel a raid endpoint.
Rate Limit: The limit is 10 requests within a 10-minute window.
Endpoint
POSThttps://api.twitch.tv/helix/raids
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:raids scope.
Query Parameters
from_broadcaster_idStringRequiredThe ID of the broadcaster that's sending the raiding party. This ID must match the user ID in the user access token.to_broadcaster_idStringRequiredThe ID of the broadcaster to raid.
Response Body
dataObject[]A list that contains a single object with information about the pending raid.Hide child attributesShow child attributes
data.created_atStringThe UTC date and time, in RFC3339 format, of when the raid was requested.data.is_matureBooleanIMPORTANT This field is deprecated and returns only 'false'. A Boolean value that indicates whether the channel being raided contains mature content.
Response Codes
- 200OK
- Successfully requested to start a raid. To determine whether the raid successfully occurred (that is, the broadcaster clicked Raid Now or the countdown expired), you must subscribe to the Channel Raid event.
- 400Bad Request
- The raiding broadcaster is blocked from the targeted channel.
- The targeted channel doesn't accept raids from this broadcaster.
- There are too many viewers in the raiding party.
- The IDs in from_broadcaster_id and to_broadcaster_id cannot be the same ID.
- The ID in the from_broadcaster_id query parameter is not valid.
- The ID in the to_broadcaster_id query parameter is not valid.
- 401Unauthorized
- The ID in from_broadcaster_id must match the user ID found in the request's OAuth token.
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:raids 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 targeted channel was not found.
- 409Conflict
- The broadcaster is already in the process of raiding another channel.
- 429Too Many Requests
- The broadcaster exceeded the number of raid requests that they may make. The limit is 10 requests within a 10-minute window.
curl -X POST 'https://api.twitch.tv/helix/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321' \
-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/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321" `
-Method Post -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321", {
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/raids",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"from_broadcaster_id": "12345678",
"to_broadcaster_id": "87654321",
},
)
data = response.json()req, _ := http.NewRequest("POST", "https://api.twitch.tv/helix/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321", 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/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321");
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/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321");
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/raids?from_broadcaster_id=12345678&to_broadcaster_id=87654321")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;{
"data": [
{
"created_at": "2022-02-18T07:20:50Z",
"is_mature": false
}
]
}Cancel a raid
Cancel a pending raid.
You can cancel a raid at any point up until the broadcaster clicks Raid Now in the Twitch UX or the 90-second countdown expires.
Rate Limit: The limit is 10 requests within a 10-minute window.
Endpoint
DELETEhttps://api.twitch.tv/helix/raids
Authorization
Requires one of the following:
- A user access token that includes the channel:manage:raids scope.
Query Parameters
broadcaster_idStringRequiredThe ID of the broadcaster that initiated the raid. This ID must match the user ID in the user access token.
Response Codes
- 204No Content
- The pending raid was successfully canceled.
- 400Bad Request
- The broadcaster_id query parameter is required.
- 401Unauthorized
- The ID in broadcaster_id must match the user ID found in the request's OAuth token.
- The Authorization header is required and must contain a user access token.
- The user access token must include the channel:manage:raids 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 broadcaster doesn't have a pending raid to cancel.
- 429Too Many Requests
- The broadcaster exceeded the number of raid requests that they may make. The limit is 10 requests within a 10-minute window.
curl -X DELETE 'https://api.twitch.tv/helix/raids?broadcaster_id=12345678' \
-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/raids?broadcaster_id=12345678" `
-Method Delete -Headers $headersconst response = await fetch("https://api.twitch.tv/helix/raids?broadcaster_id=12345678", {
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/raids",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Client-Id": "YOUR_CLIENT_ID",
},
params={
"broadcaster_id": "12345678",
},
)
data = response.json()req, _ := http.NewRequest("DELETE", "https://api.twitch.tv/helix/raids?broadcaster_id=12345678", 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/raids?broadcaster_id=12345678");
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/raids?broadcaster_id=12345678");
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/raids?broadcaster_id=12345678")
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Client-Id", "YOUR_CLIENT_ID")
.send()
.await?;
let data = response.text().await?;