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

# Create file audit report

> Enqueues a compliance audit report for the given file. The report is generated asynchronously; the response returns the report ID and its initial pending status.



## OpenAPI

````yaml post /platform/files/{fileId}/audit-report
openapi: 3.0.3
info:
  title: ROOTKey Documentation
  description: >-
    Your API of choice for creating, managing, and validating information easily
    and securely!
  termsOfService: https://www.rootkey.ai/legal/privacy-policy
  contact:
    name: ROOTKey
    url: https://www.rootkey.ai/contact
    email: support@rootkey.ai
  version: 1.0.0
servers:
  - description: Production
    url: https://api.rootkey.ai/api-v1/
security:
  - x-api-key: []
tags:
  - name: api-v1-public
    description: Unauthenticated top-level /api-v1 endpoints (health, plans, annual report)
  - name: api-v1-files
    description: >-
      File anchoring, versioning, validation and compliance reporting
      (/api-v1/platform/files)
  - name: api-v1-records
    description: Structured-data record anchoring (/api-v1/platform/records)
  - name: api-v1-vaults
    description: 'Vault lifecycle: create / update / delete (/api-v1/platform/vaults)'
  - name: api-v1-recovery-points
    description: >-
      Backup archives created from vault contents
      (/api-v1/platform/recovery-point)
paths:
  /platform/files/{fileId}/audit-report:
    post:
      tags:
        - api-v1-files
      summary: Create file audit report
      description: >-
        Enqueues a compliance audit report for the given file. The report is
        generated asynchronously; the response returns the report ID and its
        initial pending status.
      parameters:
        - name: fileId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                framework:
                  type: string
                  enum:
                    - NIS2
                    - DORA
                  default: NIS2
                periodStart:
                  type: string
                  format: date-time
                  description: Reporting period start (defaults to file createdAt)
                periodEnd:
                  type: string
                  format: date-time
                  description: Reporting period end (defaults to now)
      responses:
        '202':
          description: Report generation job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateComplianceReportResponse'
        '401':
          description: Unauthenticated
        '403':
          description: >-
            Subscription limit exceeded, feature not found, or user is not an
            organization member
        '404':
          description: File not found
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - x-api-key: []
components:
  schemas:
    GenerateComplianceReportResponse:
      type: object
      properties:
        reportId:
          type: string
          description: ID of the created compliance report
          example: cmpr_abc123
        status:
          type: string
          enum:
            - PENDING
          description: Initial status; the report is processed asynchronously
      required:
        - reportId
        - status
    DomainErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            requestId:
              type: string
            message:
              type: string
            errorCode:
              type: string
            docUrl:
              type: string
            timestamp:
              type: string
              format: date-time
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainErrorResponse'
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        ROOTKey API key (rk_live_... for production, rk_test_... for the test
        network).

````