Drop

Events raised when a Drop entitlement is granted.

View as markdown
Provide feedback for this page

Drop Entitlement Grant

The drop.entitlement.grant subscription type sends a notification when a user claims a Drop and is granted an entitlement for it. Each reward in the claimed Drop that your game fulfills produces its own entitlement. Rewards that Twitch fulfills itself, such as badges and emotes, don't send this notification.

Note

This subscription type is only supported by Webhooks.

Subscription

Type
drop.entitlement.grant
Version
1

Authorization

Requires one of the following:

  • An app access token.The client ID in the access token must belong to an application owned by the organization specified in organization_id, and the application's owner must be a member of that organization. Twitch repeats this check before sending each notification. If it fails, for example because the application's owner left the organization, the subscription is revoked with status authorization_revoked.

Subscription Request Body

  • typeStringRequired
    The subscription type name: drop.entitlement.grant.
  • versionStringRequired
    The subscription type version: 1.
  • conditionObjectRequired
    Subscription-specific parameters. Pass in the organization_id to subscribe to all drop entitlement grant notifications for that organization.
    Hide child attributesShow child attributes
    • condition.organization_idStringRequired
      The ID of the organization that owns the game. Your application must belong to this organization.
    • condition.category_idString
      The category (or game) ID of the game for which entitlement notifications will be received.
    • condition.campaign_idString
      The campaign ID for a specific campaign for which entitlement notifications will be received.
  • transportObjectRequired
    Transport-specific parameters.
    Hide child attributesShow child attributes
    • transport.methodStringRequired
      The transport method for EventSub.

      Possible values

      • webhook
      • websocket
      • conduit
    • transport.callbackString

      The 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.secretString

      The 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_idString

      An 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_idString

      An 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.

  • is_batching_enabledBooleanRequired
    Needs to be true for this subscription type.

Event Payload

  • subscriptionObject
    Metadata about the subscription.
    Hide child attributesShow child attributes
    • subscription.idString
      The Subscription ID of the subscription.
    • subscription.typeString
      The notification's subscription type.
    • subscription.versionString
      The version of the subscription.
    • subscription.statusString
      The status of the subscription.
    • subscription.costInteger
      How much the subscription counts against your limit. See Subscription Limits for more information.
    • subscription.conditionObject
      Subscription-specific parameters.
      Hide child attributesShow child attributes
      • subscription.condition.organization_idString
        The ID of the organization that owns the game. Your application must belong to this organization.
      • subscription.condition.category_idString
        The category (or game) ID of the game for which entitlement notifications will be received. Is an empty string if you didn't specify it when you subscribed.
      • subscription.condition.campaign_idString
        The campaign ID for a specific campaign for which entitlement notifications will be received. Is an empty string if you didn't specify it when you subscribed.
    • subscription.created_atString
      The UTC date and time (in RFC3339 format) of when the subscription was created.
    • subscription.transportObject
      The transport that the notification was sent over.
      Hide child attributesShow child attributes
      • subscription.transport.methodString
        The transport method.

        Possible values

        • webhook
        • websocket
        • conduit
      • subscription.transport.callbackString
        The callback URL where notifications are sent. Included only if method is webhook.
      • subscription.transport.session_idString
        The ID of the WebSocket session that notifications are sent to. Included only if method is websocket.
      • subscription.transport.conduit_idString
        The ID of the conduit that notifications are sent to. Included only if method is conduit.
    • subscription.is_batching_enabledBoolean
      Always true, because this subscription type's notifications are batched.
  • eventsObject[]
    The entitlements granted in this notification. Notifications are batched, so a notification carries one or more.
    Hide child attributesShow child attributes
    • events.idString
      Individual event ID, as assigned by EventSub. Use this for de-duplicating messages.
    • events.dataObject
      The granted entitlement.
      Hide child attributesShow child attributes
      • events.data.organization_idString
        The ID of the organization that owns the game that has Drops enabled.
      • events.data.category_idString
        The ID of the category (game) that the Drop's benefit is for.
      • events.data.category_nameString
        The category name.
      • events.data.campaign_idString
        The campaign this entitlement is associated with.
      • events.data.user_idString
        Twitch user ID of the user who was granted the entitlement.
      • events.data.user_nameString
        The user display name of the user who was granted the entitlement.
      • events.data.user_loginString
        The user login of the user who was granted the entitlement.
      • events.data.entitlement_idString
        Unique identifier of the entitlement. Use this to de-duplicate entitlements.
      • events.data.benefit_idString
        Identifier of the Benefit.
      • events.data.created_atString
        The UTC date and time (in RFC3339 format) of when the user earned the Drop. The notification is sent when the user claims the Drop, so this can be earlier than the notification.
