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

# Export incident debug records

> Export the rows produced by debugging the given incident. The columns are determined by the debug query at runtime, so there is no fixed schema.

Requires the `INCIDENTS_WRITE` and `SQL_EXECUTION_WRITE` permissions, because the endpoint runs the debug query against your data system at request time.

This endpoint does not accept `filter` or `sort`.



## OpenAPI

````yaml /schemas/csv-export.json get /incident-debug-records
openapi: 3.1.0
info:
  title: Validio CSV Export API
  version: 1.0.0
  description: >-
    Export Validio data as CSV over REST. Every endpoint is a `GET` that returns
    `text/csv`. Responses are capped at 100,000 rows. See the [CSV Export API
    overview](/developer/validio-api/csv-export-api).
servers:
  - url: https://{instance}/api/export/v1
    description: Your Validio installation
    variables:
      instance:
        default: your-validio-instance
        description: The host you sign in to Validio with.
security:
  - apiKey: []
paths:
  /incident-debug-records:
    get:
      summary: Export incident debug records
      description: >-
        Export the rows produced by debugging the given incident. The columns
        are determined by the debug query at runtime, so there is no fixed
        schema.


        Requires the `INCIDENTS_WRITE` and `SQL_EXECUTION_WRITE` permissions,
        because the endpoint runs the debug query against your data system at
        request time.


        This endpoint does not accept `filter` or `sort`.
      operationId: exportIncidentDebugRecords
      parameters:
        - name: incidentId
          in: query
          required: true
          description: The ID of the incident to debug.
          schema:
            type: string
        - name: query
          in: query
          required: false
          description: >-
            A debug query to run instead of the incident's default one. It can
            be a templated query from
            [`validatorMetricDebugInfo`](/api-reference/graphql/queries/validatorMetricDebugInfo),
            which is expanded automatically; see [Debug query
            syntax](/docs/incidents-and-errors/incidents/debug-query-syntax).
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/CsvExport'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  responses:
    CsvExport:
      description: >-
        A CSV export with a header row, capped at 100,000 rows. The
        `Content-Disposition` header carries a generated filename built from the
        resource, an optional entity name, and the time range (or today's date
        if the request has no time bounds).
      headers:
        Content-Disposition:
          description: >-
            Attachment header carrying the generated filename, for example
            `incident-groups-2026-03-01_2026-04-01.csv`.
          schema:
            type: string
      content:
        text/csv:
          schema:
            type: string
    BadRequest:
      description: >-
        A required parameter is missing, or a JSON parameter (`filter`, `sort`,
        `ids`, or `termIds`) is not valid. The body is a JSON object with an
        `error` message.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    Unauthorized:
      description: The `Authorization` header is missing, or the key pair is not valid.
    Forbidden:
      description: >-
        The API key is valid but lacks the permissions this endpoint requires.
        The body is `{"error": "Insufficient permissions"}`.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your API key's access key and access secret, colon-delimited:
        `<access-key>:<access-secret>`. The same header as the GraphQL API; see
        [Authentication](/developer/getting-started/authentication).

````