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

# Run history / audit (most recent first)



## OpenAPI

````yaml /api-reference/specs/report.json get /runs
openapi: 3.0.1
info:
  title: Report Service
  description: Customisable reporting API for FlowPayroll.
  contact:
    name: FlowPayroll
    email: hello@flowpayroll.com
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/report
security:
  - X-Auth-Token: []
    X-Org-Id: []
tags:
  - name: Datasets
    description: >-
      Discover what you can query: list the available datasets and inspect each
      field catalog — types, filterability, groupability, and supported
      aggregations.
  - name: Run reports
    description: >-
      Run a report synchronously — either an inline report definition or a saved
      one — and get columns and rows back in the response.
  - name: Report definitions
    description: >-
      Save a report definition under a name so it can be re-run, exported, and
      scheduled. Create, list, retrieve, replace, and delete definitions.
  - name: Exports
    description: >-
      Queue large result sets as asynchronous exports (CSV or JSONL, up to
      5,000,000 rows) and poll for a presigned download URL.
  - name: Schedules
    description: >-
      Run a saved definition on a cron schedule and deliver the export by
      webhook or email.
  - name: Run history
    description: Audit trail of every report run — synchronous, export, and scheduled.
paths:
  /runs:
    get:
      tags:
        - Run history
      summary: Run history / audit (most recent first)
      operationId: listRuns
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
            default: 50
      responses:
        '200':
          description: Recent runs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunListResponse'
        '401':
          $ref: '#/components/responses/Unauthorised'
components:
  schemas:
    RunListResponse:
      type: object
      required:
        - runs
      properties:
        runs:
          type: array
          items:
            $ref: '#/components/schemas/RunSummary'
    RunSummary:
      type: object
      required:
        - runId
        - mode
        - status
        - requestedAt
      properties:
        runId:
          type: string
        definitionId:
          type: string
          nullable: true
        mode:
          type: string
          description: SYNC | EXPORT | SCHEDULED
        format:
          type: string
          nullable: true
        status:
          type: string
        rowCount:
          type: integer
          format: int64
          nullable: true
        requestedBy:
          type: string
          nullable: true
        requestedAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
          nullable: true
        error:
          type: string
          nullable: true
    ServiceError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    Unauthorised:
      description: No organisation context on the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServiceError'
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: FlowPayroll JWT (raw token, no Bearer prefix)
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        Organisation to scope the request to. Required when the principal can
        access more than one organisation; optional for single-organisation
        principals (the authorizer resolves it automatically).
      name: X-Org-Id
      in: header

````