---
updatedAt: 2026-05-31T13:53:36.000Z
agentTools:
  projectIndex: https://docs.docupipe.ai/llms.txt
---

# Update Document Metadata

Replace the user-supplied metadata dict on one or more existing documents. The provided metadata fully replaces any existing metadata on each document. Pass an empty object to clear it. Metadata must be at most 10KB when JSON-serialized. Updates propagate to associated standardizations and reviews.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "DocuPipe",
    "version": "1.0"
  },
  "paths": {
    "/documents/update-metadata": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Update Document Metadata",
        "description": "Replace the user-supplied metadata dict on one or more existing documents. The provided metadata fully replaces any existing metadata on each document. Pass an empty object to clear it. Metadata must be at most 10KB when JSON-serialized. Updates propagate to associated standardizations and reviews.",
        "operationId": "update_documents_metadata",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMetadataRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateMetadataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "Details about the error"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "ErrorResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "UpdateMetadataRequest": {
        "properties": {
          "documentIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Document IDs",
            "description": "List of document IDs whose metadata should be updated."
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Replacement metadata dict for the given documents. This fully replaces any existing metadata on each document. Pass an empty object ({}) to clear metadata. Max 10KB when JSON-serialized."
          }
        },
        "type": "object",
        "required": [
          "documentIds",
          "metadata"
        ],
        "title": "UpdateMetadataRequest"
      },
      "UpdateMetadataResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "description": "Whether the metadata update was successful.",
            "default": true
          }
        },
        "type": "object",
        "title": "UpdateMetadataResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://app.docupipe.ai"
    }
  ]
}
```