Bulk Documents

The Bulk Documents API allows you to create, update, and delete multiple documents in your vault.

Bulk Documents API Method API Endpoint Input Output Batch Size Available in API
Create Documents POST /api/{version}/objects/documents/batch CSV CSV, JSON 1-500 v9.0 or later
Update Documents PUT /api/{version}/objects/documents/batch CSV, Name-Value Pair CSV, JSON 1-1000 v9.0 or later
Delete Documents DELETE /api/{version}/objects/documents/batch CSV, JSON CSV, JSON 1-500 v13.0 or later
Add Document Versions POST /api/{version}/objects/documents/versions/batch CSV CSV, JSON 1-500 v10.0 or later
Delete Document Versions DELETE /api/{version}/objects/documents/versions/batch CSV, JSON CSV, JSON 1-500 v13.0 or later
Add Document Renditions POST /api/{version}/objects/documents/renditions/batch CSV CSV, JSON 1-500 v10.0 or later
Delete Document Renditions DELETE /api/{version}/objects/documents/renditions/batch CSV, JSON CSV, JSON 1-500 v13.0 or later

Create Documents

Request

Send a POST request to the /api/{version}/objects/documents/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.

File Upload

Prior to submitting this request, you must upload the source files to the FTP staging server. Learn more.
Add the file column to your input and enter the path/name of each file relative to the FTP root.

Headers

