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

# Export Audit

> POST /settings/audit/export — request async audit log export.

Persists a durable ``export_jobs`` row so the returned job_id is real and
pollable across restarts. The ``export_jobs.resource`` CHECK constraint does
not allow a bare 'audit', so audit exports are recorded as 'audit_log'.



## OpenAPI

````yaml /openapi.json post /v1/audit/export
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/audit/export:
    post:
      tags:
        - settings
      summary: Export Audit
      description: >-
        POST /settings/audit/export — request async audit log export.


        Persists a durable ``export_jobs`` row so the returned job_id is real
        and

        pollable across restarts. The ``export_jobs.resource`` CHECK constraint
        does

        not allow a bare 'audit', so audit exports are recorded as 'audit_log'.
      operationId: export_audit_v1_audit_export_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuditExportRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    AuditExportRequest:
      properties:
        days:
          anyOf:
            - maximum: 365
              minimum: 1
              type: integer
            - type: 'null'
          title: Days
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
        format:
          default: csv
          enum:
            - csv
            - json
          title: Format
          type: string
      title: AuditExportRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````