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

# Create or Update Redaction

> Creates or updates a single redaction box for a file. If the rect includes an existing ID, the rect is updated. If no ID is provided, a new manual rect is created and assigned a generated ID. The response returns the full updated list of redaction boxes for the file.



## OpenAPI

````yaml PATCH /text-detections/file/{fileId}/rect
openapi: 3.0.1
info:
  title: Indora Labs API
  description: >-
    Comprehensive API for search, ingestion, file ops, redaction, detections,
    audit trail, and case management. All endpoints return strongly-typed JSON
    with explicit field descriptions and examples.
  version: 1.0.0
  license:
    name: Proprietary
servers:
  - url: https://api.indoralabs.com
security:
  - apiKeyAuth: []
tags:
  - name: Search
  - name: Uploads
  - name: Files
  - name: Redactions
  - name: Detections
  - name: Cases
  - name: Audit
  - name: Auth
  - name: Embeddings
  - name: Policy
paths:
  /text-detections/file/{fileId}/rect:
    patch:
      tags:
        - Redactions
      summary: Create or update a single redaction box
      description: >-
        Creates or updates a single redaction box for a file. If the rect
        includes an existing ID, the rect is updated. If no ID is provided, a
        new manual rect is created and assigned a generated ID. The response
        returns the full updated list of redaction boxes for the file.
      parameters:
        - name: fileId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: UUID of the file whose redaction details will be modified.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rect
              properties:
                rect:
                  type: object
                  required:
                    - page
                    - x
                    - 'y'
                    - w
                    - h
                    - label
                  properties:
                    id:
                      type: string
                      description: >-
                        Existing rect ID. If omitted, a new rect will be
                        created.
                    page:
                      type: number
                      description: 1-based page number.
                    x:
                      type: number
                      description: X coordinate in document coordinate space.
                    'y':
                      type: number
                      description: Y coordinate in document coordinate space.
                    w:
                      type: number
                      description: Width of the rect.
                    h:
                      type: number
                      description: Height of the rect.
                    label:
                      type: string
                      description: Semantic label for the redaction (e.g. 'SSN', 'Name').
                    type:
                      type: string
                      description: Optional type classification.
                    reason:
                      type: string
                      description: Optional explanation or justification for the redaction.
                    spanIds:
                      type: array
                      items:
                        type: string
                      description: Optional associated text span IDs.
                    source:
                      type: string
                      enum:
                        - auto
                        - manual
                      description: Origin of the rect.
      responses:
        '200':
          description: Redaction details updated successfully.
          content:
            application/json:
              schema:
                type: array
                description: Full updated list of redaction boxes for the file.
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    page:
                      type: number
                    x:
                      type: number
                    'y':
                      type: number
                    w:
                      type: number
                    h:
                      type: number
                    label:
                      type: string
                    type:
                      type: string
                    reason:
                      type: string
                    spanIds:
                      type: array
                      items:
                        type: string
                    source:
                      type: string
                      enum:
                        - auto
                        - manual
        '400':
          description: Invalid request payload.
        '404':
          description: No redaction details found for this file.
        '500':
          description: Internal server error while updating redaction details.
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````