Skip to content

Initiate a document workflow on a set of documents. If any document is not in the relevant state or does not meet configured field conditions, the API returns INVALID_DATA for the invalid documents and the workflow does not start.

POST/api/{version}/objects/documents/actions/{workflow_name}
NameDescription
Content-Typeapplication/json (default) or application/x-www-form-urlencoded
Acceptapplication/json (default) or application/xml
NameDescription
{workflow_name}The document workflow name value.

The following parameters are required, but an Admin may set other fields as required in your Vault. To find which fields are required to start this workflow, Retrieve Document Workflow Details.

NameDescription
contents__sysInput a comma-separated list of document id field values. Maximum 100 documents.
description__sysDescription of the workflow. Maximum 128 characters.
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: application/json" \ -d "approver__c: user:83610" \ -d "exec_approver__c: user:10081" \ -d "contents__sys: 56,31,25" \ -d "description__sys: CSR Approval" \ https://myvault.veevavault.com/api/v22.3/objects/documents/actions/Objectworkflow.clinical_study_report_approval__c
{ "responseStatus": "SUCCESS", "data": { "record_url": "/api/v22.3/vobjects/envelope__sys/0ER000000000501", "record_id__v": "0ER000000000501", "workflow_id": "1301" } }
{ "responseStatus": "FAILURE", "errors": [ { "type": "INVALID_DATA", "message": "Invalid value [94] specified for parameter [contents__sys] : documents are in invalid lifecycles" } ] }

On SUCCESS, the response includes the following:

NameDescription
record_id__vThe id value of the envelope__sys record.
workflow_idThe workflow id field value.

Document workflows share some of the same capabilities as object workflows and are configured on the envelope_sys object. You can use the Workflow Task endpoints to retrieve document workflow tasks, task details, and initiate document workflow tasks.

You can remove one or more documents from an envelope__sys object using the removecontent action in the Initiate Workflow Action endpoint.