> ## 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 data used for chart

> With this endpoint you can get the data used for charts.<Tip>**HTTP Request** <br/>`GET https://api.firstpromoter.com/api/v2/company/promoters/{id}/chart_data`</Tip>



## OpenAPI

````yaml openapi-v2-promoters get /promoters/{id}/chart_data
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: API documentation for FirstPromoter promoters management
servers:
  - url: https://api.firstpromoter.com/api/v2/company
security:
  - BearerAuth: []
paths:
  /promoters/{id}/chart_data:
    get:
      tags:
        - Promoters
      summary: Get data used for chart
      description: >-
        With this endpoint you can get the data used for charts.<Tip>**HTTP
        Request** <br/>`GET
        https://api.firstpromoter.com/api/v2/company/promoters/{id}/chart_data`</Tip>
      operationId: getPromoterChartData
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: id
          in: path
          description: Id of the promoter
          required: true
          schema:
            type: integer
        - name: period_from
          description: From date of the period for the chart, ISO date format (YYYY-MM-DD)
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: period_to
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: selection
          in: query
          required: true
          schema:
            type: string
            enum:
              - revenue
              - clicks
              - referrals
              - customers
              - cancellations
      responses:
        '200':
          description: Chart data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromoterChartData'
        '401':
          description: >-
            Unauthorized — the Bearer access token is missing, invalid, expired,
            or revoked. No JSON response body is returned.
          content:
            application/json:
              schema:
                type: object
              example: {}
        '403':
          description: >-
            Forbidden — the authenticated user does not have permission to
            perform this action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: You don't have enough rights to perform this action
                code: forbidden
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Record not found
                code: not_found
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: >-
        Account id. You can find your Account ID on Your FirstPromoter
        Dashboard. Navigate to Settings → Integrations
      schema:
        type: string
  schemas:
    PromoterChartData:
      type: object
      properties:
        period_from:
          type: string
          format: date
          description: Start date of the chart data period
        period_to:
          type: string
          format: date
          description: End date of the chart data period
        selection:
          type: string
          description: Type of data being displayed
          enum:
            - revenue
            - clicks
            - referrals
            - customers
            - cancellations
        selection_items:
          type: array
          description: Data points for the chart
          items:
            type: array
            description: A date-value pair
            items:
              oneOf:
                - type: string
                  description: Date label for the data point (format depends on group_by)
                - type: number
                  description: Value for the data point
            minItems: 2
            maxItems: 2
        group_by:
          type: string
          description: Time unit used for grouping the data
          enum:
            - day
            - week
            - month
            - year
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key passed as a Bearer token in the Authorization header. You can
        find your API Key on Your FirstPromoter Dashboard. Navigate to Settings
        → Integrations section → Manage API Keys

````