To specify the input file format, set the HTTP Request Header Content-Type to text/csv (CSV input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Example

$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\create_documents.csv" \
https://myvault.veevavault.com/api/v9.0/objects/documents/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path\name of the CSV input file is specified.
  • The API {version} is set to v9.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,errors
SUCCESS,771,ALT-DOC-0771,
SUCCESS,772,CHO-DOC-0772,
SUCCESS,773,GLU-DOC-0773,
FAILURE,,,"""INVALID_DATA|Error message describing why this document was not created."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773"
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document was not created."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. Use the HTTP POST method.
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in API user performing the bulk action has not been assigned the appropriate permissions.
PARAMETER_REQUIRED Missing required parameter [{FIELD_NAME}]. A required document field is missing from the input. The error message includes the missing field name.
INVALID_DATA Cannot parse request body. The input contains information which cannot be parsed by the API.
INVALID_DATA Cannot process the request : max 500 records expected. The input has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The input has no records (at least one is required).
INVALID_DATA Invalid value [{FILE_NAME_PATH}] specified for the file parameter : relative path to the file is expected. When creating new documents from files, you must first upload the documents to the FTP staging server. The file value in the input may contain either a single file name (if the file is located at the root of the FTP staging server) or a full path to the file (relative to the FTP root). If the API cannot find the file in the specified location, this error is returned for that row in the input.

History

Since v9

Top

Update Documents

Request

Send a PUT request to the /api/{version}/objects/documents/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.
Or, prepare a Name-Value Pair input. Learn more.

Headers

To specify the input format, set the HTTP Request Header Content-Type to text/csv (CSV input) or application/x-www-form-urlencoded (Name-Value Pair input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Example

$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\update_documents.csv" \
https://myvault.veevavault.com/api/v9.0/objects/documents/batch
  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The API {version} is set to v9.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,errors
SUCCESS,771,ALT-DOC-0771,
SUCCESS,772,CHO-DOC-0772,
SUCCESS,773,GLU-DOC-0773,
FAILURE,,,"""INVALID_DATA|Error message describing why this document was not updated."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773"
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document was not updated."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. Use the HTTP PUT method.
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in API user performing the bulk action has not been assigned the appropriate permissions.
INVALID_DATA Cannot parse request body. The input contains information which cannot be parsed by the API.
INVALID_DATA Cannot process the request : max 1000 records expected. The input has more than 1000 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The input has no records (at least one is required).

History

Since v9

Top

Delete Documents

Request

Send a DELETE request to the /api/{version}/objects/documents/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.
Or, prepare a JSON input file. Learn more.

Headers

To specify the input file format, set the HTTP Request Header Content-Type to text/csv (CSV input) or application/json (JSON input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Parameters

idParam - If you're identifying documents in your input by their external ID, add idParam=external_id__v to this request endpoint.

Example 1

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\delete_documents.csv" \
https://myvault.veevavault.com/api/v13.0/objects/documents/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The input uses the document id values. Therefore,idParam is not included.
  • The API {version} is set to v9.0 (earliest available for this request).

Example 2

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"C:\Vault\Documents\delete_documents.json" \
https://myvault.veevavault.com/api/v13.0/objects/documents/batch?idParam=external_id__v

In this example:

  • The input file format is set to JSON.
  • The response format is not set and will default to JSON.
  • The path/name of the JSON input file is specified.
  • The input uses the document external_id__v values. Therefore,idParam is included.
  • The API {version} is set to v9.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,errors
SUCCESS,771,ALT-DOC-0771,
SUCCESS,772,CHO-DOC-0772,
SUCCESS,773,GLU-DOC-0773,
FAILURE,,,"""INVALID_DATA|Error message describing why this document was not deleted."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773"
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document was not deleted."
                }
            ]
        }
    ]
}

Errors

Error Type Error Message Comments
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in API user cannot delete the requested documents.
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. Use the HTTP DELETE method.
INVALID_DATA Cannot parse request body. The CSV or JSON input file contains information or formatting which cannot be parsed by the API. This error is also returned if the HTTP Request Header Content-Type is set to text/csv and a JSON input is used instead or set to application/json and a CSV input is used instead.
INVALID_DATA Cannot process the request : max 500 records expected. The CSV or JSON input file has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The CSV or JSON input file has no records (at least one is required).
INVALID_DATA Document not found. A document id or external_id__v value specified in the input does not exist in your vault.
OPERATION_NOT_ALLOWED Document cannot be deleted due to an external reference. The document is currently in an active workflow or has one or more incoming relationships or reference links.
OPERATION_NOT_ALLOWED Document is currently checked out and cannot be deleted. The document is currently "checked out" (locked) by another user.
OPERATION_NOT_ALLOWED Document is currently in a "Steady-State" and cannot be deleted. Documents which are in a steady-state cannot be deleted.

History

Since v13

Top

Add Document Versions

Request

Send a POST request to the /api/{version}/objects/documents/versions/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.
Set your vault in Migration Mode. Learn more.

File Upload

Prior to submitting this request, you must upload the source files to the FTP staging server. Learn more.
Add the file column to your input and enter the path/name of each file relative to the FTP root.

Headers

Set the HTTP Request Header Content-Type to text/csv (CSV input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Parameters

idParam - If you're identifying documents in your input by their external ID, add idParam=external_id__v to this request endpoint.

Example 1

$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\add_document_versions.csv" \
https://myvault.veevavault.com/api/v10.0/objects/documents/versions/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The input uses the document id values. Therefore,idParam is not included.
  • The API {version} is set to v10.0 (earliest available for this request).

Example 2

$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"C:\Vault\Documents\add_document_versions.json" \
https://myvault.veevavault.com/api/v10.0/objects/documents/versions/batch?idParam=external_id__v

In this example:

  • The input file format is set to JSON.
  • The response format is not set and will default to JSON.
  • The path/name of the CSV input file is specified.
  • The input uses the document external_id__v values. Therefore,idParam is included.
  • The API {version} is set to v10.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,major_version_number__v,minor_version_number__v,errors
SUCCESS,771,ALT-DOC-0771,0,2
SUCCESS,772,CHO-DOC-0772,0,2
SUCCESS,773,GLU-DOC-0773,1,0
FAILURE,,,,,"""INVALID_DATA|Error message describing why this document version was not added."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771",
            "major_version_number__v": 0,
            "minor_version_number__v": 2
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772",
            "major_version_number__v": 0,
            "minor_version_number__v": 2
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773",
            "major_version_number__v": 1,
            "minor_version_number__v": 0
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document version was not added."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. When adding document versions in bulk, you must use the HTTP POST method.
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in user has not been assigned privileges to add document versions.
INVALID_DATA Cannot process the request: Migration Mode must first be activated. When adding document versions in bulk, Vault must be in Migration Mode. Learn more.
PARAMETER_REQUIRED Missing required parameter [{FIELD_NAME}]. A required field is missing from the input. The error message includes the missing field name.
INVALID_DATA Cannot parse request body. The input contains information which cannot be parsed by the API. Check the input format.
INVALID_DATA Cannot process the request : max 500 records expected. The input has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The input has no records (at least one is required).
INVALID_DATA Invalid value [{FIELD_VALUE}] specified for id parameter : one of id or external_id__v is expected. The id parameter is included in the input but its value has not been set to an allowed value. Set the value to either id or external_id__v by including the idParam parameter as described above.
INVALID_DATA Invalid value [{FILE_NAME_PATH}] specified for the file parameter : relative path to the file is expected. The file value in the input may contain either a single file name (if the file is located in the FTP root) or a full path to the file (relative to the FTP root). If the API cannot find the file in the specified location, this error is returned for that row in the input.
INVALID_DATA Version [{version_NUMBER}] already defined for document with [id={ID}]. The version number specified in the already exists on the specified document.

History

Since v10

Top

Delete Document Versions

Request

Send a DELETE request to the /api/{version}/objects/documents/versions/batch endpoint.

Prerequisites

Prepare a CSV input file. Learn more.
Or, prepare a JSON input file. Learn more.

Headers

To specify the input file format, set the HTTP Request Header Content-Type to text/csv (CSV input) or application/json (JSON input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Parameters

idParam - If you're identifying documents in your input by their external ID, add idParam=external_id__v to this request endpoint.

Example 1

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\delete_document_versions.csv" \
https://myvault.veevavault.com/api/v13.0/objects/documents/versions/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The input uses the document id values. Therefore,idParam is not included.
  • The API {version} is set to v13.0 (earliest available for this request).

Example 2

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"C:\Vault\Documents\delete_document_versions.json" \
https://myvault.veevavault.com/api/v13.0/objects/documents/versions/batch?idParam=external_id__v

In this example:

  • The input file format is set to JSON.
  • The response format is not set and will default to JSON.
  • The path/name of the CSV input file is specified.
  • The input uses the document external_id__v values. Therefore,idParam is included.
  • The API {version} is set to v13.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,major_version_number__v,minor_version_number__v,errors
SUCCESS,771,ALT-DOC-0771,0,2
SUCCESS,772,CHO-DOC-0772,0,2
SUCCESS,773,GLU-DOC-0773,1,0
FAILURE,,,,,"""INVALID_DATA|Error message describing why this document version was not deleted."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771",
            "major_version_number__v": 0,
            "minor_version_number__v": 2
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772",
            "major_version_number__v": 0,
            "minor_version_number__v": 2
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773",
            "major_version_number__v": 1,
            "minor_version_number__v": 0
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document version was not deleted."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in API user cannot delete the requested documents.
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. Use the HTTP DELETE method.
INVALID_DATA Cannot parse request body. The CSV or JSON input file contains information or formatting which cannot be parsed by the API. This error is also returned if the HTTP Request Header Content-Type is set to text/csv and a JSON input is used instead or set to application/json and a CSV input is used instead.
INVALID_DATA Cannot process the request : max 500 records expected. The CSV or JSON input file has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The CSV or JSON input file has no records (at least one is required).
INVALID_DATA Document not found. A document id or external_id__v value specified in the input does not exist in your vault.
INVALID_DATA Document version not found. A document version specified in the input does not exist on the document in your vault.
OPERATION_NOT_ALLOWED Document version cannot be deleted due to an external reference. The document version is currently part of an active workflow or has one or more incoming relationships or reference links.
OPERATION_NOT_ALLOWED Document version is currently checked out and cannot be deleted. The document version is currently "checked out" (locked) by another user.
OPERATION_NOT_ALLOWED Document version is currently the "Steady-State" and cannot be deleted. Documents versions which are the steady-state version of the document cannot be deleted.

History

Since v13

Top

Add Document Renditions

Request

Send a POST request to the /api/{version}/objects/documents/renditions/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.
Set your vault in Migration Mode. Learn more.

File Upload

Prior to submitting this request, you must upload the source files to the FTP staging server. Learn more.
Add the file column to your input and enter the path/name of each file relative to the FTP root.

Headers

To specify the input file format, set the HTTP Request Header Content-Type to text/csv (CSV input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Parameters

idParam - If you're identifying documents in your input by their external ID, add idParam=external_id__v to this request endpoint.

Example 1

$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\add_document_renditions.csv" \
https://myvault.veevavault.com/api/v10.0/objects/documents/renditions/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The input uses the document id values. Therefore,idParam is not included.
  • The API {version} is set to v10.0 (earliest available for this request).

Example 2

$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"C:\Vault\Documents\add_document_renditions.json" \
https://myvault.veevavault.com/api/v12.0/objects/documents/renditions/batch?idParam=external_id__v

In this example:

  • The input file format is set to JSON.
  • The response format is not set and will default to JSON.
  • The path/name of the CSV input file is specified.
  • The input uses the document external_id__v values. Therefore,idParam is included.
  • The API {version} is set to v10.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,major_version_number__v,minor_version_number__v,rendition_type__v,errors
SUCCESS,771,ALT-DOC-0771,0,2,imported_rendition__vs,
SUCCESS,772,CHO-DOC-0772,0,2,imported_rendition__vs,
SUCCESS,773,GLU-DOC-0773,1,0,imported_rendition__vs,
FAILURE,,,,,,"""INVALID_DATA|Error message describing why this document rendition was not added."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771",
            "major_version_number__v": 0,
            "minor_version_number__v": 2,
            "rendition_type__vs": "imported_rendition__vs"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772",
            "major_version_number__v": 0,
            "minor_version_number__v": 2,
            "rendition_type__vs": "imported_rendition__vs"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773",
            "major_version_number__v": 1,
            "minor_version_number__v": 0,
            "rendition_type__vs": "imported_rendition__vs"
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document rendition was not added."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. When adding document renditions in bulk, you must use the HTTP POST method.
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in user has not been assigned privileges to add document renditions.
INVALID_DATA Cannot process the request: Migration Mode must first be activated. When adding document renditions in bulk, Vault must be in Migration Mode. Learn more.
PARAMETER_REQUIRED Missing required parameter [{FIELD_NAME}]. A required field is missing from the input. The error message includes the missing field name.
INVALID_DATA Cannot parse request body. The input contains information which cannot be parsed by the API. Check the input format.
INVALID_DATA Cannot process the request : max 500 records expected. The input has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The input has no records (at least one is required).
INVALID_DATA Invalid value [{FIELD_VALUE}] specified for id parameter : one of id or external_id__v is expected. The id parameter is included in the input but its value has not been set to an allowed value. Set the value to either id or external_id__v by including the idParam parameter as described above.
INVALID_DATA Invalid value [{FILE_NAME_PATH}] specified for the file parameter : relative path to the file is expected. The file value in the input may contain either a single file name (if the file is located in the FTP root) or a full path to the file (relative to the FTP root). If the API cannot find the file in the specified location, this error is returned for that row in the input.
INVALID_DATA Invalid value [{RENDITION_TYPE}] specified for the rendition_type__v parameter : valid rendition type name is expected. The rendition_type__v value specified in the input must contain a valid rendition type as defined in Vault (imported_rendition__vs, veeva_distribution_package__vs, etc.). If the API does not recognize the specified rendition type, this error is returned for that row in the input.
INVALID_DATA Cannot add rendition : document with ID [{ID}] and version [{version}] does not exist. The file value in the input must exist on the staging server and correspond to a document id, major_version_number__v, and minor_version_number__v which already exists in Vault. If the API cannot find the specified document ID, major version number, and/or minor version number, this error is returned for that row in the input.
INVALID_DATA Cannot add multiple renditions of type [{RENDITION_TYPE}] for document with ID [{ID}] and version [{version}]. If the rendition_type__v specified in the input already exists for the specified document ID and version in Vault, this error is returned for that row in the input.

Version History

Since v10

Top

Delete Document Renditions

This request will delete document renditions from the latest version of the document. You cannot delete renditions from old document versions.

Request

Send a DELETE request to the /api/{version}/objects/documents/renditions/batch endpoint.

Inputs

Prepare a CSV input file. Learn more.
Or, prepare a JSON input file. Learn more.

Headers

To specify the input file format, set the HTTP Request Header Content-Type to text/csv (CSV input) or application/json (JSON input).
JSON is the default response format. To request a CSV response, set the HTTP Request Header Accept to text/csv.

Parameters

idParam - If you're identifying documents in your input by their external ID, add idParam=external_id__v to this request endpoint.

Example 1

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \ 
--data-binary @"C:\Vault\Documents\delete_document_renditions.csv" \
https://myvault.veevavault.com/api/v13.0/objects/documents/renditions/batch

In this example:

  • The input file format is set to CSV.
  • The response format is set to CSV.
  • The path/name of the CSV input file is specified.
  • The input uses the document id values. Therefore,idParam is not included.
  • The API {version} is set to v13.0 (earliest available for this request).

Example 2

$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"C:\Vault\Documents\delete_document_renditions.json" \
https://myvault.veevavault.com/api/v13.0/objects/documents/renditions/batch?idParam=external_id__v

In this example:

  • The input file format is set to JSON.
  • The response format is not set and will default to JSON.
  • The path/name of the CSV input file is specified.
  • The input uses the document external_id__v values. Therefore,idParam is included.
  • The API {version} is set to v13.0 (earliest available for this request).

Response (CSV)

responseStatus,id,external_id__v,major_version_number__v,minor_version_number__v,rendition_type__v,errors
SUCCESS,771,ALT-DOC-0771,0,2,imported_rendition__vs,
SUCCESS,772,CHO-DOC-0772,0,2,imported_rendition__vs,
SUCCESS,773,GLU-DOC-0773,1,0,imported_rendition__vs,
FAILURE,,,,,,"""INVALID_DATA|Error message describing why this document rendition was not added."""

Response (JSON)

{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 771,
            "external_id__v": "ALT-DOC-0771",
            "major_version_number__v": 0,
            "minor_version_number__v": 2,
            "rendition_type__vs": "imported_rendition__vs"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 772,
            "external_id__v": "CHO-DOC-0772",
            "major_version_number__v": 0,
            "minor_version_number__v": 2,
            "rendition_type__vs": "imported_rendition__vs"
        },
        {
            "responseStatus": "SUCCESS",
            "id": 773,
            "external_id__v": "GLU-DOC-0773",
            "major_version_number__v": 1,
            "minor_version_number__v": 0,
            "rendition_type__vs": "imported_rendition__vs"
        },        
        {
            "responseStatus": "FAILURE"
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this document rendition was not added."
                }
            ]
        }
    ]
}

