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

# Generate Bulk File Download URLs

> Generate signed download URLs for multiple files in a single request.

Generate signed download URLs for multiple files in a single request. Returns partial success — URLs for accessible files plus errors for any failures. Files must be owned by the authenticated user.

## Key Features

* **Partial Success**: If some file IDs are inaccessible or invalid, the response still returns URLs for the files that succeeded, alongside per-file errors for those that failed.
* **Batch Efficiency**: Download URLs for up to 25 files in a single call instead of making individual requests.
* **Short-lived URLs**: Signed URLs expire after 60 minutes. Do not store them — request fresh URLs when needed.

## Best Practices

1. **Request Fresh URLs**: Always request new download URLs immediately before use. URLs expire after 60 minutes.
2. **Check Partial Errors**: Inspect the errors array in the response to detect any files that could not be resolved.
3. **Stay Within Limits**: A maximum of 25 file IDs are permitted per request. Split larger batches into multiple requests.
4. **Mind the Rate Limit**: This endpoint is rate-limited to 20 requests per minute. Pace your requests accordingly for bulk workflows.


## OpenAPI

````yaml POST /files/download
openapi: 3.1.0
info:
  title: Veridox Core API
  description: Veridox Core Platform API
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.uk.veridox.ai
    description: Live (UK)
  - url: https://api.ca.veridox.ai
    description: Live (CA)
security: []
tags:
  - name: Status
    description: System status and health check endpoints
  - name: Cases
    description: Case and case file management
  - name: Organisations
    description: Organisation management
  - name: Document Requests
    description: Document request management
  - name: Search
    description: Search functionality
  - name: Admin
    description: Administrative endpoints
paths:
  /files/download:
    post:
      tags:
        - Case Files
      summary: Generate bulk file download URLs
      description: >-
        Generates signed Azure SAS download URLs for multiple files in a single
        request. Returns partial success - URLs for accessible files plus errors
        for any failures. Files must be owned by the authenticated user. Maximum
        25 files per request. SAS URLs expire after 60 minutes (configured
        default). Rate limit: 20 requests/min (production) to prevent data
        exfiltration.
      operationId: CaseFilesController_generateBulkDownloadUrls
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDownloadFilesDto'
      responses:
        '200':
          description: Download URLs generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDownloadResponseDto'
        '400':
          description: Invalid file IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
        '401':
          description: Unauthorized (invalid or missing authentication token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
        '429':
          description: Too many requests (rate limit exceeded)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
      security:
        - api-key: []
components:
  schemas:
    BulkDownloadFilesDto:
      type: object
      properties:
        file_ids:
          minItems: 1
          maxItems: 25
          type: array
          items:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          x-nestjs_zod-parent-additional-properties: false
      required:
        - file_ids
    BulkDownloadResponseDto:
      type: object
      properties:
        files:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
              label:
                type: string
              download_url:
                type: string
                format: uri
              expires_at:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            required:
              - file_id
              - download_url
              - expires_at
            additionalProperties: false
          x-nestjs_zod-parent-additional-properties: false
        errors:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
              error:
                type: string
            required:
              - file_id
              - error
            additionalProperties: false
          x-nestjs_zod-parent-additional-properties: false
      required:
        - files
    ErrorDto:
      type: object
      properties:
        error_code:
          type: string
          description: Machine-readable error code for programmatic handling
          examples:
            - request.cases.file.missing-risk-score
            - request.authentication.invalid-token
            - request.forbidden
            - request.cases.case.not-found
            - request.cases.case.already-locked
        error_message:
          type: string
          description: Human-readable error message explaining what went wrong
          example: >-
            User tried to perform an invalid operation on a file without a risk
            score.
        error_details:
          type: object
          example:
            field: email_address
      required:
        - error_code
        - error_message
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key

````