> ## 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.

# Download reports



## OpenAPI

````yaml openapi-v2-affiliate-reports get /reports/download
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: FirstPromoter Affiliate API documentation
servers:
  - url: https://api.firstpromoter.com/api/v2/affiliate
security:
  - BearerAuth: []
paths:
  /reports/download:
    get:
      tags:
        - Reports
      summary: Download reports
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: report_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - overview
              - traffic_sources
              - urls
              - sub_ids
        - name: totals
          in: query
          required: false
          schema:
            type: boolean
        - name: columns
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
        - name: group_by
          in: query
          required: true
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - year
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Successful response
          content:
            text/csv:
              schema:
                type: string
        '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
        '422':
          description: Unprocessable Entity
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
        example: acc_123456
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header

````