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

# Create a new report generation task

> To generate a report, pass a template code and parameters in the request body.

The list of available templates and parameters can be found in the [List report templates](#tag/reports/operation/`v1_reports_templates_list`) operation.

The template code should be a `code` field of the `template`.

The parameters should be a dictionary with keys and values related to the `template`.

To get a report file, check the status of the task using the [List generated reports](#tag/reports/operation/`v1_reports_list`) operation. The file will be available when the status is `Completed`.

To download the file, use the [Download a report](#tag/reports/operation/`v1_reports_download_retrieve`) operation with the report `UUID`.



## OpenAPI

````yaml /api-reference/services_documented/billing_reseller_api.yaml post /billing/org/v1/reports
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Billing Reseller API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-15T06:37:28.230198+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: addendums
    description: Operations on client addendums
    x-displayName: addendums
  - name: calc_rules
    x-displayName: calc_rules
  - name: currencies
    x-displayName: currencies
  - name: erp-invoices
    x-displayName: erp-invoices
  - name: expenses
    description: Operations on expenses
    x-displayName: expenses
  - name: plans
    description: Operations on tariff plans and their contents
    x-displayName: plans
  - name: products
    x-displayName: products
  - name: reports
    description: >-
      Operations involving reports and the associated background tasks that
      handle their processing
    x-displayName: reports
  - name: trials
    x-displayName: trials
paths:
  /billing/org/v1/reports:
    post:
      tags:
        - reports
      summary: Create a new report generation task
      description: >-
        To generate a report, pass a template code and parameters in the request
        body.


        The list of available templates and parameters can be found in the [List
        report templates](#tag/reports/operation/`v1_reports_templates_list`)
        operation.


        The template code should be a `code` field of the `template`.


        The parameters should be a dictionary with keys and values related to
        the `template`.


        To get a report file, check the status of the task using the [List
        generated reports](#tag/reports/operation/`v1_reports_list`) operation.
        The file will be available when the status is `Completed`.


        To download the file, use the [Download a
        report](#tag/reports/operation/`v1_reports_download_retrieve`) operation
        with the report `UUID`.
      operationId: v1_reports_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgReportTaskRequest'
            examples:
              CreateReportTaskExample:
                value:
                  template_code: ResellerExpenses
                  parameters:
                    date_from: '2025-01-01'
                    date_to: '2025-02-01'
                summary: Create Report Task Example
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrgReportTaskRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrgReportTaskRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileTask'
              examples:
                CreateReportTaskExample:
                  value:
                    template_code: ResellerExpenses
                    parameters:
                      date_from: '2025-01-01'
                      date_to: '2025-02-01'
                  summary: Create Report Task Example
          description: Resource created successfully.
        '400':
          description: >-
            Validation error. The response body contains field-specific error
            messages.
        '401':
          description: Authentication credentials were not provided or are invalid.
        '403':
          description: You do not have permission to perform this action.
components:
  schemas:
    OrgReportTaskRequest:
      type: object
      properties:
        parameters:
          type: object
          title: Report parameters
          description: >-
            Parameters for the report. The keys and values should match the
            template's parameter definitions. See the [reports
            templates](#tag/reports/operation/`v1_reports_templates_list`)
            operation for available templates.
          properties:
            date_from:
              type: string
              format: date
              description: (Example) Start date for the report period (YYYY-MM-DD).
            date_to:
              type: string
              format: date
              description: (Example) End date for the report period (YYYY-MM-DD).
            client_id:
              type: integer
              description: (Example) Client ID to filter the report by.
          additionalProperties: true
          example:
            date_from: '2025-01-01'
            date_to: '2025-02-01'
        template_code:
          type: string
          minLength: 1
          writeOnly: true
          description: Code of the report template to use for generating the report.
      required:
        - template_code
    FileTask:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Task creation time
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Task update time
        user_id:
          type: integer
          readOnly: true
        client_id:
          type: integer
          readOnly: true
        task_type:
          enum:
            - ClosingPeriod
            - ImportData
            - Report
            - StopSubscriptions
          type: string
          description: |-
            - `ClosingPeriod` - `closing_period`
            - `ImportData` - `import_data`
            - `Report` - report
            - `StopSubscriptions` - `stop_subscriptions`
          x-spec-enum-id: 0679576dcc7bdce1
          readOnly: true
        status:
          enum:
            - Pending
            - InProgress
            - Completed
            - Failed
            - Cancelled
          type: string
          description: |-
            - `Pending` - pending
            - `InProgress` - `in_progress`
            - `Completed` - completed
            - `Failed` - failed
            - `Cancelled` - cancelled
          x-spec-enum-id: b456721956b0b8e0
          readOnly: true
          default: Pending
        parameters:
          type: object
          title: Task parameters
          description: >-
            Parameters for the task. The structure depends on the task type. For
            report tasks, see available templates and their parameters at the
            [reports
            templates](#tag/reports/operation/`v1_reports_templates_list`)
            operation.
          properties:
            type:
              type: string
              description: >-
                Report type code (e.g., 'ResellerExpenses', 'ResellerPlans',
                'ResellerCredits', 'ResellerStatistics').
            date_from:
              type: string
              format: date
              description: Start date for the report period (YYYY-MM-DD).
              nullable: true
            date_to:
              type: string
              format: date
              description: End date for the report period (YYYY-MM-DD).
              nullable: true
            client_id:
              type: integer
              description: Client ID to filter the report by.
              nullable: true
          additionalProperties: true
        processing_notes:
          type: object
          title: Processing notes
          description: >-
            Processing notes. Contains additional information about the task
            processing.
          properties:
            celery_group_id:
              type: string
              description: Celery task group ID for tracking async processing.
              nullable: true
            period:
              type: string
              description: Period information for the task.
              nullable: true
            records_to_process:
              type: integer
              description: Number of records to process.
              nullable: true
            errors:
              type: array
              items:
                type: object
              description: List of errors encountered during processing.
              nullable: true
            warnings:
              type: array
              items:
                type: object
              description: List of warnings encountered during processing.
              nullable: true
          additionalProperties: true
          readOnly: true
      required:
        - client_id
        - created_at
        - processing_notes
        - status
        - task_type
        - updated_at
        - user_id
        - uuid
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````