Skip to content

Update Single Document

Update editable field values on the latest version of a single document. To update past document versions, see Update Document Version. Note that this endpoint does not allow you to update the archive__v field. To archive a document, or to update multiple documents at once, see Update Multiple Documents.

PUT/api/{version}/objects/documents/{doc_id}
NameDescription
Content-Typeapplication/x-www-form-urlencoded
Acceptapplication/json (default) or application/xml
X-VaultAPI-MigrationModeWhen set to true, Vault relaxes field validation to support document migration. You must have the Document Migration permission to use this header. Learn more about Document Migration Mode.
X-VaultAPI-NoTriggersIf set to true and Document Migration Mode is enabled, it bypasses all system, standard, and custom doctype triggers.

With the X-VaultAPI-MigrationMode header, Vault relaxes field validation to support document migration.

When this header is set to true, Vault:

  • Does not enforce requiredness validation on document fields.
  • Does not enforce Dynamic Reference Constraint (DRC) validation.
  • Does not send notifications.

Additionally, developers can:

  • Change the document number.
  • Assign an inactive document type, subtype, classification, lifecycle, or lifecycle state.
  • Set lookup field values directly. Vault recalculates a lookup field only when you update one of its source fields.
  • Set last_modified_by__v and version_modified_date__v.

You must have the Vault Owner Actions: Document Migration permission to use this header. Learn more about Document Migration Mode.

NameDescription
{doc_id}The document id field value.

In the body of the request, add any editable field values that you wish to update. To find these fields, Retrieve Document Fields configured on documents. Editable fields will have editable:true. To remove existing field values, include the field name and set its value to null.

Object reference fields support object reference notation, which lets you specify a related object record by a unique field value instead of by record ID.

curl -X PUT -H "Authorization: {AUTH_VALUE}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "language__v=English" \
-d "product__v=1357662840171" \
-d "audience__vs=consumer__vs" \
https://myvault.veevavault.com/api/v26.3/objects/documents/534
{
"responseStatus": "SUCCESS",
"id": 534
}

On SUCCESS, Vault updates field values for the latest version of the document and returns the ID of the updated document.