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

# Generate an older report

> Makes an older report. By default the file itself is the answer (200, not the JSON envelope), with headers X-HT-Report-ID, X-HT-Report-Link, X-HT-Report-Type and X-HT-Report-Format, and a copy is stored (GET /reports/uploads). With async true a report job is queued instead and the answer is 202 with the job (follow it with GET /reports/jobs/{id}). Errors use the JSON envelope; a failure while making the file is 500 report_generation_failed. This is the older reporting API; for new work use the newer routes (GET /reports/catalog, POST /reports/preview, POST /reports/run, /reports/saved). Admins, operators and the company key may call it; workers get 403 permission_denied.



## OpenAPI

````yaml v1/openapi.json POST /reports/generate
openapi: 3.1.0
info:
  title: Hellotracks REST API
  version: '1'
  description: >-
    Plain REST resources over HTTPS, for tools, automations and services. The ht
    command line is built on it.
  contact:
    email: api@hellotracks.com
servers:
  - url: https://api.hellotracks.com/v1
security:
  - ApiKey: []
tags:
  - name: Sign-up and sign-in
    description: >-
      Create a company or get an API key by an emailed code, without a key; and
      check which account a key belongs to.
  - name: Company
    description: The company the API key belongs to, with its settings and teams.
  - name: Members
    description: 'The people in the company: admins, operators and workers.'
  - name: API keys
    description: 'The company''s API keys: list, create, revoke and delete.'
  - name: Jobs
    description: 'Jobs: work at a location on a date, assigned to a member.'
  - name: Places
    description: 'Places: customer sites and other saved locations with a check-in radius.'
  - name: Zones
    description: 'Zones: the company''s geofences.'
  - name: Routing
    description: Route optimization for one member's day.
  - name: ETA pages
    description: >-
      Live ETA pages (eta.page links) that show a job's recipient when the
      worker arrives.
  - name: Maps
    description: Rendered maps as GeoJSON, and public map share links.
  - name: Timesheets
    description: Clock-in and clock-out entries of members, with totals, and editing them.
  - name: Forms
    description: >-
      Form templates, submitted forms, attachments for file and image fields,
      and forms linked to places and jobs.
  - name: Alerts
    description: >-
      Alert rules (configs) that watch members, places and zones, and the alerts
      (instances) they raised.
  - name: Reports
    description: >-
      Reports: the newer reporting API (catalog, preview, run, saved) and the
      older one (types, generate, jobs, uploads, recurring).
  - name: Webhooks
    description: URLs Hellotracks calls when jobs, check-ins, clock-ins or alerts happen.
