> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Grants

> List all grants for an entitlement, with optional filters by status and customer ID. Each grant carries the per-customer fulfillment state, including license keys and digital file download URLs where applicable.



## OpenAPI

````yaml get /entitlements/{id}/grants
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.105.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /entitlements/{id}/grants:
    get:
      tags:
        - Entitlements
      summary: GET /entitlements/{id}/grants (public API)
      operationId: list_grants_public_handler
      parameters:
        - name: id
          in: path
          description: Entitlement ID
          required: true
          schema:
            type: string
        - name: page_size
          in: query
          description: Page size (default 10, max 100)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
          style: form
        - name: page_number
          in: query
          description: Page number (default 0)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
          style: form
        - name: status
          in: query
          description: Filter by grant status
          required: false
          schema:
            type: string
            enum:
              - Pending
              - Delivered
              - Failed
              - Revoked
          style: form
        - name: customer_id
          in: query
          description: Filter by customer ID
          required: false
          schema:
            type: string
          style: form
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEntitlementGrantsResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Entitlement not found
        '422':
          description: Validation error
        '500':
          description: Something went wrong
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const entitlementGrant of
            client.entitlements.grants.list('id')) {
              console.log(entitlementGrant.id);
            }
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            page = client.entitlements.grants.list(
                id="id",
            )
            page = page.items[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tpage, err := client.Entitlements.Grants.List(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\tdodopayments.EntitlementGrantListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import
            com.dodopayments.api.models.entitlements.grants.GrantListPage;

            import
            com.dodopayments.api.models.entitlements.grants.GrantListParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    GrantListPage page = client.entitlements().grants().list("id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.entitlements.grants.GrantListPage

            import
            com.dodopayments.api.models.entitlements.grants.GrantListParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val page: GrantListPage = client.entitlements().grants().list("id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            page = dodo_payments.entitlements.grants.list("id")

            puts(page)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $page = $client->entitlements->grants->list(
                'id',
                customerID: 'customer_id',
                pageNumber: 0,
                pageSize: 0,
                status: 'Pending',
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Entitlements.Grants;

            DodoPaymentsClient client = new();

            GrantListParams parameters = new() { ID = "id" };

            var page = await client.Entitlements.Grants.List(parameters);
            await foreach (var item in page.Paginate())
            {
                Console.WriteLine(item);
            }
components:
  schemas:
    ListEntitlementGrantsResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementGrantResponse'
    EntitlementGrantResponse:
      type: object
      description: |-
        Detailed view of a single entitlement grant: who it's for, its
        lifecycle state, and any integration-specific delivery payload.
      required:
        - id
        - business_id
        - entitlement_id
        - customer_id
        - status
        - metadata
        - integration_type
        - created_at
        - updated_at
        - brand_id
      properties:
        brand_id:
          type: string
          description: Brand id this grant belongs to.
        business_id:
          type: string
          description: Identifier of the business that owns the grant.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the grant was created.
        customer_id:
          type: string
          description: Identifier of the customer the grant was issued to.
        delivered_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp when the grant transitioned to `delivered`, when
            applicable.
        digital_product_delivery:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DigitalProductDelivery'
              description: |-
                Digital-product-delivery payload, present when the entitlement
                integration is `digital_files`.
        entitlement_id:
          type: string
          description: Identifier of the entitlement this grant was issued from.
        error_code:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable code reported when delivery failed, when
            applicable.
        error_message:
          type:
            - string
            - 'null'
          description: >-
            Human-readable message reported when delivery failed, when
            applicable.
        id:
          type: string
          description: Unique identifier of the grant.
        integration_type:
          $ref: '#/components/schemas/EntitlementIntegrationType'
          description: >-
            The integration type of the grant's entitlement (e.g.
            `license_key`).
        license_key:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LicenseKeyGrant'
              description: >-
                License-key delivery payload, present when the entitlement
                integration

                is `license_key`.
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Arbitrary key-value metadata recorded on the grant.
        oauth_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when `oauth_url` stops being valid, when applicable.
        oauth_url:
          type:
            - string
            - 'null'
          description: |-
            Customer-facing OAuth URL for OAuth-style integrations. Populated
            during the customer-portal accept flow; `null` until the customer
            completes that step, and on grants for non-OAuth integrations.
        payment_id:
          type:
            - string
            - 'null'
          description: >-
            Identifier of the payment that triggered this grant, when
            applicable.
        revocation_reason:
          type:
            - string
            - 'null'
          description: Reason recorded when the grant was revoked, when applicable.
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the grant transitioned to `revoked`, when applicable.
        status:
          $ref: '#/components/schemas/EntitlementGrantStatus'
          description: Lifecycle status of the grant.
        subscription_id:
          type:
            - string
            - 'null'
          description: >-
            Identifier of the subscription that triggered this grant, when
            applicable.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the grant was last modified.
    DigitalProductDelivery:
      type: object
      title: Digital Product Delivery
      description: |-
        Digital-product-delivery payload, present on grants for `digital_files`
        entitlements. Each file carries a short-lived presigned download URL.
      required:
        - files
      properties:
        external_url:
          type:
            - string
            - 'null'
          description: |-
            Optional external URL, passed through from the entitlement
            configuration.
        files:
          type: array
          items:
            $ref: '#/components/schemas/DigitalProductDeliveryFile'
          description: One entry per attached file.
        instructions:
          type:
            - string
            - 'null'
          description: |-
            Optional human-readable delivery instructions, passed through from
            the entitlement configuration.
    EntitlementIntegrationType:
      type: string
      enum:
        - discord
        - telegram
        - github
        - figma
        - framer
        - notion
        - digital_files
        - license_key
    LicenseKeyGrant:
      type: object
      description: |-
        License-key delivery payload, present on grants for `license_key`
        entitlements. The grant's top-level `status` is the source of truth
        for the grant's lifecycle.
      required:
        - key
        - activations_used
      properties:
        activations_limit:
          type:
            - integer
            - 'null'
          format: int32
          description: Maximum activations allowed by the entitlement, when set.
        activations_used:
          type: integer
          format: int32
          description: Number of activations consumed so far.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the license key expires, when applicable.
        key:
          type: string
          description: Issued license key.
    Metadata:
      type: object
      additionalProperties:
        type: string
      propertyNames:
        type: string
    EntitlementGrantStatus:
      type: string
      enum:
        - Pending
        - Delivered
        - Failed
        - Revoked
    DigitalProductDeliveryFile:
      type: object
      title: Digital Product Delivery File
      description: One file in a digital-product delivery payload.
      required:
        - file_id
        - download_url
        - filename
        - expires_in
      properties:
        content_type:
          type:
            - string
            - 'null'
          description: Optional content-type declared at upload.
        download_url:
          type: string
          description: Short-lived presigned URL for downloading the file.
        expires_in:
          type: integer
          format: int64
          description: Seconds until `download_url` expires.
        file_id:
          type: string
          description: Identifier of the attached file.
        file_size:
          type:
            - integer
            - 'null'
          format: int64
          description: Optional size of the file in bytes.
        filename:
          type: string
          description: Original filename of the attached file.
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````