Subscription Request Body Example
{
  "type": "drop.entitlement.grant",
  "version": "1",
  "condition": {
    "organization_id": "8b65e332-9430-4b49-a064-b7c4913c82e4",
    "category_id": "9002",
    "campaign_id": "f3345e7d-d89b-4ecb-bfcb-11c0cd37163c"
  },
  "transport": {
    "method": "webhook",
    "callback": "https://example.com/webhooks/callback",
    "secret": "s3cRe7"
  },
  "is_batching_enabled": true
}
Event Payload Example
{
    "subscription": {
        "id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
        "type": "drop.entitlement.grant",
        "version": "1",
        "status": "enabled",
        "cost": 1,
        "condition": {
            "organization_id": "8b65e332-9430-4b49-a064-b7c4913c82e4",
            "category_id": "9002",
            "campaign_id": "f3345e7d-d89b-4ecb-bfcb-11c0cd37163c"
        },
        "transport": {
            "method": "webhook",
            "callback": "https://example.com/webhooks/callback"
        },
        "created_at": "2019-11-16T10:11:12.634234626Z",
        "is_batching_enabled": true
    },
    "events": [
        {
            "id": "OIsoE4U7dG8Kc93n1pdJTlIPZ-JdEs64MBHNIEuaTfw=",
            "data": {
                "organization_id": "8b65e332-9430-4b49-a064-b7c4913c82e4",
                "category_id": "9002",
                "category_name": "Fortnite",
                "campaign_id": "f3345e7d-d89b-4ecb-bfcb-11c0cd37163c",
                "user_id": "1234",
                "user_name": "Cool_User",
                "user_login": "cool_user",
                "entitlement_id": "MTIzNHw3NGM1MjI2NS1lMjE0LTQ4YTYtOTFiOS0yM2I2MDE0ZTgwNDF8OWM4ZTdhNTItNWQzYi00ZjFhLThiMGUtMmY2ZDRjMWE3ZTkz",
                "benefit_id": "74c52265-e214-48a6-91b9-23b6014e8041",
                "created_at": "2019-01-28T04:17:53.325Z"
            }
        },
        {
            "id": "NkcbI-kRlC0-BE-O367tI-pO98rUypS5gQIoKJJNZFA=",
            "data": {
                "organization_id": "8b65e332-9430-4b49-a064-b7c4913c82e4",
                "category_id": "9002",
                "category_name": "Fortnite",
                "campaign_id": "f3345e7d-d89b-4ecb-bfcb-11c0cd37163c",
                "user_id": "12345",
                "user_name": "Cooler_User",
                "user_login": "cooler_user",
                "entitlement_id": "MTIzNDV8NzRjNTIyNjUtZTIxNC00OGE2LTkxYjktMjNiNjAxNGU4MDQxfDFmMGIzYzZlLThhMmQtNGU1Ny05YzQxLTdiNWEyZTlkMGYxOA==",
                "benefit_id": "74c52265-e214-48a6-91b9-23b6014e8041",
                "created_at": "2019-01-28T04:17:53.325Z"
            }
        }
    ]
}