> ## Documentation Index
> Fetch the complete documentation index at: https://io-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace metadata of a document

> Replaces metadata in a document. This endpoint allows overwriting existing metadata fields.



## OpenAPI

````yaml openapi/replace-document-metadata.json put /api/r2r/v3/documents/{id}/metadata
openapi: 3.1.0
info:
  title: IO Intelligence
  version: '1.0'
servers:
  - url: https://api.intelligence.io.solutions
security:
  - sec0: []
paths:
  /api/r2r/v3/documents/{id}/metadata:
    put:
      summary: Replace metadata of a document
      description: >-
        Replaces metadata in a document. This endpoint allows overwriting
        existing metadata fields.
      operationId: replace-document-metadata
      parameters:
        - name: id
          in: path
          description: Document ID
          schema:
            type: integer
            format: int32
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    results:
                      id: 123e4567-e89b-12d3-a456-426614174000
                      collection_ids:
                        - 123e4567-e89b-12d3-a456-426614174000
                      owner_id: 123e4567-e89b-12d3-a456-426614174000
                      document_type: pdf
                      metadata:
                        title: Sample Document
                      version: '1.0'
                      title: Sample Document
                      size_in_bytes: 123456
                      ingestion_status: pending
                      extraction_status: pending
                      created_at: '2021-01-01T00:00:00Z'
                      updated_at: '2021-01-01T00:00:00Z'
                      ingestion_attempt_number: 0
                      summary: A summary of the document
                      summary_embedding:
                        - 0.1
                        - 0.2
                        - 0.3
                      total_tokens: 1000
                      chunks:
                        - key: value
              schema:
                type: object
                properties:
                  results:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 123e4567-e89b-12d3-a456-426614174000
                      collection_ids:
                        type: array
                        items:
                          type: string
                          example: 123e4567-e89b-12d3-a456-426614174000
                      owner_id:
                        type: string
                        example: 123e4567-e89b-12d3-a456-426614174000
                      document_type:
                        type: string
                        example: pdf
                      metadata:
                        type: object
                        properties:
                          title:
                            type: string
                            example: Sample Document
                      version:
                        type: string
                        example: '1.0'
                      title:
                        type: string
                        example: Sample Document
                      size_in_bytes:
                        type: integer
                        example: 123456
                        default: 0
                      ingestion_status:
                        type: string
                        example: pending
                      extraction_status:
                        type: string
                        example: pending
                      created_at:
                        type: string
                        example: '2021-01-01T00:00:00Z'
                      updated_at:
                        type: string
                        example: '2021-01-01T00:00:00Z'
                      ingestion_attempt_number:
                        type: integer
                        example: 0
                        default: 0
                      summary:
                        type: string
                        example: A summary of the document
                      summary_embedding:
                        type: array
                        items:
                          type: number
                          example: 0.1
                          default: 0
                      total_tokens:
                        type: integer
                        example: 1000
                        default: 0
                      chunks:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              example: value
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
        '422':
          description: '422'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: oauth2
      flows: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.