{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/peaka/main/json-schema/peaka-export-request-schema.json",
  "title": "ExportRequest",
  "description": "Async export request. The job is accepted (202) and runs in the background; the result is downloaded via presigned URLs returned by the status endpoint.",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/peaka-api-openapi.json#/components/schemas/ExportRequest",
  "type": "object",
  "properties": {
    "format": {
      "type": "string",
      "description": "Output format",
      "default": "CSV",
      "enum": [
        "CSV",
        "JSONL"
      ]
    },
    "limit": {
      "type": "integer",
      "description": "Row limit; clamped to [1, 1000000]",
      "format": "int32"
    },
    "csvOptions": {
      "$ref": "#/$defs/ExportCsvOptions"
    },
    "includeSystemColumns": {
      "type": "boolean",
      "description": "When false, Peaka system columns (_id, _version, …) are excluded. Cache plumbing columns (_q_*, _cache_*) are always dropped.",
      "default": true
    },
    "columns": {
      "type": "array",
      "description": "Explicit column selection; an unknown name yields 400. Omit to export all columns.",
      "items": {
        "type": "string",
        "description": "Explicit column selection; an unknown name yields 400. Omit to export all columns."
      }
    },
    "compression": {
      "type": "string",
      "description": "Output compression; with GZIP every artifact is a gzip stream carrying a .gz suffix",
      "default": "NONE",
      "enum": [
        "NONE",
        "GZIP"
      ]
    }
  },
  "$defs": {
    "ExportCsvOptions": {
      "type": "object",
      "properties": {
        "delimiter": {
          "type": "string",
          "description": "Field delimiter",
          "default": ","
        },
        "quoteChar": {
          "type": "string",
          "description": "Quote character",
          "default": "\""
        },
        "recordSeparator": {
          "type": "string",
          "description": "Record separator",
          "default": "\\n"
        },
        "includeHeader": {
          "type": "boolean",
          "description": "Whether to emit a header row",
          "default": true
        },
        "nullValue": {
          "type": "string",
          "description": "Representation of NULL values"
        }
      },
      "description": "CSV formatting options (ignored for JSONL exports)"
    }
  }
}