The order in which results are displayed in the response is the same as the order of records in the input.

Errors

Error Type Error Message Comments
INSUFFICIENT_ACCESS User does not have sufficient privileges to perform the action. The logged-in API user cannot delete the requested documents.
METHOD_NOT_SUPPORTED Requested method [{METHOD}] not supported. Use the HTTP DELETE method.
INVALID_DATA Cannot parse request body. The CSV or JSON input file contains information or formatting which cannot be parsed by the API. This error is also returned if the HTTP Request Header Content-Type is set to text/csv and a JSON input is used instead or set to application/json and a CSV input is used instead.
INVALID_DATA Cannot process the request : max 500 records expected. The CSV or JSON input file has more than 500 records (not allowed).
INVALID_DATA Cannot parse the request body : at least 1 record is expected. The CSV or JSON input file has no records (at least one is required).
INVALID_DATA Document not found. A document id or external_id__v value specified in the input does not exist in your vault.
INVALID_DATA Document version not found. A document version specified in the input does not exist on the document in your vault.
OPERATION_NOT_ALLOWED Document version cannot be deleted due to an external reference. The document version is currently part of an active workflow or has one or more incoming relationships or reference links.
OPERATION_NOT_ALLOWED Document version is currently checked out and cannot be deleted. The document version is currently "checked out" (locked) by another user.
OPERATION_NOT_ALLOWED Document version is currently the "Steady-State" and cannot be deleted. Documents versions which are the steady-state version of the document cannot be deleted.

History

Since v13