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

# List all programs

> Retrieve a paginated list of the programs you're enrolled in, sorted by newest enrollment first. Use a program's ID to filter your commissions, payouts and customers.

> [!NOTE]
>
> This endpoint requires an API key with the `programs.read`
> [scope](https://dub.co/docs/partner-api-reference/authentication.md#scopes). Dub's network
> program isn't included.

Use a program's `id` as the `programId` filter on [`GET /commissions`](https://dub.co/docs/partner-api-reference/commissions/list), [`GET /payouts`](https://dub.co/docs/partner-api-reference/payouts/list), and [`GET /customers`](https://dub.co/docs/partner-api-reference/customers/list).

If a program hides revenue from you, its `totalSaleAmount` is `null`.


## OpenAPI

````yaml https://dub.co/partner-openapi.json GET /programs
openapi: 3.0.3
info:
  title: Dub Partner API
  description: >-
    The Dub Partner API lets partners access their data across all the programs
    they're enrolled in.
  version: 0.0.1
  contact:
    name: Dub Support
    email: support@dub.co
    url: https://dub.co/support
servers:
  - url: https://api.dub.co/p
    description: Production API
security:
  - token: []
paths:
  /programs:
    get:
      tags:
        - Programs
      summary: List all programs
      description: >-
        Retrieve a paginated list of the programs you're enrolled in, sorted by
        newest enrollment first. Use a program's ID to filter your commissions,
        payouts and customers.
      operationId: listPrograms
      parameters:
        - in: query
          name: pageSize
          schema:
            default: 50
            description: The number of items per page.
            example: 50
            type: integer
            minimum: 1
            maximum: 100
          description: The number of items per page.
        - in: query
          name: startingAfter
          schema:
            description: >-
              The ID of the last item on the current page. Returns the page
              after it.
            type: string
          description: >-
            The ID of the last item on the current page. Returns the page after
            it.
        - in: query
          name: endingBefore
          schema:
            description: >-
              The ID of the first item on the current page. Returns the page
              before it.
            type: string
          description: >-
            The ID of the first item on the current page. Returns the page
            before it.
        - in: query
          name: status
          schema:
            description: >-
              Filter the list of programs by enrollment status. Pass one status
              or a comma-separated list, for example `approved,invited`. One of:
              `pending`, `approved`, `rejected`, `invited`, `declined`,
              `deactivated`, `banned`, `archived`.
            type: string
          description: >-
            Filter the list of programs by enrollment status. Pass one status or
            a comma-separated list, for example `approved,invited`. One of:
            `pending`, `approved`, `rejected`, `invited`, `declined`,
            `deactivated`, `banned`, `archived`.
        - in: query
          name: search
          schema:
            description: Search programs by name.
            type: string
          description: Search programs by name.
        - in: header
          name: Dub-Version
          schema:
            description: >-
              The API version to use. Defaults to the version your API key was
              created with.
            type: string
            enum:
              - mozart
          description: >-
            The API version to use. Defaults to the version your API key was
            created with.
      responses:
        '200':
          description: The list of programs you're enrolled in.
          headers:
            Dub-Request-Id:
              required: true
              description: The ID of the request. Include it when contacting support.
              schema:
                type: string
                description: The ID of the request. Include it when contacting support.
            Dub-Version:
              required: true
              description: The API version used for the request.
              schema:
                type: string
                description: The API version used for the request.
            X-RateLimit-Limit:
              required: true
              description: The number of requests allowed in the current window.
              schema:
                type: number
                description: The number of requests allowed in the current window.
            X-RateLimit-Remaining:
              required: true
              description: The number of requests left in the current window.
              schema:
                type: number
                description: The number of requests left in the current window.
            X-RateLimit-Reset:
              required: true
              description: When the current window resets, as a Unix timestamp in seconds.
              schema:
                type: number
                description: >-
                  When the current window resets, as a Unix timestamp in
                  seconds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PartnerProgram'
                  hasMore:
                    type: boolean
                    description: >-
                      Whether there are more programs in the direction you're
                      paging.
                required:
                  - data
                  - hasMore
                additionalProperties: false
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '410':
          $ref: '#/components/responses/410'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - token: []
        - oauth:
            - programs.read
components:
  schemas:
    PartnerProgram:
      type: object
      properties:
        id:
          type: string
          description: >-
            The unique ID of the program. Use it to filter your commissions,
            payouts and customers.
        name:
          type: string
          description: The name of the program.
        slug:
          type: string
          description: The slug of the program.
        logo:
          nullable: true
          description: The logo URL of the program.
          type: string
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
            - invited
            - declined
            - deactivated
            - banned
            - archived
          description: The status of your enrollment in the program.
        createdAt:
          description: >-
            The date and time when you applied to, were invited to or joined the
            program.
          type: string
        updatedAt:
          description: The date and time when the enrollment was last updated.
          type: string
        bannedAt:
          nullable: true
          description: The date and time when the program banned you, if it did.
          type: string
        totalClicks:
          type: number
          description: The number of clicks on your links in the program.
        totalLeads:
          type: number
          description: The number of leads you referred to the program.
        totalConversions:
          type: number
          description: The number of leads that converted to paying customers.
        totalSales:
          type: number
          description: The number of sales you referred to the program.
        totalSaleAmount:
          nullable: true
          description: >-
            The total amount of the sales you referred, in cents. `null` when
            the program hides revenue from you.
          type: number
        totalCommissions:
          type: number
          description: The total commissions you earned in the program, in cents.
        rewards:
          type: array
          items:
            $ref: '#/components/schemas/PartnerProgramReward'
          description: >-
            The rewards you earn in the program. The program can give a link its
            own reward for an event type, such as sales. Events of that type on
            that link earn the link's reward instead, and this list does not
            show it. Other event types on that link still earn the rewards in
            this list.
        discount:
          nullable: true
          description: >-
            The discount your referred customers get, or `null` if there is
            none. A link can have its own discount set by the program. Customers
            referred through that link get the link's discount instead, and this
            field does not show it.
          type: object
          properties:
            id:
              type: string
              description: The unique ID of the discount.
            amount:
              type: number
              description: >-
                The discount amount, in cents when `type` is `flat` or as a
                percentage when `type` is `percentage`.
            type:
              type: string
              enum:
                - percentage
                - flat
              description: Whether the discount is a flat amount or a percentage.
            maxDuration:
              nullable: true
              description: >-
                The number of months the discount applies. `0` means only the
                first purchase, `null` means for the customer's lifetime.
              type: number
            description:
              nullable: true
              description: The program's description of the discount.
              type: string
          required:
            - id
            - amount
            - type
            - maxDuration
            - description
          additionalProperties: false
        links:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The unique ID of the short link.
              key:
                type: string
                description: >-
                  The short link slug. If not provided, a random 7-character
                  slug will be generated.
              domain:
                type: string
                description: >-
                  The domain of the short link. If not provided, the primary
                  domain for the workspace will be used (or `dub.sh` if the
                  workspace has no domains).
              shortLink:
                type: string
                format: uri
                description: >-
                  The full URL of the short link, including the https protocol
                  (e.g. `https://dub.sh/try`).
              url:
                type: string
                description: The destination URL of the short link.
              partnerLinkTitle:
                nullable: true
                description: The partner's private title for the short link.
                type: string
            required:
              - id
              - key
              - domain
              - shortLink
              - url
              - partnerLinkTitle
            additionalProperties: false
          description: >-
            Your top 10 links in the program, by the total amount of the sales
            they referred, highest first.
      required:
        - id
        - name
        - slug
        - logo
        - status
        - createdAt
        - updatedAt
        - bannedAt
        - totalClicks
        - totalLeads
        - totalConversions
        - totalSales
        - totalSaleAmount
        - totalCommissions
        - rewards
        - discount
        - links
      additionalProperties: false
    PartnerProgramReward:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the reward.
        event:
          type: string
          enum:
            - click
            - lead
            - sale
            - referral
            - custom
          description: The event that earns the reward.
        type:
          type: string
          enum:
            - percentage
            - flat
          description: Whether the reward is a flat amount or a percentage of the sale.
        amountInCents:
          nullable: true
          description: The flat reward amount, in cents. Set when `type` is `flat`.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        amountInPercentage:
          nullable: true
          description: >-
            The reward as a percentage of the sale amount. Set when `type` is
            `percentage`.
          type: number
        maxDuration:
          nullable: true
          description: >-
            The number of months a recurring sale earns the reward. `0` means
            only the first sale, `null` means for the customer's lifetime.
          type: number
        description:
          type: string
          description: >-
            The reward as text, for example `30% per sale for 12 months`. It is
            the program's own description when the program has one.
      required:
        - id
        - event
        - type
        - amountInCents
        - amountInPercentage
        - maxDuration
        - description
      additionalProperties: false
  responses:
    '400':
      description: >-
        The server cannot or will not process the request due to something that
        is perceived to be a client error (e.g., malformed request syntax,
        invalid request message framing, or deceptive request routing).
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad_request
                    description: A short code indicating the error code returned.
                    example: bad_request
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#bad-request
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '401':
      description: >-
        Although the HTTP standard specifies "unauthorized", semantically this
        response means "unauthenticated". That is, the client must authenticate
        itself to get the requested response.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: A short code indicating the error code returned.
                    example: unauthorized
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#unauthorized
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '403':
      description: >-
        The client does not have access rights to the content; that is, it is
        unauthorized, so the server is refusing to give the requested resource.
        Unlike 401 Unauthorized, the client's identity is known to the server.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - forbidden
                    description: A short code indicating the error code returned.
                    example: forbidden
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#forbidden
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '404':
      description: The server cannot find the requested resource.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not_found
                    description: A short code indicating the error code returned.
                    example: not_found
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#not-found
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '409':
      description: >-
        This response is sent when a request conflicts with the current state of
        the server.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - conflict
                    description: A short code indicating the error code returned.
                    example: conflict
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#conflict
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '410':
      description: >-
        This response is sent when the requested content has been permanently
        deleted from server, with no forwarding address.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - invite_expired
                    description: A short code indicating the error code returned.
                    example: invite_expired
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://dub.co/docs/api-reference/errors#invite-expired
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '422':
      description: >-
        The request was well-formed but was unable to be followed due to
        semantic errors.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unprocessable_entity
                    description: A short code indicating the error code returned.
                    example: unprocessable_entity
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://dub.co/docs/api-reference/errors#unprocessable-entity
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '429':
      description: >-
        The user has sent too many requests in a given amount of time ("rate
        limiting")
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
        Dub-Version:
          required: true
          description: The API version used for the request.
          schema:
            type: string
            description: The API version used for the request.
        X-RateLimit-Limit:
          required: true
          description: The number of requests allowed in the current window.
          schema:
            type: number
            description: The number of requests allowed in the current window.
        X-RateLimit-Remaining:
          required: true
          description: The number of requests left in the current window.
          schema:
            type: number
            description: The number of requests left in the current window.
        X-RateLimit-Reset:
          required: true
          description: When the current window resets, as a Unix timestamp in seconds.
          schema:
            type: number
            description: When the current window resets, as a Unix timestamp in seconds.
        Retry-After:
          required: true
          description: The number of seconds to wait before retrying.
          schema:
            type: number
            description: The number of seconds to wait before retrying.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - rate_limit_exceeded
                    description: A short code indicating the error code returned.
                    example: rate_limit_exceeded
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://dub.co/docs/api-reference/errors#rate-limit-exceeded
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
    '500':
      description: The server has encountered a situation it does not know how to handle.
      headers:
        Dub-Request-Id:
          required: true
          description: The ID of the request. Include it when contacting support.
          schema:
            type: string
            description: The ID of the request. Include it when contacting support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - internal_server_error
                    description: A short code indicating the error code returned.
                    example: internal_server_error
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://dub.co/docs/api-reference/errors#internal-server-error
                  request_id:
                    type: string
                    description: >-
                      The ID of the request, also returned in the
                      `Dub-Request-Id` header.
                    example: req_1KQ7YX7Z3H5T0A2B4C6D8E9F0G
                required:
                  - code
                  - message
                  - request_id
            required:
              - error
  securitySchemes:
    token:
      type: http
      description: Partner API key
      scheme: bearer
    oauth:
      type: oauth2
      description: OAuth sign-in for partner accounts
      flows:
        authorizationCode:
          authorizationUrl: https://partners.dub.co/oauth/authorize
          tokenUrl: https://api.dub.co/p/oauth/token
          refreshUrl: https://api.dub.co/p/oauth/token
          scopes:
            commissions.read: Read your commissions
            payouts.read: Read your payouts
            customers.read: Read your referred customers
            programs.read: Read your enrolled programs (and programs in the marketplace)
            messages.read: Read your messages with programs
            messages.write: Send messages to programs
            offline_access: Stay connected with a refresh token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.