User Authorization Grant
The user.authorization.grant subscription type sends a notification each time a user authorizes your client id. That's the first time they authorize your app, and again each time they authorize it afterwards through the authorization code, implicit grant, or device code flow. This includes when they grant additional scopes, and when Twitch approves the request without prompting them because they already granted the requested scopes (force_verify isn't true). Twitch sends the notification when the request is approved, whether or not your app then exchanges the code or gets a token. A repeat authorization has the same payload as the first one.
You can't create this subscription with the WebSocket transport. Through a conduit, notifications are delivered to the conduit's shards, including WebSocket shards.
Subscription
- Type
user.authorization.grant- Version
1
Authorization
Requires one of the following:
- An app access token.The Client ID in the token must match the client_id specified in the condition.
Subscription Request Body
typeStringRequiredThe subscription type name:user.authorization.grant.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSubscription-specific parameters. Pass in the client ID of the application you want to get user authorization grant notifications for.Hide child attributesShow child attributes
condition.client_idStringRequiredYour application's client id. The provided client_id must match the client id in the application access token.
transportObjectRequiredTransport-specific parameters.Hide child attributesShow child attributes
transport.methodStringRequiredThe transport method for EventSub.Possible values
webhookwebsocketconduit
transport.callbackStringThe callback URL where notifications are sent. The URL must use the HTTPS protocol and port 443, and its host must resolve to a public IPv4 address. Hosts that resolve only to IPv6 addresses aren't supported. See Processing an Event.
Required if method is webhook. Don't specify it for other methods.
NOTE: Redirects are not followed.
transport.secretStringThe secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see Verifying the event message.
Required if method is webhook. Don't specify it for other methods.
transport.session_idStringAn ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message.
Required if method is websocket. Don't specify it for other methods.
transport.conduit_idStringAn ID that identifies the conduit to send this notification to. When you create a conduit, the server returns the ID in the API response.
Required if method is conduit. Don't specify it for other methods.
Event Payload
subscriptionObjectMetadata about the subscription.Hide child attributesShow child attributes
subscription.idStringThe Subscription ID of the subscription.subscription.typeStringThe notification's subscription type.subscription.versionStringThe version of the subscription.subscription.statusStringThe status of the subscription.subscription.costIntegerHow much the subscription counts against your limit. See Subscription Limits for more information.subscription.conditionObjectSubscription-specific parameters.Hide child attributesShow child attributes
subscription.condition.client_idStringYour application's client id. The provided client_id must match the client id in the application access token.
subscription.created_atStringThe UTC date and time (in RFC3339 format) of when the subscription was created.subscription.transportObjectThe transport that the notification was sent over.Hide child attributesShow child attributes
subscription.transport.methodStringThe transport method.Possible values
webhookwebsocketconduit
subscription.transport.callbackStringThe callback URL where notifications are sent. Included only ifmethodis webhook.subscription.transport.session_idStringThe ID of the WebSocket session that notifications are sent to. Included only ifmethodis websocket.subscription.transport.conduit_idStringThe ID of the conduit that notifications are sent to. Included only ifmethodis conduit.
eventObjectThe event information.Hide child attributesShow child attributes
event.client_idStringThe client_id of the application that was granted user access.event.user_idStringThe user id for the user who has granted authorization for your client id.event.user_loginStringThe user login for the user who has granted authorization for your client id.event.user_nameStringThe user display name for the user who has granted authorization for your client id.
{
"type": "user.authorization.grant",
"version": "1",
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "user.authorization.grant",
"version": "1",
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"type": "user.authorization.grant",
"version": "1",
"status": "enabled",
"cost": 1,
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2019-11-16T10:11:12.634234626Z"
},
"event": {
"client_id": "crq72vsaoijkc83xx42hz6i37",
"user_id": "1337",
"user_login": "cool_user",
"user_name": "Cool_User"
}
}User Authorization Revoke
The user.authorization.revoke subscription type sends a notification when a user's authorization for your client ID is revoked. This happens when the user disconnects your app, and also when Twitch revokes the user's authorizations: for example, when the user changes or resets their password, turns on two-factor authentication, or signs out of all sessions, and when the user's account is deleted, disabled, or suspended. The notification doesn't say why the authorization was revoked. Revoking an access token or refresh token doesn't send this notification. Use this subscription to meet government requirements for handling user data, such as GDPR, LGPD, or CCPA.
You can't create this subscription with the WebSocket transport. Through a conduit, notifications are delivered to the conduit's shards, including WebSocket shards.
Subscription
- Type
user.authorization.revoke- Version
1
Authorization
Requires one of the following:
- An app access token.The Client ID in the token must match the client_id specified in the condition.
Subscription Request Body
typeStringRequiredThe subscription type name:user.authorization.revoke.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSubscription-specific parameters. Pass in the client ID of the application you want to get user authorization revoke notifications for.Hide child attributesShow child attributes
condition.client_idStringRequiredYour application's client id. The provided client_id must match the client id in the application access token.
transportObjectRequiredTransport-specific parameters.Hide child attributesShow child attributes
transport.methodStringRequiredThe transport method for EventSub.Possible values
webhookwebsocketconduit
transport.callbackStringThe callback URL where notifications are sent. The URL must use the HTTPS protocol and port 443, and its host must resolve to a public IPv4 address. Hosts that resolve only to IPv6 addresses aren't supported. See Processing an Event.
Required if method is webhook. Don't specify it for other methods.
NOTE: Redirects are not followed.
transport.secretStringThe secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see Verifying the event message.
Required if method is webhook. Don't specify it for other methods.
transport.session_idStringAn ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message.
Required if method is websocket. Don't specify it for other methods.
transport.conduit_idStringAn ID that identifies the conduit to send this notification to. When you create a conduit, the server returns the ID in the API response.
Required if method is conduit. Don't specify it for other methods.
Event Payload
subscriptionObjectMetadata about the subscription.Hide child attributesShow child attributes
subscription.idStringThe Subscription ID of the subscription.subscription.typeStringThe notification's subscription type.subscription.versionStringThe version of the subscription.subscription.statusStringThe status of the subscription.subscription.costIntegerHow much the subscription counts against your limit. See Subscription Limits for more information.subscription.conditionObjectSubscription-specific parameters.Hide child attributesShow child attributes
subscription.condition.client_idStringYour application's client id. The provided client_id must match the client id in the application access token.
subscription.created_atStringThe UTC date and time (in RFC3339 format) of when the subscription was created.subscription.transportObjectThe transport that the notification was sent over.Hide child attributesShow child attributes
subscription.transport.methodStringThe transport method.Possible values
webhookwebsocketconduit
subscription.transport.callbackStringThe callback URL where notifications are sent. Included only ifmethodis webhook.subscription.transport.session_idStringThe ID of the WebSocket session that notifications are sent to. Included only ifmethodis websocket.subscription.transport.conduit_idStringThe ID of the conduit that notifications are sent to. Included only ifmethodis conduit.
eventObjectThe event information.Hide child attributesShow child attributes
event.client_idStringThe client_id of the application with revoked user access.event.user_idStringThe ID of the user whose authorization for your client ID was revoked.event.user_loginStringNullableThe login name of the user whose authorization for your client ID was revoked. This is null if the user's account was permanently removed before Twitch sent the notification. When a user deletes their account, the notification still includes their login name.event.user_nameStringNullableThe display name of the user whose authorization for your client ID was revoked. This is null if the user's account was permanently removed before Twitch sent the notification. When a user deletes their account, the notification still includes their display name.
{
"type": "user.authorization.revoke",
"version": "1",
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "user.authorization.revoke",
"version": "1",
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"type": "user.authorization.revoke",
"version": "1",
"status": "enabled",
"cost": 1,
"condition": {
"client_id": "crq72vsaoijkc83xx42hz6i37"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2019-11-16T10:11:12.634234626Z"
},
"event": {
"client_id": "crq72vsaoijkc83xx42hz6i37",
"user_id": "1337",
"user_login": "cool_user",
"user_name": "Cool_User"
}
}User Update
The user.update subscription type sends a notification when a user's display name, email address, or description changes. Changes to other account settings, such as the username, profile image, banner, language, or email verification status, don't send a notification.
The email and email_verified fields are populated only if the user identified by user_id has granted your app the user:read:email scope. For a WebSocket subscription, the user access token you used to create the subscription must also belong to that user. Otherwise, email is an empty string and email_verified is false. If the user's email address changed but their display name and description didn't, you receive the notification only if these conditions are met.
Subscription
- Type
user.update- Version
1
Authorization
No authorization required.
Subscription Request Body
typeStringRequiredThe subscription type name:user.update.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSubscription-specific parameters. Pass in the user ID for the user you want update notifications for.Hide child attributesShow child attributes
condition.user_idStringRequiredThe user ID for the user you want update notifications for.
transportObjectRequiredTransport-specific parameters.Hide child attributesShow child attributes
transport.methodStringRequiredThe transport method for EventSub.Possible values
webhookwebsocketconduit
transport.callbackStringThe callback URL where notifications are sent. The URL must use the HTTPS protocol and port 443, and its host must resolve to a public IPv4 address. Hosts that resolve only to IPv6 addresses aren't supported. See Processing an Event.
Required if method is webhook. Don't specify it for other methods.
NOTE: Redirects are not followed.
transport.secretStringThe secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see Verifying the event message.
Required if method is webhook. Don't specify it for other methods.
transport.session_idStringAn ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message.
Required if method is websocket. Don't specify it for other methods.
transport.conduit_idStringAn ID that identifies the conduit to send this notification to. When you create a conduit, the server returns the ID in the API response.
Required if method is conduit. Don't specify it for other methods.
Event Payload
subscriptionObjectMetadata about the subscription.Hide child attributesShow child attributes
subscription.idStringThe Subscription ID of the subscription.subscription.typeStringThe notification's subscription type.subscription.versionStringThe version of the subscription.subscription.statusStringThe status of the subscription.subscription.costIntegerHow much the subscription counts against your limit. See Subscription Limits for more information.subscription.conditionObjectSubscription-specific parameters.Hide child attributesShow child attributes
subscription.condition.user_idStringThe user ID for the user you want update notifications for.
subscription.created_atStringThe UTC date and time (in RFC3339 format) of when the subscription was created.subscription.transportObjectThe transport that the notification was sent over.Hide child attributesShow child attributes
subscription.transport.methodStringThe transport method.Possible values
webhookwebsocketconduit
subscription.transport.callbackStringThe callback URL where notifications are sent. Included only ifmethodis webhook.subscription.transport.session_idStringThe ID of the WebSocket session that notifications are sent to. Included only ifmethodis websocket.subscription.transport.conduit_idStringThe ID of the conduit that notifications are sent to. Included only ifmethodis conduit.
eventObjectThe event information.Hide child attributesShow child attributes
event.user_idStringThe user's user id.event.user_loginStringThe user's user login.event.user_nameStringThe user's user display name.event.emailStringThe user's email address. The event includes the user's email address only if the app used to request this event type includes theuser:read:emailscope for the user; otherwise, the field is set to an empty string. For a WebSocket subscription, the user access token you used to create the subscription must also belong to the user identified by user_id. The field is also an empty string if the user's account doesn't have an email address. See Create EventSub Subscription.event.email_verifiedBooleanA Boolean value that determines whether Twitch has verified the user's email address. Is true if Twitch has verified the email address; otherwise, false.
NOTE: Ignore this field if the
emailfield contains an empty string.event.descriptionStringThe user's description.
{
"type": "user.update",
"version": "1",
"condition": {
"user_id": "1337"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "user.update",
"version": "1",
"condition": {
"user_id": "1337"
},
"transport": {
"method": "websocket",
"session_id": "AQoQexAWVYKSTIu4ec_2VAxyuhAB"
}
}{
"type": "user.update",
"version": "1",
"condition": {
"user_id": "1337"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"type": "user.update",
"version": "1",
"status": "enabled",
"cost": 0,
"condition": {
"user_id": "1337"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2019-11-16T10:11:12.634234626Z"
},
"event": {
"user_id": "1337",
"user_login": "cool_user",
"user_name": "Cool_User",
"email": "user@email.com",
"email_verified": true,
"description": "cool description"
}
}Whisper Received
The user.whisper.message subscription type sends a notification when a user receives a whisper.
Subscription
- Type
user.whisper.message- Version
1
Authorization
Requires one of the following:
- A user access token that includes the user:read:whispers or user:manage:whispers scope.The User ID associated with the token must match the user_id in the event's condition.
- An app access token.The application, through prior authorization, must have been granted:
- The user:read:whispers or user:manage:whispers scope for the user represented by the user_id event condition.
Subscription Request Body
typeStringRequiredThe subscription type name:user.whisper.message.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSubscription-specific parameters.Hide child attributesShow child attributes
condition.user_idStringRequiredThe user_id of the person receiving whispers.
transportObjectRequiredTransport-specific parameters.Hide child attributesShow child attributes
transport.methodStringRequiredThe transport method for EventSub.Possible values
webhookwebsocketconduit
transport.callbackStringThe callback URL where notifications are sent. The URL must use the HTTPS protocol and port 443, and its host must resolve to a public IPv4 address. Hosts that resolve only to IPv6 addresses aren't supported. See Processing an Event.
Required if method is webhook. Don't specify it for other methods.
NOTE: Redirects are not followed.
transport.secretStringThe secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see Verifying the event message.
Required if method is webhook. Don't specify it for other methods.
transport.session_idStringAn ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message.
Required if method is websocket. Don't specify it for other methods.
transport.conduit_idStringAn ID that identifies the conduit to send this notification to. When you create a conduit, the server returns the ID in the API response.
Required if method is conduit. Don't specify it for other methods.
Event Payload
subscriptionObjectMetadata about the subscription.Hide child attributesShow child attributes
subscription.idStringThe Subscription ID of the subscription.subscription.typeStringThe notification's subscription type.subscription.versionStringThe version of the subscription.subscription.statusStringThe status of the subscription.subscription.costIntegerHow much the subscription counts against your limit. See Subscription Limits for more information.subscription.conditionObjectSubscription-specific parameters.Hide child attributesShow child attributes
subscription.condition.user_idStringThe user_id of the person receiving whispers.
subscription.created_atStringThe UTC date and time (in RFC3339 format) of when the subscription was created.subscription.transportObjectThe transport that the notification was sent over.Hide child attributesShow child attributes
subscription.transport.methodStringThe transport method.Possible values
webhookwebsocketconduit
subscription.transport.callbackStringThe callback URL where notifications are sent. Included only ifmethodis webhook.subscription.transport.session_idStringThe ID of the WebSocket session that notifications are sent to. Included only ifmethodis websocket.subscription.transport.conduit_idStringThe ID of the conduit that notifications are sent to. Included only ifmethodis conduit.
eventObjectThe event information.Hide child attributesShow child attributes
event.from_user_idStringThe ID of the user sending the message.event.from_user_nameStringThe name of the user sending the message.event.from_user_loginStringThe login of the user sending the message.event.to_user_idStringThe ID of the user receiving the message.event.to_user_nameStringThe name of the user receiving the message.event.to_user_loginStringThe login of the user receiving the message.event.whisper_idStringThe whisper ID.event.whisperObjectObject containing whisper information.Hide child attributesShow child attributes
event.whisper.textStringThe body of the whisper message.
{
"type": "user.whisper.message",
"version": "1",
"condition": {
"user_id": "423374343"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "user.whisper.message",
"version": "1",
"condition": {
"user_id": "423374343"
},
"transport": {
"method": "websocket",
"session_id": "AQoQexAWVYKSTIu4ec_2VAxyuhAB"
}
}{
"type": "user.whisper.message",
"version": "1",
"condition": {
"user_id": "423374343"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "7297f7eb-3bf5-461f-8ae6-7cd7781ebce3",
"status": "enabled",
"type": "user.whisper.message",
"version": "1",
"condition": {
"user_id": "423374343"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2024-02-23T21:12:33.771005262Z",
"cost": 0
},
"event": {
"from_user_id": "424596340",
"from_user_login": "quotrok",
"from_user_name": "quotrok",
"to_user_id": "423374343",
"to_user_login": "glowillig",
"to_user_name": "glowillig",
"whisper_id": "34f4f3f0-2f6e-4b0a-9d1c-5b0e7c3d2a11",
"whisper": {
"text": "a secret"
}
}
}