paths:
  /reports/generate:
    post:
      tags:
        - Reports
      summary: Generate an older report
      description: >-
        Makes an older report. By default the file itself is the answer (200,
        not the JSON envelope), with headers X-HT-Report-ID, X-HT-Report-Link,
        X-HT-Report-Type and X-HT-Report-Format, and a copy is stored (GET
        /reports/uploads). With async true a report job is queued instead and
        the answer is 202 with the job (follow it with GET /reports/jobs/{id}).
        Errors use the JSON envelope; a failure while making the file is 500
        report_generation_failed. This is the older reporting API; for new work
        use the newer routes (GET /reports/catalog, POST /reports/preview, POST
        /reports/run, /reports/saved). Admins, operators and the company key may
        call it; workers get 403 permission_denied.
      operationId: generateReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportGenerateRequest'
            example:
              type: jobs
              format: xlsx
              from: '2026-10-01'
              until: '2026-10-31'
              memberIds:
                - a1b2c3
              columns:
                - key: title
                - key: status
                  label: State
              async: true
      responses:
        '200':
          description: The report file (when async is false).
          headers:
            Content-Disposition:
              schema:
                type: string
              description: attachment; filename="..."
            X-HT-Report-ID:
              schema:
                type: string
              description: Id of the stored copy.
            X-HT-Report-Link:
              schema:
                type: string
              description: Link to the stored copy.
            X-HT-Report-Type:
              schema:
                type: string
            X-HT-Report-Format:
              schema:
                type: string
          content:
            text/csv:
              schema:
                type: string
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                contentMediaType: >-
                  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/json:
              schema:
                type: object
                description: GeoJSON, for format geojson.
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        '202':
          description: 'Accepted: a report job was queued (async true).'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                properties:
                  data:
                    type: object
                    properties:
                      job:
                        $ref: '#/components/schemas/ReportJob'
              example:
                data:
                  job:
                    id: 6560000000000000000000d1
                    status: queued
                    type: jobs
                    format: xlsx
                    source: api
                    createdAt: 1762070000000
                    updatedAt: 1762070000000
                    startedAt: 0
                    completedAt: 0
                    failedAt: 0
                    attempts: 0
                    maxAttempts: 3
                    from: '2026-10-01'
                    until: '2026-10-31'
                    error: null
                    result: null
                error: null
                meta:
                  path: /v1/reports/generate
                  method: POST
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ReportGenerateRequest:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - jobs
            - dayroute
            - places
            - alerts
            - checkins
            - timesheet
            - members
            - mileage
            - placeonsite
            - memberonsite
            - stopsreport
            - gpx
            - activities
            - timeline
            - worksheet
            - timeallocation
            - statistics
            - formsubmissions
        format:
          type: string
          description: >-
            One of the type's availableFormats; defaults to csv when offered,
            else the first.
        date:
          type: string
          format: date
          description: One day, YYYY-MM-DD. Use either date or from+until.
        from:
          type: string
          format: date
          description: First day, YYYY-MM-DD; needs until.
        until:
          type: string
          format: date
          description: Last day, YYYY-MM-DD, inclusive; at most maxDays after from.
        memberIds:
          type: array
          items:
            type: string
          description: >-
            Members, for types with canSelectMembers. At least one member or
            place is required for those types.
        placeIds:
          type: array
          items:
            type: string
          description: Places, for types with canSelectPlaces.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/ReportColumnPick'
        options:
          type: object
          additionalProperties:
            type: string
          description: 'Only the type''s option keys (checkins: mode = stops, both, manual).'
        formTemplateId:
          type: string
          description: Required for formsubmissions.
        title:
          type: string
        async:
          type: boolean
          default: false
          description: true = queue a report job and answer 202 instead of the file.
    Envelope:
      type: object
      properties:
        data:
          description: The payload.
        error:
          type: 'null'
        meta:
          $ref: '#/components/schemas/Meta'
    ReportJob:
      type: object
      description: An older asynchronous report job.
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
        type:
          type: string
        format:
          type: string
        source:
          type: string
          example: api
        createdAt:
          type: integer
          format: int64
          description: Milliseconds since the epoch.
        updatedAt:
          type: integer
          format: int64
          description: Milliseconds since the epoch.
        startedAt:
          type: integer
          format: int64
          description: Milliseconds since the epoch.
        completedAt:
          type: integer
          format: int64
          description: Milliseconds since the epoch.
        failedAt:
          type: integer
          format: int64
          description: Milliseconds since the epoch.
        attempts:
          type: integer
        maxAttempts:
          type: integer
          example: 3
        from:
          type: string
          format: date
        until:
          type: string
          format: date
        error:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
            message:
              type: string
        result:
          type:
            - object
            - 'null'
          properties:
            uploadedReportId:
              type: string
            link:
              type: string
              description: Download link.
            bytes:
              type: integer
            name:
              type: string
            contentType:
              type: string
            filename:
              type: string
    ReportColumnPick:
      type: object
      additionalProperties: false
      required:
        - key
      properties:
        key:
          type: string
          description: A column key of the report type.
        label:
          type: string
          description: Column title in the file.
        rename:
          type: string
          description: Alias of label.
    Meta:
      type: object
      properties:
        path:
          type: string
          description: The request path, without /v1.
          example: /jobs
        method:
          type: string
          example: GET
    ErrorEnvelope:
      type: object
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable error code for programs.
          enum:
            - invalid_request
            - invalid_format
            - invalid_data
            - invalid_api_key
            - unknown_user
            - authentication_failed
            - forbidden
            - not_found
            - already_exists
            - throttled
            - not_ready
            - clock_invalid
            - force_logout
            - internal_error
            - unknown_error
        message:
          type: string
          description: Why it failed, for people.
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              code: invalid_request
              message: date must be YYYY-MM-DD
            meta:
              path: /jobs
              method: GET
    Unauthorized:
      description: The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              code: invalid_api_key
              message: Invalid Hellotracks API key.
            meta:
              path: /jobs
              method: GET
    Forbidden:
      description: The key may not do this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              code: forbidden
              message: No permission.
            meta:
              path: /jobs
              method: GET
    TooManyRequests:
      description: Too many requests; slow down.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              code: throttled
              message: Too many requests.
            meta:
              path: /jobs
              method: GET
    ServerError:
      description: Hellotracks failed; retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              code: internal_error
              message: Hellotracks API is temporarily unavailable.
            meta:
              path: /jobs
              method: GET
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: API-Key
      description: >-
        Your API key, from More → API & Integrations in the dashboard, or from
        ht signup / ht auth login.

````

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