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

# Get chart data

> Get time-series chart data for the signed-in promoter over a date range, optionally for one campaign.



## OpenAPI

````yaml openapi-v2-affiliate-promoters get /promoters/chart_data
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: FirstPromoter API documentation
servers:
  - url: https://api.firstpromoter.com/api/v2/affiliate
security:
  - BearerAuth: []
paths:
  /promoters/chart_data:
    get:
      tags:
        - Promoters
      summary: Get chart data
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: promoter_campaign_id
          in: query
          description: >-
            If provided, the given promoter campaign will be used in chart.
            Otherwise all the current_promoter campaigns will be used.
          schema:
            type: integer
        - name: period_from
          in: query
          schema:
            type: string
            format: date
        - name: period_to
          in: query
          schema:
            type: string
            format: date
        - name: selection
          in: query
          schema:
            type: string
            enum:
              - revenue
              - commissions
              - clicks
              - referrals
              - customers
              - cancellations
      responses:
        '401':
          description: >-
            Unauthorized — the API key is missing, wrong, regenerated or
            disabled (no JSON response body is returned), or the `Account-ID`
            header is missing.
          content:
            application/json:
              schema:
                type: object
              example: {}
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: >-
        Account ID of the affiliate program, shown next to your API key under
        Profile → API & AI tools
      schema:
        type: string
        example: acc_123456
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your affiliate API key (Profile → API & AI tools in the affiliate
        dashboard), sent as `Authorization: Bearer {api_key}`

````

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