Goal Begin
Notifies the subscriber when a goal begins on the specified broadcaster's channel. A goal begins when the broadcaster or one of the channel's editors creates it, or when Twitch starts one automatically. For example, when the stream ends, an achieved goal that's set to renew automatically is replaced by a new goal of the same type with a new target.
It's possible to receive the Begin event after receiving Progress events.
Subscription
- Type
channel.goal.begin- Version
1
Authorization
Requires one of the following:
- A user access token that includes the channel:read:goals scope.
- An app access token.The application, through prior authorization, must have been granted:
- The channel:read:goals scope for the user represented by the broadcaster_user_id event condition.
Subscription Request Body
typeStringRequiredThe subscription type name:channel.goal.begin.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSet the Condition object's broadcaster_user_id field to the ID of the broadcaster whose goals you want to get notified about.Hide child attributesShow child attributes
condition.broadcaster_user_idStringRequiredThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.broadcaster_user_idStringThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.idStringAn ID that identifies the goal. The channel.goal.progress and channel.goal.end events for this goal carry the same ID, and it matches theidthat Get Creator Goals returns.event.broadcaster_user_idStringAn ID that uniquely identifies the broadcaster.event.broadcaster_user_nameStringThe broadcaster's display name.event.broadcaster_user_loginStringThe broadcaster's user handle.event.typeStringThe type of goal.Possible values
followThe goal is to increase followers.subscriptionThe goal is to increase subscriptions. This type shows the broadcaster's total tier points from subscriptions, which increase and decrease as users subscribe and unsubscribe.subscription_countThe goal is to increase subscriptions. This type shows the broadcaster's total number of subscriptions, which increases and decreases as users subscribe and unsubscribe.new_subscriptionThe goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).new_subscription_countThe goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).new_bitThe goal is to increase the amount of Bits used on the channel.new_cheererThe goal is to increase the number of unique Cheerers to Cheer on the channel.
event.descriptionStringA description of the goal. Is an empty string if not specified. The description may contain a maximum of 40 characters. Goals whosetypeis new_bit or new_cheerer don't have a description, so this field is always an empty string for them.event.current_amountIntegerThe goal's current value.
The goal's
typedetermines how this value is increased or decreased.- If
typeis follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster. - If
typeis subscription, this field is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1. - If
typeis subscription_count, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes. - If
typeis new_subscription, this field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1. - If
typeis new_subscription_count, this field is increased by 1 for each new subscription. - If
typeis new_bit, this field is increased by the number of Bits used on the channel. - If
typeis new_cheerer, this field is increased by 1 the first time each user Cheers on the channel after the goal starts. Other ways of using Bits don't count.
In the Begin event, this field is the goal's starting value: the broadcaster's current number of followers for follow goals, the channel's current subscription points or number of subscriptions for subscription and subscription_count goals, and 0 for new_subscription, new_subscription_count, new_bit and new_cheerer goals.
- If
event.target_amountIntegerThe goal's target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.event.started_atStringThe UTC timestamp in RFC 3339 format, which indicates when the goal began.
{
"type": "channel.goal.begin",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "channel.goal.begin",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "websocket",
"session_id": "AQoQexAWVYKSTIu4ec_2VAxyuhAB"
}
}{
"type": "channel.goal.begin",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"status": "enabled",
"type": "channel.goal.begin",
"version": "1",
"cost": 0,
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2021-07-15T10:11:12.123Z"
},
"event": {
"id": "1woowvbkiNv8BRxEWSqmQz6Zk92",
"broadcaster_user_id": "141981764",
"broadcaster_user_name": "TwitchDev",
"broadcaster_user_login": "twitchdev",
"type": "subscription",
"description": "Help me get partner!",
"current_amount": 100,
"target_amount": 220,
"started_at": "2021-07-15T17:16:03.17106713Z"
}
}Goal End
Notifies the subscriber when the specified broadcaster, or one of the broadcaster's editors, ends a goal.
It's possible to receive Progress events after receiving the End event.
Subscription
- Type
channel.goal.end- Version
1
Authorization
Requires one of the following:
- A user access token that includes the channel:read:goals scope.
- An app access token.The application, through prior authorization, must have been granted:
- The channel:read:goals scope for the user represented by the broadcaster_user_id event condition.
Subscription Request Body
typeStringRequiredThe subscription type name:channel.goal.end.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSet the Condition object's broadcaster_user_id field to the ID of the broadcaster whose goals you want to get notified about.Hide child attributesShow child attributes
condition.broadcaster_user_idStringRequiredThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.broadcaster_user_idStringThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.idStringAn ID that identifies the goal. The channel.goal.begin and channel.goal.progress events for this goal carry the same ID, and it matches theidthat Get Creator Goals returns.event.broadcaster_user_idStringAn ID that uniquely identifies the broadcaster.event.broadcaster_user_nameStringThe broadcaster's display name.event.broadcaster_user_loginStringThe broadcaster's user handle.event.typeStringThe type of goal.Possible values
followThe goal is to increase followers.subscriptionThe goal is to increase subscriptions. This type shows the broadcaster's total tier points from subscriptions, which increase and decrease as users subscribe and unsubscribe.subscription_countThe goal is to increase subscriptions. This type shows the broadcaster's total number of subscriptions, which increases and decreases as users subscribe and unsubscribe.new_subscriptionThe goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).new_subscription_countThe goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).new_bitThe goal is to increase the amount of Bits used on the channel.new_cheererThe goal is to increase the number of unique Cheerers to Cheer on the channel.
event.descriptionStringA description of the goal. Is an empty string if not specified. The description may contain a maximum of 40 characters. Goals whosetypeis new_bit or new_cheerer don't have a description, so this field is always an empty string for them.event.is_achievedBooleanA Boolean value that indicates whether the broadcaster achieved their goal. Is true if
current_amountwas greater than or equal totarget_amountwhen the goal ended; otherwise, false. For follow, subscription and subscription_count goals, this is false if unfollows or unsubscriptions broughtcurrent_amountback belowtarget_amountbefore the goal ended.Only the channel.goal.end event includes this field.
event.current_amountIntegerThe goal's current value.
The goal's
typedetermines how this value is increased or decreased.- If
typeis follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster. - If
typeis subscription, this field starts at the broadcaster's current total of subscription points when the goal begins, and is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1. - If
typeis subscription_count, this field starts at the broadcaster's current number of subscriptions when the goal begins, and is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes. - If
typeis new_subscription, this field starts at 0 and is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1. - If
typeis new_subscription_count, this field starts at 0 and is increased by 1 for each new subscription. - If
typeis new_bit, this field starts at 0 and is increased by the number of Bits used on the channel. - If
typeis new_cheerer, this field starts at 0 and is increased by 1 the first time each user Cheers on the channel after the goal starts. Other ways of using Bits don't count.
- If
event.target_amountIntegerThe goal's target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.event.started_atStringThe UTC timestamp in RFC 3339 format, which indicates when the broadcaster created the goal.event.ended_atStringThe UTC timestamp in RFC 3339 format, which indicates when the broadcaster ended the goal.
Only the channel.goal.end event includes this field.
{
"type": "channel.goal.end",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "channel.goal.end",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "websocket",
"session_id": "AQoQexAWVYKSTIu4ec_2VAxyuhAB"
}
}{
"type": "channel.goal.end",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"status": "enabled",
"type": "channel.goal.end",
"version": "1",
"cost": 0,
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2021-07-15T10:11:12.123Z"
},
"event": {
"id": "1woowvbkiNv8BRxEWSqmQz6Zk92",
"broadcaster_user_id": "141981764",
"broadcaster_user_name": "TwitchDev",
"broadcaster_user_login": "twitchdev",
"type": "subscription",
"description": "Help me get partner!",
"is_achieved": false,
"current_amount": 180,
"target_amount": 220,
"started_at": "2021-07-15T17:16:03.17106713Z",
"ended_at": "2021-07-16T17:16:03.17106713Z"
}
}Goal Progress
Notifies the subscriber when the specified broadcaster's goal is updated. Most updates report progress, which could be positive (added followers) or negative (lost followers). You also get this notification when the broadcaster or one of their editors changes the goal (for example, its description or target amount) and when they end the goal, so a notification doesn't always mean that current_amount changed.
It's possible to receive Progress events before receiving the Begin event.
When the broadcaster or one of their editors ends a goal, you receive a Progress event as well as the End event, in either order.
The broadcaster can have more than one active goal at a time, for example a follower goal, a subscription goal, and a Bits goal. You receive Progress events for each of them, so use the event's id field, which identifies the goal, to tell which goal an event is for.
Subscription
- Type
channel.goal.progress- Version
1
Authorization
Requires one of the following:
- A user access token that includes the channel:read:goals scope.
- An app access token.The application, through prior authorization, must have been granted:
- The channel:read:goals scope for the user represented by the broadcaster_user_id event condition.
Subscription Request Body
typeStringRequiredThe subscription type name:channel.goal.progress.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSet the Condition object's broadcaster_user_id field to the ID of the broadcaster whose goals you want to get notified about.Hide child attributesShow child attributes
condition.broadcaster_user_idStringRequiredThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.broadcaster_user_idStringThe ID of the broadcaster to get notified about. If you use a user access token, the ID must match the user ID in the token. If you use an app access token, the broadcaster must have authorized your app with the channel:read:goals scope.
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.idStringAn ID that identifies the goal. Every channel.goal.begin, channel.goal.progress and channel.goal.end notification for the goal has the same ID, which is also theidthat Get Creator Goals returns. To identify an individual notification, use the notification's message ID.event.broadcaster_user_idStringAn ID that uniquely identifies the broadcaster.event.broadcaster_user_nameStringThe broadcaster's display name.event.broadcaster_user_loginStringThe broadcaster's user handle.event.typeStringThe type of goal.Possible values
followThe goal is to increase followers.subscriptionThe goal is to increase subscriptions. This type shows the broadcaster's total tier points from subscriptions, which increase and decrease as users subscribe and unsubscribe.subscription_countThe goal is to increase subscriptions. This type shows the broadcaster's total number of subscriptions, which increases and decreases as users subscribe and unsubscribe.new_subscriptionThe goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).new_subscription_countThe goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).new_bitThe goal is to increase the amount of Bits used on the channel.new_cheererThe goal is to increase the number of unique Cheerers to Cheer on the channel.
event.descriptionStringA description of the goal. Is an empty string if not specified. The description may contain a maximum of 40 characters. Goals whosetypeis new_bit or new_cheerer don't have a description, so this field is always an empty string for them.event.current_amountIntegerThe goal's current value.
The goal's
typedetermines how this value is increased or decreased.- If
typeis follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster. - If
typeis subscription, this field starts at the broadcaster's current total of subscription points when the goal begins, and is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1. - If
typeis subscription_count, this field starts at the broadcaster's current number of subscriptions when the goal begins, and is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes. - If
typeis new_subscription, this field starts at 0 and is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1. - If
typeis new_subscription_count, this field starts at 0 and is increased by 1 for each new subscription. - If
typeis new_bit, this field starts at 0 and is increased by the number of Bits used on the channel. - If
typeis new_cheerer, this field starts at 0 and is increased by 1 the first time each user Cheers on the channel after the goal starts. Other ways of using Bits don't count.
If the broadcaster resets the goal's progress, this field is set to 0.
- If
event.target_amountIntegerThe goal's target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.event.started_atStringThe UTC timestamp in RFC 3339 format, which indicates when the broadcaster created the goal.
{
"type": "channel.goal.progress",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "channel.goal.progress",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "websocket",
"session_id": "AQoQexAWVYKSTIu4ec_2VAxyuhAB"
}
}{
"type": "channel.goal.progress",
"version": "1",
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"status": "enabled",
"type": "channel.goal.progress",
"version": "1",
"cost": 0,
"condition": {
"broadcaster_user_id": "141981764"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2021-07-15T10:11:12.123Z"
},
"event": {
"id": "1woowvbkiNv8BRxEWSqmQz6Zk92",
"broadcaster_user_id": "141981764",
"broadcaster_user_name": "TwitchDev",
"broadcaster_user_login": "twitchdev",
"type": "subscription",
"description": "Help me get partner!",
"current_amount": 120,
"target_amount": 220,
"started_at": "2021-07-15T17:16:03.17106713Z"
}
}