> ## 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.

# Reassign File

> Move a settled file from one case to another.

Moves a settled file from its current case to another case owned by the same user within the same organisation. The file's analysis results, risk score, and findings travel with it; nothing is re-analysed.

## Best Practices

1. **Wait for analysis to settle**: A file can only be reassigned once its analysis has completed. Reassigning a file mid-analysis returns `409 Conflict`.
2. **Pick a different destination**: Reassigning a file to the case it already belongs to returns `409 Conflict`.
3. **Same owner required**: The destination case must exist and be owned by the same user; otherwise the API returns `404 Not Found`.


## OpenAPI

````yaml PATCH /cases/{caseId}/files/{fileId}/reassign
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:
  /cases/{caseId}/files/{fileId}/reassign:
    patch:
      tags:
        - Case Files
      summary: Reassign a file to a different case
      description: >-
        Moves a settled file from its current case to another case owned by the
        same user within the same organisation. Analysis results, risk score,
        and findings travel with the file.
      operationId: CaseFilesController_reassignFile
      parameters:
        - name: caseId
          required: true
          in: path
          description: Source case ID
          schema:
            type: string
        - name: fileId
          required: true
          in: path
          description: File ID to reassign
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReassignFileDto'
      responses:
        '200':
          description: File reassigned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseFileResponseDto'
        '400':
          description: Invalid fileId or destination_case_id (must be valid UUIDs)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
        '401':
          description: Unauthorized (invalid or missing authentication token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
        '404':
          description: >-
            File or destination case not found, or destination case not owned by
            user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
        '409':
          description: >-
            File analysis not yet settled, or destination is the same as source
            case
          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:
    ReassignFileDto:
      type: object
      properties:
        destination_case_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          x-nestjs_zod-parent-additional-properties: false
      required:
        - destination_case_id
    CaseFileResponseDto:
      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})$
          x-nestjs_zod-uses-3-point-1-syntax: true
        case_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})$
          x-nestjs_zod-uses-3-point-1-syntax: true
        case_label:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        label:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        current_risk_score:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        analysis_status:
          type: string
          enum:
            - waiting_for_upload
            - processing
            - settled
          x-nestjs_zod-uses-3-point-1-syntax: true
        analysis_outcome:
          anyOf:
            - type: string
              enum:
                - success
                - failed
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        current_analysis_phase:
          anyOf:
            - type: string
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        uploaded_at:
          anyOf:
            - 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))$
            - type: 'null'
          x-nestjs_zod-uses-3-point-1-syntax: true
          x-nestjs_zod-empty-type: true
        created_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))$
          x-nestjs_zod-uses-3-point-1-syntax: true
        team_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          x-nestjs_zod-uses-3-point-1-syntax: true
        team_name:
          type: string
          x-nestjs_zod-uses-3-point-1-syntax: true
      required:
        - file_id
        - case_id
        - case_label
        - label
        - mime_type
        - thumbnail_url
        - current_risk_score
        - analysis_status
        - analysis_outcome
        - current_analysis_phase
        - uploaded_at
        - created_at
    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

````