PATCHing documents

You can use the following to PATCH documents.

  • /common/v1/documents/{documentId}
  • /claim/v1/claims/{claimId}/documents/{documentId}

Logically speaking, a PATCH call can modify only the metadata of a document, only the content of a document, or both.

PATCHing document metadata

Every PATCH /{documentId} call must include a metadata key/value pair, even if you want to modify only the content.

  • If you want to modify the metadata, specify the fields to modify in the JSON referenced by the metadata key.
  • If you do not want to modify the metadata, have the metadata key reference a payload with no attribute values, as shown below:
{
    "data": {
        "attributes": {
        }
    }
}

PATCHing document content

A PATCH /{documentId} call is not required to include a content key/value pair. If no content is specified, the PATCH will update the document metadata only.

PATCHes to content are destructive, not additive. If you specify content, the new content replaces the previous content entirely.

Examples of PATCHing documents

The following is an example of PATCHing only the metadata for document xc:101. In this example, the document status is changed to final.

PATCH /common/v1/documents/xc:101

Metadata:
{
    "data": {
        "attributes": {
            "status": {
                "code": "final"
            }
        }
    }
}

(No contents included with the API call)

The following is an example of PATCHing only the contents for document xc:101. Presumably, the contents of "Property Assessment Report.pdf" are different than the current contents of document xc:101.

PATCH /common/v1/documents/xc:101

Metadata:
{
    "data": {
        "attributes": {
            }
    }
}

Contents:
<contents of "Property Assessment Report.pdf" file>

The following is an example of PATCHing both the metadata for document xc:101 and the content.

PATCH /common/v1/documents/xc:101

Metadata:
{
    "data": {
        "attributes": {
            "status": {
                "code": "final"
            }
        }
    }
}

Contents:
<contents of "Property Assessment Report.pdf" file>