v1

latestOpenAPI 3.1.02026-07-1255227258.8 KB
documents

Patch Document Metadata

patch/documents/{document_id}/metadata

Path parameters

document_idstring uuid required

The id of the document.

Example:00000000-0000-0000-0000-000000000000

The id of the document.

Headers

partitionstring nullable

An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.

Example:acme_customer_id

An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.

Request body

metadataobject required

The metadata to update on the document. Performs a partial update of the document's metadata. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. Keys set to null are deleted. 1000 total values are allowed, inclusive of existing metadata. Each item in an array counts towards the total. The following keys are reserved for internal use: document_id, document_type, document_source, document_name, document_uploaded_at. If the document is managed by a connection, this operation will extend a metadata overlay which is applied to the document any time the connection syncs the document.

asyncboolean

Whether to run the metadata update asynchronously. If true, the metadata update will be run in the background and the response will be 202. If false, the metadata update will be run synchronously and the response will be 200.

Example request

{
  "metadata": {
    "classified": "null (setting null deletes key from metadata)",
    "editors": [
      "Alice",
      "Bob"
    ],
    "published": true,
    "articleCount": 42,
    "title": "declassified report"
  }
}

Response

Successful Response

OR

Example response

{
  "metadata": {
    "editors": [
      "Alice",
      "Bob"
    ],
    "title": "declassified report",
    "unchanged_key": "unchanged_value",
    "updated_at": 1714491736216
  }
}