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

# Get Affiliate Analytics

> Returns the project affiliates with their totals for a period, oldest joiner first. Affiliates with no activity in the period are omitted. Note 1: this endpoint is only accessible with a secret API key. Note 2: a period may span at most 90 days; request a longer window a period at a time. Note 3: up to 100 affiliates are returned per request; page through the rest with `offset`.



## OpenAPI

````yaml get /analytics/affiliates
openapi: 3.0.0
info:
  title: WinWinKit API
  description: An API for interacting with WinWinKit.
  version: '1.0'
  contact:
    name: WinWinKit
    url: https://winwinkit.com
    email: support@winwinkit.com
servers:
  - url: https://api.winwinkit.com
    description: Production
security: []
tags:
  - name: Users
    description: User endpoints
  - name: Claim Actions
    description: Claim actions endpoints
  - name: Rewards Actions
    description: Rewards actions endpoints
  - name: Analytics
    description: Analytics endpoints
paths:
  /analytics/affiliates:
    get:
      tags:
        - Analytics
      summary: Get Affiliate Analytics
      description: >-
        Returns the project affiliates with their totals for a period, oldest
        joiner first. Affiliates with no activity in the period are omitted.
        Note 1: this endpoint is only accessible with a secret API key. Note 2:
        a period may span at most 90 days; request a longer window a period at a
        time. Note 3: up to 100 affiliates are returned per request; page
        through the rest with `offset`.
      operationId: getAffiliateAnalytics
      parameters:
        - name: limit
          required: false
          in: query
          description: How many affiliates to return, from 10 to 100.
          schema:
            minimum: 10
            maximum: 100
            default: 100
            example: 100
            type: number
        - name: offset
          required: false
          in: query
          description: How many affiliates to skip before the page.
          schema:
            minimum: 0
            default: 0
            example: 0
            type: number
        - name: from
          required: true
          in: query
          description: The first day of the period, inclusive, as YYYY-MM-DD (UTC).
          schema:
            format: date
            example: '2026-01-01'
            type: string
        - name: to
          required: true
          in: query
          description: >-
            The last day of the period, inclusive, as YYYY-MM-DD (UTC). Must not
            be before `from`, and the period must be at most 90 days long.
          schema:
            format: date
            example: '2026-03-31'
            type: string
        - name: x-api-key
          in: header
          description: The secret API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The page of affiliates and their totals for the period.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateAnalyticsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
        '422':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
        '429':
          description: The rate limit for this endpoint has been exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
components:
  schemas:
    AffiliateAnalyticsResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AffiliateAnalytics'
      required:
        - data
    ErrorsResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
      description: Errors Response
      required:
        - errors
    AffiliateAnalytics:
      type: object
      properties:
        from:
          type: string
          example: '2026-01-01'
          description: The first day of the period, inclusive
        to:
          type: string
          example: '2026-03-31'
          description: The last day of the period, inclusive
        totals:
          description: The totals across every affiliate in the period, not just this page
          allOf:
            - $ref: '#/components/schemas/AffiliateAnalyticsMetrics'
        affiliates:
          description: >-
            The page of affiliates, oldest joiner first. Affiliates with no
            activity in the period are omitted.
          type: array
          items:
            $ref: '#/components/schemas/AffiliateAnalyticsEntry'
        pagination:
          description: Where this page sits within the affiliates that matched
          allOf:
            - $ref: '#/components/schemas/Pagination'
      required:
        - from
        - to
        - totals
        - affiliates
        - pagination
    ErrorObject:
      type: object
      properties:
        code:
          type: string
        status:
          type: integer
        message:
          type: string
        source:
          type: string
          nullable: true
      description: Error Object
      required:
        - code
        - status
        - message
        - source
    AffiliateAnalyticsMetrics:
      type: object
      properties:
        claims:
          type: number
          example: 120
          description: The number of times the affiliate's codes were claimed
        conversions:
          type: number
          example: 34
          description: The number of claims that converted into a purchase
        revenue:
          type: number
          example: 249900
          description: The revenue attributed to the affiliate, in USD cents
        earnings:
          type: number
          example: 49980
          description: The commission owed to the affiliate on that revenue, in USD cents
      required:
        - claims
        - conversions
        - revenue
        - earnings
    AffiliateAnalyticsEntry:
      type: object
      properties:
        id:
          type: string
          example: 2772aded-9009-474c-a368-c887dda45b01
          description: The affiliate id
        name:
          type: string
          example: Jane Doe
          description: The affiliate name
        accepted_at:
          format: date-time
          type: string
          example: '2026-01-01T00:00:00.000Z'
          description: When the affiliate joined the project
        status:
          type: string
          enum:
            - pending
            - withdrawn
            - approved
            - rejected
            - archived
            - deactivated
            - banned
          example: approved
          description: >-
            The affiliate current standing with the project. Not always
            `approved`: an affiliate is reported for what they did in the
            period, so one since banned or deactivated still appears alongside
            the metrics they earned.
        totals:
          description: The affiliate's totals over the period
          allOf:
            - $ref: '#/components/schemas/AffiliateAnalyticsMetrics'
      required:
        - id
        - name
        - accepted_at
        - status
        - totals
    Pagination:
      type: object
      properties:
        limit:
          type: number
          example: 100
          description: How many results were requested
        offset:
          type: number
          example: 0
          description: How many results were skipped before this page
        total:
          type: number
          example: 512
          description: How many results matched in total, across every page
        has_more:
          type: boolean
          example: true
          description: Whether another page follows this one
      required:
        - limit
        - offset
        - total
        - has_more

````