> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.track.graviton.ma/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a read-only report

> Generates a read-only report with at most 10,000 rows. Events and RFID reports require from and to, with an interval of at most 93 days. Requires the reports permission for subaccounts.



## OpenAPI

````yaml /openapi.json post /reports/generate
openapi: 3.0.3
info:
  title: Graviton Geo V1 Client API
  version: 2.0.0
  description: >-
    Client API for Graviton Geo V1. Use an API token to access your fleet,
    tracking, resources, commands, and reports. The REST API base path is
    /api/v2.
servers:
  - url: https://fleet.graviton.ma/api/v2
    description: Production
security:
  - ApiKey: []
tags:
  - name: System
  - name: Account
  - name: Fleet
  - name: Tracking
  - name: Commands
  - name: Places
  - name: People and groups
  - name: Events
  - name: Maintenance
  - name: Sensors
  - name: Reports
  - name: Templates
paths:
  /reports/generate:
    post:
      tags:
        - Reports
      summary: Generate a read-only report
      description: >-
        Generates a read-only report with at most 10,000 rows. Events and RFID
        reports require from and to, with an interval of at most 93 days.
        Requires the reports permission for subaccounts.
      operationId: post_reports_generate
      parameters:
        - name: format
          in: query
          description: Use csv to download a CSV instead of JSON.
          schema:
            type: string
            enum:
              - csv
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - latest_positions
                    - events
                    - services
                    - rfid
                  default: latest_positions
                from:
                  type: string
                  format: date-time
                  description: Required for events and rfid reports.
                to:
                  type: string
                  format: date-time
                  description: Required for events and rfid reports.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      type:
                        type: string
                      generated_at:
                        type: string
                        format: date-time
                      rows:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      count:
                        type: integer
                    additionalProperties: true
                  meta:
                    $ref: '#/components/schemas/Meta'
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Meta:
      type: object
      properties:
        request_id:
          type: string
        page:
          type: integer
        per_page:
          type: integer
        total:
          type: integer
        pages:
          type: integer
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    Error:
      description: API error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your Graviton API token. Send Authorization: Bearer YOUR_API_TOKEN or
        Authorization: YOUR_API_TOKEN. Each token has individual permissions; a
        valid token without the permission required by the method and route
        returns 403 TOKEN_PERMISSION_DENIED.

````

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