API Reference (v14.0)
We recommend using a newer version of the API.
For general information on Vault, refer to Vault Help.
General Information
Authentication
Authentication calls are how you gain access to a vault through the API. The following methods are supported:
Username & Password Authentication
SAML Single Sign-on (SSO) Authentication
Salesforce Delegated Authentication
The authentication call response includes an authentication token which is valid for the current session and will "time-out" after a period of idle time. The token must be included with the HTTP Authorization
request header with each subsequent request. In the examples shown here, the token is indicated by {SESSION_ID}
. For example:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/{version}/objects/documents
$ curl -X GET -H "Authorization: 3B3C45FD240E26F0C3DB4F82BBB0C15C7EFE4B29EF9916AF41AF7E44B170BAA01F232B" \
https://myvault.veevavault.com/api/{version}/objects/documents
Alternatively, you can include the auth
request parameter set to the {SESSION_ID}
. This is used instead of the Authorization
header. For example:
$ curl -X GET https://myvault.veevavault.com/api/{version}/objects/documents?auth=3B3C45FD240E26F0C3DB4F82BBB0C15C7EFE4B29EF9916AF41AF7E44B170BAA01F232B
Note that if a request includes both the auth
parameter and the Authorization
header, the auth
parameter is used.
History
v1+ - Supports Username & Password Authentication
v5+ - Supports Salesforce Delegated Authentication
v12+ - Supports SAML Single Sign-On (SSO) Authentication
Security
Vault's API respects the security profiles and permission sets assigned to each user. To use the API, users be assigned a permission set which allows API access. These include All API, Metadata API, Access API, and Events API access. Additionally, users can only access vaults, documents, binders, objects, etc., to which they have been assigned permission. Most of these items include individual permissions for Read, Create, Edit, Delete, and others.
When an API user submits a GET
request, the response will only include data which they are allowed to view, even if additional data is available. For requests which the user is not allowed to perform, an INSUFFICIENT_ACCESS
error is returned. Learn about Authentication & Vault Security in Vault Help.
HTTP Methods
Vault API uses the POST
, GET
, PUT
, and DELETE
HTTP methods.
These correspond to Create, Retrieve (Read), Update, and Delete (or CRUD) operations, respectively.
API Versions
Retrieve all supported versions of the Vault API.
Request
Send GET
to /api
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com.veevavault.com/api/
Response
{
"responseStatus": "SUCCESS",
"values": {
"v2.0": "https://myvault.veevavault.com/api/v2.0",
"v3.0": "https://myvault.veevavault.com/api/v3.0",
"v4.0": "https://myvault.veevavault.com/api/v4.0",
"v5.0": "https://myvault.veevavault.com/api/v5.0",
"v6.0": "https://myvault.veevavault.com/api/v6.0",
"v7.0": "https://myvault.veevavault.com/api/v7.0",
"v8.0": "https://myvault.veevavault.com/api/v8.0",
"v9.0": "https://myvault.veevavault.com/api/v9.0",
"v10.0": "https://myvault.veevavault.com/api/v10.0",
"v11.0": "https://myvault.veevavault.com/api/v11.0",
"v12.0": "https://myvault.veevavault.com/api/v12.0",
"v13.0": "https://myvault.veevavault.com/api/v13.0",
"v14.0": "https://myvault.veevavault.com/api/v14.0"
}
}
Details
New versions of the API are released every 3 to 4 months and with each new version, a corresponding API Reference (this document) is published on this site. When making API calls to your vault, you may use any version by specifying the api/{version}/...
in the request endpoint. Later versions include additional endpoints, parameters, metadata, and options.
When making API calls, make sure you're referring to the same API Reference as the version specified in your requests.
The last version listed in the response is the latest API Beta version.
History
Since v1
Response Formats
Vault's API supports JSON (default), XML, and (with some requests) CSV response formats. The available response format options are listed in the Headers section of each request. If no particular format is requested, the response is JSON.
To request a different format, set the HTTP request header Accept
to application/xml
(always available) or text/csv
(when available). For example:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
-H "Accept: application/xml" \
https://myvault.veevavault.com/api/v14.0/objects/documents
$ curl -X GET -H "Authorization: {SESSION_ID}" \
-H "Accept: text/csv" \
https://myvault.veevavault.com/api/v14.0/objects/documents
Alternatively, you can include the format
request parameter set to xml
. This is used instead of the Accept
header. For example:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents?format=xml
Note that if a request includes both the format
parameter and the Accept
header, the format
parameter is used.
All responses include a responseStatus
with a SUCCESS
or FAILURE
value. For values other than SUCCESS, the response includes an errors
key/value array with an error type
and message
. These provide key information regarding the reason for the error. If there are no errors, errors
is either absent from the response or has an empty value. Many requests documented here include a Details and Errors section which provide additional response information specific to the request.
There is a third responseStatus
with an EXCEPTION
value. These are returned for API system-level errors. The response format for system-level errors is always JSON.
See the API Errors section below for additional information.
Domain Information
Domain Admins can use this request to retrieve a list of all vaults currently in their domain.
Request
Send GET
to /api/{version}/objects/domain
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/domain
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Success",
"domain__v": {
"domain_name__v": "veevapharm",
"domain_type__v": "testvaults",
"vaults__v": [
{
"id": "2000",
"vault_name__v": "PromoMats",
"vault_status__v": "Active",
"vault_application__v": "PromoMats"
},
{
"id": "3000",
"vault_name__v": "MedComms",
"vault_status__v": "Active",
"vault_application__v": "MedComms"
},
{
"id": "4000",
"vault_name__v": "eTMF",
"vault_status__v": "Active",
"vault_application__v": "eTMF"
},
{
"id": "5000",
"vault_name__v": "QualityDocs",
"vault_status__v": "Active",
"vault_application__v": "QualityDocs"
},
{
"id": "6000",
"vault_name__v": "Submissions",
"vault_status__v": "Active",
"vault_application__v": "Submissions"
},
{
"id": "7000",
"vault_name__v": "RIM Submissions",
"vault_status__v": "Active",
"vault_application__v": "RIM"
},
{
"id": "8000",
"vault_name__v": "Platform",
"vault_status__v": "Active",
"vault_application__v": "Base"
}
]
}
}
Details
Field Name | Description |
---|---|
domain_name__v |
The name of the domain containing the vaults. This is unique to each customer and part of the DNS of each vault. |
domain_type__v |
The type of domain (Production, Sandbox, Demo, or Test). |
id |
The system-managed numeric ID assigned to each vault. This is the Vault ID (vault_id__v ) required in some requests. |
vault_name__v |
The name of each vault. This may be the same as the application or set to something unique. |
vault_status__v |
The current status of each vault (Active or Inactive). Inactive vaults are inaccessible. |
vault_application__v |
The application of each vault (PromoMats, MedComms, eTMF, Quality Docs, Submissions, RIM Submissions, or Platform). |
In the UI, this information is displayed in Admin > Settings > General Settings and Admin > Settings > Domain Information.
History
Since v7
Metadata Endpoints
Retrieve API metadata endpoints for documents, users, groups, security policies, and objects.
Request
Send GET
to /api/{version}/metadata/objects
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects
Response
{
"responseStatus": "SUCCESS",
"values": {
"documents": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types",
"users": "https://myvault.veevavault.com/api/v14.0/metadata/objects/users",
"groups": "https://myvault.veevavault.com/api/v14.0/metadata/objects/groups",
"securitypolicies": "https://myvault.veevavault.com/api/v14.0/metadata/objects/securitypolicies",
"vobjects": "https://myvault.veevavault.com/api/v14.0/metadata/vobjects"
}
}
Details
Field Name | Description |
---|---|
documents |
Endpoint to retrieve a list of all document types configured in your vault. See details below. |
users |
Endpoint to retrieve a list of all user metadata configured in your vault. See details below. |
groups |
Endpoint to retrieve a list of all group metadata configured in your vault. See details below. |
securitypolicies |
Endpoint to retrieve a list of all security policy metadata configured in your vault. See details below. |
vobjects |
Endpoint to retrieve a list of all standard and custom Vault Objects configured in your vault. See details below. |
History
Since v1
API Limits
Vault imposes a limit to the number of API calls that can occur within a 24-hour period (Daily Limit) and within a 5-minute period (Burst API Limit). The default limits are quite high, but if they are exceeded, Vault no longer accepts API calls until enough time has passed so that the number of calls falls below the limit. The limits are configured on each individual vault in a domain.
The default limit every 5 minutes is 2,000 calls.
The default limit every 24 hours is 100,000 calls.
As of API v14.0, the header of each response includes the number of calls remaining for the daily and burst limits. For example:
Cache-Control → private, no-store
Connection → Keep-Alive
Content-Encoding → gzip
Content-Language → en-US
Content-Type → application/json;charset=UTF-8
Date → Wed, 02 Mar 2016 22:20:55 GMT
Expires → Thu, 01 Jan 1970 00:00:00 GMT
Keep-Alive → timeout=15, max=100
Server → Apache/2.2.27 (Unix)
Transfer-Encoding → chunked
Vary → Accept-Encoding
X-VaultAPI-BurstLimitRemaining → 1999
X-VaultAPI-DailyLimitRemaining → 99967
X-VaultAPI-ExecutionId → http-DEV-7674-3
Vault automatically sends a notification to all users with system notifications enabled whenever the API limit is exceeded. Admins can also set up "threshold" limits to notify users when the daily API count is close to the limit. Learn more in Vault Help.
Retrieve Limits on Vault Objects
Vault limits the number of object records that can be created for each object (product__v
, study__v
, custom_object__c
, etc.). There is also a limit to the number of custom objects that can be created in each vault. To retrieve these limits:
Request
Send GET
to /api/{version}/limits
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/limits
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"name": "records_per_object",
"max": 1000000
},
{
"name": "custom_objects",
"remaining": 7,
"max": 20
}
]
}
Details
Field Name | Description |
---|---|
records_per_object |
The maximum number of records that can be created per object in the vault. |
custom_objects |
The maximum number of custom objects that can be created in the vault and the number remaining. |
History
Since v14
Documents
Vault is a very configurable system designed to reflect the business model of documents. Each vault can have different document types, document properties, etc. The Document Metadata APIs allow you to query the vault to understand what document-based metadata is available to use. Learn about Documents & Binders in Vault Help.
Vault Document Metadata
Retrieve all standard and custom document metadata fields in a vault by sending GET
to /api/{version}/metadata/objects/documents/properties
. See request details below.
The tables below describe document metadata in API v14.0.
- Document Fields (General)
- Document Date & DateTime Fields
- Document User Fields
- Document Role Fields
- Document Annotation Fields
- CrossLink Document Fields
- Document Field Types
- Metadata Fields (Properties)
Note that the lists of document fields below does not include custom fields or standard fields existing only in specific vault applications and integrations. Use the Document Metadata API to retrieve a complete list of fields existing in your vault.
Document Fields (General)
Field Name | Default Field Label | Field Type | Description | Required | Editable | Queryable |
---|---|---|---|---|---|---|
id |
ID | ID | Unique document identifier (permanent). Numeric value. | System-Managed | False | True |
external_id__v |
External ID | String | Unique document identifier (user-defined). Alphanumeric value. | Configurable | True | True |
document_number__v |
Document Number | Autonumber | Unique document identifier. Alphanumeric value. | System-Managed | False | True |
md5checksum__v |
Checksum | ExactMatchString | Unique document identifier. Alphanumeric value. | System-Managed | False | True |
filename__v |
Filename | ExactMatchString | Unique document identifier. Alphanumeric value. | System-Managed | False | True |
format__v |
Format | ExactMatchString | Document format (application/pdf, image/jpeg, etc.). | System-Managed | False | True |
export_filename__v |
Export File Name | String | Document file name on export. | Configurable | True | True |
pages__v |
Pages | Number | Document page count. | System-Managed | False | True |
size__v |
Size | Number | Document size (KB). | System-Managed | False | True |
name__v |
Name | String | Document name. | True | True | True |
type__v |
Type | String | Document type. | True | False | True |
subtype__v |
Subtype | String | Document subtype. | True | False | True |
classification__v |
Classification | String | Document classification. | True | False | True |
lifecycle__v |
Lifecycle | String | Document lifecycle. | True | False | True |
major_version_number__v |
Major Version Number | Number | Given document version "1.0", the major version number is "1". | True | True | True |
minor_version_number__v |
Minor Version Number | Number | Given document version "1.0", the minor version number is "0". | True | True | True |
title__v |
Title | String | Document title. | Configurable | True | True |
description__v |
Description | String | Document description. | Configurable | True | True |
language__v |
Language | Picklist | Document language. | Configurable | True | True |
status__v |
Status | String | Document status (Draft, In Review, Approved, etc.). | False | True | True |
locked__v |
Checked Out | Boolean | Whether or not the document is "checked out" by another user. | False | False | True |
binder__v |
Binder | Boolean | Whether or not the document is a binder. | System=managed | False | True |
Document Date & DateTime Fields
Date
fields have the following format: YYYY-MM-DD ('2014-12-20').
DateTime
fields have the following format: YYYY-MM-DD'T'HH:MM:SS.SSS'Z' ('2014-12-20T15:30:00.000Z').
Date
and DateTime
fields are specified in UTC (Coordinated Universal Time) and not the user's time zone.
Field Name | Description | Comments |
---|---|---|
document_creation_date__v |
Document Creation Date | When the original source document was first created. |
version_creation_date__v |
Version Creation Date | When the document version was first created. |
version_modified_date__v |
Version Modified Date | When the document version was last modified/updated. |
locked_date__v |
Document Locked Date | When the document version was locked (checked-out). See the Document Locks API below. |
Document User Fields
These list key document user information. See the Users API below. Learn about Users & Groups in Vault Help.
Field Name | Description | Comments |
---|---|---|
owner__v |
Document Owner | User id field value of the owner of the document. |
created_by__v |
Document Created By | User id field value of the person who first created the document. |
version_created_by__v |
Version Created By | User id field value of the person who created the retrieved version. |
last_modified_by__v |
Document Last Modified By | User id field value of the person who last modified/updated the document. |
locked_by__v |
Document Locked By | User id field value of the person who locked (checked out) the document. See the Document Locks API below. |
Document Role Fields
These list the users and groups assigned to various roles on each document. Admins may create additional roles. See the Roles API below. Learn about Lifecycle Roles in Vault Help.
Field Name | Description | Comments |
---|---|---|
viewer__v.users |
Viewer Users | User id values of individual users assigned the "Viewer" role on the document. |
viewer__v.groups |
Viewer Groups | Group id values of groups of users assigned the "Viewer" role on the document. |
reviewer__v.users |
Reviewer Users | User id values of individual users assigned the "Reviewer" role on the document. |
reviewer__v.groups |
Reviewer Groups | Group id values of groups of users assigned the "Reviewer" role on the document. |
editor__v.users |
Editor Users | User id values of individual users assigned the "Editor" role on the document. |
editor__v.groups |
Editor Groups | Group id values of groups of users assigned the "Editor" role on the document. |
approver__v.users |
Approver Users | User id values of individual users assigned the "Approver" role on the document. |
approver__v.groups |
Approver Groups | Group id values of groups of users assigned the "Approver" role on the document. |
coordinator__v.users |
Coordinator Users | User id values of individual users assigned the "Coordinator" role on the document. |
coordinator__v.groups |
Coordinator Groups | Group id values of groups of users assigned the "Coordinator" role on the document. |
consumer__v.users |
Consumer Users | User id values of individual users assigned the "Consumer" role on the document. |
consumer__v.groups |
Consumer Groups | Group id values of groups of users assigned the "Consumer" role on the document. |
distribution_contacts__v |
Distribution Contacts | User id values of individual users assigned the "Distribution Contacts" role on the document. |
Document Annotation Fields
These list the number of annotations on a document (if any). See the Document Annotations API below. Learn about Document Annotations in Vault Help.
Field Name | Description | Comments |
---|---|---|
annotations_all__v |
All Document Annotations | Total number of all annotation types listed below, resolved and unresolved. |
annotations_links__v |
Link Annotations | Number of link annotations on the document. |
annotations_lines__v |
Line Annotatations | Number of line annotations on the document. |
annotations_anchors__v |
Document Anchors | Number of anchor annotations on the document. |
annotations_notes__v |
Document Notes | Number of text annotations on the document. |
annotations_resolved__v |
Resolved Annotations | Number of annotations on the document which have been resolved. |
annotations_unresolved__v |
Unresolved Annotations | Number of annotations on the document which have not been resolved. |
CrossLink Document Fields
These are configured with values on documents which are bound to CrossLinks or documents which are themselves CrossLinks. See the Create CrossLink Document API below. Learn about CrossLinks in Vault Help.
Field Name | Description | Comments |
---|---|---|
crosslink__v |
CrossLink Document (true/false) | Whether or not the document is a CrossLink. |
source_document_id__v |
Source Document ID | Document id value of the source document in the source vault. |
source_document_name__v |
Source Document Name | Document name__v value of the source document in the source vault. |
source_document_number__v |
Source Document Number | document_number__v value of the source document in the source vault. |
source_owner__v |
Source Document Owner | Document owner__v value of the source document in the source vault. |
source_vault_id__v |
Source Vault ID | Vault id value of the vault containing the source document. Learn more. |
source_vault_name__v |
Source Vault Name | Name of the vault containing the source document. |
source_binding_rule__v |
Source Binding Rule | Binding rule applied to the CrossLink. |
bound_source_major_version__v |
Bound Source Major Version | Current major version of the source document bound to the CrossLink. |
bound_source_minor_version__v |
Bound Source Minor Version | Current minor version of the source document bound to the CrossLink. |
latest_source_major_version__v |
Latest Source Major Version | Latest major version of the source document bound the CrossLink. |
latest_source_minor_version__v |
Latest Source Minor Version | Latest minor version of the source document bound to the CrossLink. |
link_status__v |
Link Status | Whether or not the link to the source document is currently active. |
Document Field Types
All standard and custom document fields are of one of the following types:
Field Type | Description |
---|---|
ID | Reserved for the system-managed document id field. |
Autonumber | Reserved for the system-managed document_number__v field. |
String | Alphanumeric field that accepts any entered value up to a maximum length, including text, numbers, punctuation, and special characters. |
ExactMatchString | These function just like string (text) fields, except during search. They are not tokenized like regular string fields. When searching document fields, Vault only finds matches on this field type if you enter an exact match to its value. They are also case-sensitive. |
Number | Stores document number values. These adhere to minimum, maximum, and decimal precision values. |
Date | Stores document date values (YYYY-MM-DD). |
DateTime | Stores document date and time values (YYYY-MM-DD'T'HH:MM:SS.SSS'Z'). |
Picklist | Stores one or more items selected from a list of allowed values. |
ObjectReference | Stores references to one or more Vault Objects, each of which have their own object fields. |
Boolean | Stores "true" or "false" field values. |
Formula | Stores formulas using a combination of fields, functions, constants, and math operations in an expression. These are used only in reporting and are not currently exposed in the API. |
URL | Stores URL values which link to another resource. |
Document Metadata Fields (Properties)
The following information may be included with each field:
Metadata Field | Description | Comments |
---|---|---|
name |
Field Name | The document field name (name__v , title__v , etc.) is the primary method of identifying fields in the API. |
label |
Field Label | The document field label (Name, Title, etc.) is the primary method of identifying fields in the UI. |
type |
Field Type | See Document Field Types above. |
required |
Required | Indicates (true/false) if the field must be configured with a value when creating a new document. |
setOnCreateOnly |
Set On Create Only | Indicates (true/false) if the field value can only be set once (when creating a new document). |
editable |
Editable | Indicates (true/false) if the field value can be set or changed by the user, i.e., not system-managed. |
systemAttribute |
System Attribute | Indicates (true/false) if the field is system-managed, i.e., not editable by the user. |
repeating |
Repeating | Indicates (true/false) if the field can have multiple values. |
queryable |
Queryable | Indicates (true/false) if the field can be used as a keyword search parameter when searching documents. |
shared |
Shared | Indicates (true/false) if the field is shared with other document types. See Retrieve Common Document Fields below. |
disabled |
Disabled | Indicates (true/false) if the field has been disabled by your Vault Admin and no longer available when creating or editing documents. |
hidden |
Hidden | Indicates (true/false) if the field is "hidden" (not available) because it is dependent on another controlling field whose conditions have not been met. |
objectType |
Object Type | When the document field type is ObjectReference , this indicates the object which is being referenced. |
minValue |
Minimum Value | When the document field type is Number , this indicates the minimum numerical value which can be used. |
maxValue |
Maximum Value | When the document field type is Number , this indicates the maximum numerical value which can be used. |
scale |
Scale | When the document field type is Number , this indicates the maximum number of decimal places (0, 1, 2, etc.) which can be used. |
maxLength |
Maximum Length | When the document field type is id or String , this indicates the maximum character length which can be used. |
entryLabels |
Entry Labels | When the document field type is Picklist , this indicates the available picklist values. |
scope |
Scope | Document "scope" values include Document and DocumentVersion , indicating to which the field applies. |
helpContent |
Help Content | Displays any optional "help" text describing the document field. This is displayed in the UI when users hover over the document field. |
definedInType |
Defined In Type | Indicates (true/false) if the document field is defined at the document "type", "subtype", or "classification" level. |
definedIn |
Defined In | Displays the document "type", "subtype", or "classification" on which the document field is defined. |
section |
Section | The "section" in the UI document fields layout where the field is displayed. |
sectionPosition |
Section Position | Within the section described above, this indicates the document field's "position" (numerical order from top to bottom) in the section. |
relationshipType |
Relationship Type | When the document field type is ObjectReference , this indicates the type of relationship. |
relationshipName |
Relationship Name | For the relationshipType described above, this indicates the "name" which is used to perform a relationship query on the document and object. |
Retrieve Document Fields
Retrieve All Document Fields
Retrieve all standard and custom document fields and field properties.
Request
Send GET
to /api/{version}/metadata/objects/documents/properties
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/properties
Response (abridged)
{
"name": "name__v",
"scope": "DocumentVersion",
"type": "String",
"required": true,
"maxLength": 100,
"repeating": false,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"label": "Name",
"section": "generalProperties",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"helpContent": "The document name.",
"definedInType": "type",
"definedIn": "base_document__v"
}
{
"name": "product__v",
"scope": "DocumentVersion",
"type": "ObjectReference",
"required": true,
"repeating": true,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"objectType": "product__v",
"label": "Product",
"section": "productInformation",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"definedInType": "type",
"definedIn": "base_document__v",
"relationshipType": "reference",
"relationshipName": "document_product__vr"
}
{
"name": "document_creation_date__v",
"scope": "Document",
"type": "DateTime",
"required": true,
"repeating": false,
"systemAttribute": true,
"editable": false,
"setOnCreateOnly": false,
"disabled": false,
"label": "Created Date",
"section": "generalProperties",
"sectionPosition": 18,
"hidden": false,
"queryable": true,
"shared": false,
"definedInType": "type",
"definedIn": "base_document__v"
}
Details
The response lists all standard and custom document fields and field metadata. Note the following field metadata:
Metadata Field | Description |
---|---|
required |
When true, the field value must be set when creating new documents. |
editable |
When true, the field value can be user-defined. When false, the field value is system-managed. |
setOnCreateOnly |
When true, the field value can only be set once (when creating new documents). |
queryable |
When true, field values can be retrieved using the Query API. |
History
Since v4
Retrieve Common Document Fields
Retrieve all document fields and field properties which are common to (shared by) a specified set of documents.
This allows you to determine which document fields can be updated on documents in bulk.
Learn about Shared Fields in Vault Help.
Request
Send POST
to /api/{version}/metadata/objects/documents/properties/find_common
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Input
docIds
- Input a comma-separated list of document id
field values.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "docIds=101,102,103" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/properties/find_common
Response (abridged)
{
"name": "submission_date__vs",
"scope": "DocumentVersion",
"type": "Date",
"required": false,
"repeating": false,
"systemAttribute": false,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"label": "Submission Date",
"section": "submissionDetails",
"sectionPosition": 3,
"hidden": false,
"queryable": true,
"shared": true,
"usedIn": [
{
"key": "promotional_piece__vs",
"type": "type"
},
{
"key": "compliance_package__v",
"type": "type"
},
{
"key": "claim__vs",
"type": "type"
}
]
}
{
"name": "withdrawal_effective_date__vs",
"scope": "DocumentVersion",
"type": "Date",
"required": false,
"repeating": false,
"systemAttribute": false,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"label": "Withdrawal Effective Date",
"section": "pieceDetails",
"sectionPosition": 17,
"hidden": false,
"queryable": true,
"shared": false,
"definedInType": "type",
"definedIn": "promotional_piece__vs"
}
Details
The response includes all fields shared by the three documents (docIds=101,102,103
).
Vault allows you to reuse fields across multiple document types by creating shared fields, which exist outside the context of a document type. You can create shared fields or convert existing fields into shared fields in the Vault Admin application. If a shared field is only used in one document type, you can also convert it to a non-shared field. All document fields include the Boolean shared
document field. A value of true
indicates which the field is shared and the following additional fields are included:
Note the following field metadata:
Metadata Field | Description |
---|---|
shared |
May be set to true or false. |
usedIn (key ) |
When "shared": true , this lists the document types/subtypes/classifications which share the field. |
usedIn (type ) |
When "shared": true , this indicates if the shared field is defined at the document type, subtype, or classification level. |
History
Since v9
Retrieve Document Types
Document type refers both to the structure of hierarchical fields (Type > Subtype > Classification) that determines the relevant document fields, rendition types, and other settings for a document, and to the highest level in that hierarchy.
Vault Document Type API Endpoints:
- Retrieve All Document Types - Retrieve all standard and custom document types.
- Retrieve Document Type - Specify a document type to retrieve its metadata and subtypes.
- Retrieve Document Subtype - Specify a document subtype to retrieve its metadata and classifications.
- Retrieve Document Classification - Specify a document classification to retrieve its metadata.
Learn about Configuring Document Types in Vault Help.
Retrieve All Document Types
Retrieve all document types. These are the top-level of the document type/subtype/classification hierarchy.
Request
Send GET
to /api/{version}/metadata/objects/documents/types
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents
Response (abridged)
{
"responseStatus": "SUCCESS",
"types": [
{
"label": "Base Document",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/base_document__v"
},
{
"label": "Centralized Testing",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/centralized_testing__vs"
},
{
"label": "Central Trial Documents",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/central_trial_documents__vs"
},
{
"label": "Country Master File",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/country_master_file__v"
},
{
"label": "Data Management",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/data_management__vs"
},
{
"label": "Final CRF",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/final_crf__v"
},
{
"label": "IP and Trial Supplies",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/ip_and_trial_supplies__vs"
},
{
"label": "IRB/IEC and other Approvals",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/irbiec_and_other_approvals__vs"
},
{
"label": "Regulatory",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/regulatory__vs"
},
{
"label": "Safety Reporting",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/safety_reporting__vs"
},
{
"label": "Site Management",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/site_management__vs"
},
{
"label": "Site Master File",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/site_master_file__v"
},
{
"label": "Statistics",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/statistics__vs"
},
{
"label": "General",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/research_document__c"
},
{
"label": "Third parties",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/third_parties__vs"
},
{
"label": "Trial Management",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/trial_management__vs"
},
{
"label": "Trial Master File",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/trial_master_file__v"
},
{
"label": "Undefined",
"value": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/undefined__v"
}
],
"lock": "https://etmf-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/lock"
}
Details
The response lists all document types configured in the vault. These vary by vault application and configuration.
- Standard types end in
__v
. - Some vaults include sample types
__vs
. - Admins can configure custom types
__c
.
The response includes the following information:
Metadata Field | Description |
---|---|
types |
List of all standard and custom document types in your vault. These are the top-level of the document type/subtype/classification hierarchy. |
label |
Label of each document type as seen in the API and UI. |
value |
URL to retrieve the metadata associated with each document type. |
lock |
URL to retrieve the document lock metadata (document check-out). |
The label
is displayed in the UI. These can be applied to documents and binders.
History
Since v1
Retrieve Document Type
Retrieve all metadata from a document type, including all of its subtypes (when available).
Request
Send GET
to /api/{version}/metadata/objects/documents/types/{type}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{type}
- The document type. See Retrieve Document Types.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs
Response
{
"responseStatus": "SUCCESS",
"name": "promotional_piece__vs",
"label": "Promotional Piece",
"renditions": [
"viewable_rendition__v",
"production_proof__vs",
"distribution_package__vs",
"imported_rendition__vs",
"veeva_distribution_package__vs"
],
"relationshipTypes": [
{
"label": "CrossLink Latest Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Latest Steady State Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Linked Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Based on",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Claims",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Supporting Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Static Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Pieces",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
}
],
"templates": [
{
"label": "ANSM Submission",
"name": "ansm_submission__vs",
"kind": "binder",
"definedIn": "promotional_piece__vs",
"definedInType": "type"
}
],
"availableLifecycles": [
{
"name": "promotional_piece__vs",
"label": "Promotional Piece"
}
],
"subtypes": [
{
"label": "Advertisement",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs"
},
{
"label": "Direct Mail",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/direct_mail__vs"
},
{
"label": "Formulary Announcement",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/formulary_announcement__vs"
},
{
"label": "Internal Communication",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/internal_communication__vs"
},
{
"label": "Managed Markets Program",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/managed_markets_program__vs"
},
{
"label": "Healthcare Practitioner Resources",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/healthcare_practitioner_resources__vs"
},
{
"label": "Patient Education",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/patient_education__vs"
},
{
"label": "Promotional Labeling",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/promotional_labeling__vs"
},
{
"label": "Press Kit Material",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/press_kit_material__vs"
},
{
"label": "Reminder Item",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/reminder_item__vs"
},
{
"label": "Reprint",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/reprint__vs"
},
{
"label": "Speaker Program Materials",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/speaker_program_materials__vs"
},
{
"label": "Training Materials",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/training_materials__vs"
},
{
"label": "Convention Item",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/convention_item__vs"
}
]
}
Details
The response includes all metadata for the document specified type. If the type contains subtypes in the document type hierarchy, the list of subtypes and the URLs pointing to their metadata will be included in the response. If no subtypes exist in the document type hierarchy, the list of document fields defined for the specified type will be included in the response.
Each document type may include some or all of the following fields:
Metadata Field | Description |
---|---|
name |
Name of the document type. Used primarily in the API. |
label |
Label of the document type as seen in the API and UI. |
renditions |
List of all rendition types available for the document type. |
relationshipTypes |
List of all relationship types available for the document type. |
processes |
List of all processes available for the document type (when configured). |
etmfDepartment |
In eTMF vaults only. List of all eTMF departments available for the document type (when configured). |
referenceModels |
In eTMF vaults only. List of all reference models available for the document type. |
defaultWorkflows |
List of all workflows available for the document type. |
availableLifecycles |
List of all lifecycles available for the document type. |
templates |
List of all templates available for the document type (when configured). |
subtypes |
List of all standard and custom document subtypes available for the document type. |
History
Since v1
Retrieve Document Subtype
Retrieve all metadata from a document subtype, including all of its classifications (when available).
Request
Send GET
to /api/{version}/metadata/objects/documents/types/{type}/subtypes/{subtype}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{type}
- The document type. See Retrieve Document Types.
{subtype}
- The document type. See Retrieve Document Type.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs
Response (abridged)
{
"responseStatus": "SUCCESS",
"name": "advertisement__vs",
"label": "Advertisement",
"properties": [
{
"name": "id",
"type": "id",
"required": true,
"maxLength": 20,
"minValue": 0,
"maxValue": 9223372036854775807,
"repeating": false,
"systemAttribute": true,
"editable": false,
"setOnCreateOnly": true,
"disabled": false,
"hidden": true,
"queryable": true
},
{
"name": "name__v",
"scope": "DocumentVersion",
"type": "String",
"required": true,
"maxLength": 100,
"repeating": false,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"label": "Name",
"section": "generalProperties",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"helpContent": "The document name.",
"definedInType": "type",
"definedIn": "base_document__v"
},
{
"name": "product__v",
"scope": "DocumentVersion",
"type": "ObjectReference",
"required": true,
"repeating": true,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"objectType": "product__v",
"label": "Product",
"section": "productInformation",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"definedInType": "type",
"definedIn": "base_document__v",
"relationshipType": "reference",
"relationshipName": "document_product__vr"
},
...
...
...
],
"classifications": [
{
"label": "Other Electronic",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/other_electronic__vs"
},
{
"label": "Print",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/print__vs"
},
{
"label": "Radio",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/radio__vs"
},
{
"label": "Television",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/television__vs"
},
{
"label": "Web",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/web__vs"
}
],
"relationshipTypes": [
{
"label": "CrossLink Latest Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Linked Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Latest Steady State Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Based on",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Claims",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Supporting Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Static Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Pieces",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
}
],
"templates": [
{
"label": "ANSM Submission",
"name": "ansm_submission__vs",
"kind": "binder",
"definedIn": "promotional_piece__vs",
"definedInType": "type"
}
],
"availableLifecycles": [
{
"name": "promotional_piece__vs",
"label": "Promotional Piece"
}
]
}
History
Since v1
Retrieve Document Classification
Retrieve all metadata from a document classification.
Request
Send GET
to /api/{version}/metadata/objects/documents/types/{type}/subtypes/{subtype}/classifications/{classification}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{type}
- The document type. See Retrieve Document Types.
{subtype}
- The document type. See Retrieve Document Type.
{classification}
- The document classification. See Retrieve Document Subtype.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/subtypes/advertisement__vs/classifications/print__vs
Response (abridged)
{
"responseStatus": "SUCCESS",
"name": "advertisement__vs",
"label": "Advertisement",
"properties": [
{
"name": "id",
"type": "id",
"required": true,
"maxLength": 20,
"minValue": 0,
"maxValue": 9223372036854775807,
"repeating": false,
"systemAttribute": true,
"editable": false,
"setOnCreateOnly": true,
"disabled": false,
"hidden": true,
"queryable": true
},
{
"name": "name__v",
"scope": "DocumentVersion",
"type": "String",
"required": true,
"maxLength": 100,
"repeating": false,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"label": "Name",
"section": "generalProperties",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"helpContent": "The document name.",
"definedInType": "type",
"definedIn": "base_document__v"
},
{
"name": "product__v",
"scope": "DocumentVersion",
"type": "ObjectReference",
"required": true,
"repeating": true,
"systemAttribute": true,
"editable": true,
"setOnCreateOnly": false,
"disabled": false,
"objectType": "product__v",
"label": "Product",
"section": "productInformation",
"sectionPosition": 1,
"hidden": false,
"queryable": true,
"shared": false,
"definedInType": "type",
"definedIn": "base_document__v",
"relationshipType": "reference",
"relationshipName": "document_product__vr"
},
...
...
...
],
"relationshipTypes": [
{
"label": "CrossLink Latest Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Linked Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Latest Steady State Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Based on",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Claims",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Supporting Documents",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "CrossLink Static Bindings",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
},
{
"label": "Related Pieces",
"value": "https://promomats-veevapharm.vaultdev.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships"
}
],
"templates": [
{
"label": "ANSM Submission",
"name": "ansm_submission__vs",
"kind": "binder",
"definedIn": "promotional_piece__vs",
"definedInType": "type"
}
],
"availableLifecycles": [
{
"name": "promotional_piece__vs",
"label": "Promotional Piece"
}
]
}
History
Since v1
Retrieve Documents
The following rules govern document retrieval:
- Vault only returns documents to which the logged in user has been given access (even if more documents exist).
- Unless version operators are used, Vault only returns the latest version of each document.
- Vault returns a maximum of 200 documents per page. This can be changed (lowered) using the
limit
operator. Learn more below.
Identifying Binders
- A document pseudo-field
binder__v
indicates whether the returned document is a regular document or a binder. - The value of
true
means it is a binder,false
or absence of this field means it is a document. - If it is a binder, the binder node structure is not listed as part of the response and must be determined through the appropriate Binder API call.
Identifying CrossLink Documents
- A document pseudo-field
crosslink__v
indicates whether the returned document is a regular document or a CrossLink document. - The value of
true
means it is a CrossLink.
Retrieve All Documents
Retrieve the latest version of documents and binders to which you have access.
Request
Send GET
to /api/{version}/objects/documents
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Options
Using Named Filters: You can include one of the following parameters to filter the results:
named_filter=My Documents
- Retrieves only documents which you have created.
named_filter=Favorites
- Retrieves all documents which you have marked as favorites in the library.
named_filter=Recent Documents
- Retrieves all documents which you have recently accessed.
For example: /api/{version}/objects/documents?named_filter=My Documents
Searching Document Versions: By default, this request returns the latest version of all documents to which you have been given access. However, you can request that the search be performed across all versions of the documents by including the versionscope=all
parameter. For example:
/api/{version}/objects/documents?versionscope=all
Performing Keyword Searches: You can search for documents based on keywords in searchable document fields by using the search
operator. For example:
/api/{version}/objects/documents?search=hemophilia
.
You can expand the search to document content by using the scope
operator set to contents
or all
. For example:
search=hemophilia?scope=contents
- Searches only within the document content.
search=hemophilia?scope=all
- Searches both within the document content and searchable document fields.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents
Response (abridged)
{
"responseStatus": "SUCCESS",
"size": 69,
"start": 0,
"limit": 200,
"documents": [
{
"document": {
"id": 105,
"version_id": "105_0_1",
"binder__v": false,
"coordinator__v": {
"groups": [],
"users": []
},
"owner__v": {
"groups": [],
"users": [
25524
]
},
"approver__v": {
"groups": [],
"users": []
},
"reviewer__v": {
"groups": [],
"users": []
},
"distribution_contacts__v": {
"groups": [],
"users": []
},
"viewer__v": {
"groups": [],
"users": []
},
"consumer__v": {
"groups": [],
"users": []
},
"editor__v": {
"groups": [],
"users": []
},
"format__v": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"version_creation_date__v": "2016-03-23T22:03:04.094Z",
"major_version_number__v": 0,
"annotations_links__v": 0,
"annotations_all__v": 2,
"status__v": "Draft",
"language__v": [
"English"
],
"filename__v": "cholecap_presentation_q316.pptx",
"product__v": [
"00P000000000101"
],
"version_created_by__v": 25524,
"country__v": [],
"annotations_anchors__v": 0,
"document_number__v": "PP-WD--0014",
"minor_version_number__v": 1,
"lifecycle__v": "Promotional Piece",
"subtype__v": "Advertisement",
"annotations_notes__v": 2,
"allow_pdf_download__v": [
"00W000000000201"
],
"classification__v": "Other Electronic",
"name__v": "CholeCap Presentation",
"locked__v": false,
"pages__v": 29,
"restrict_fragments_by_product__v": true,
"type__v": "Promotional Piece",
"size__v": 623694,
"md5checksum__v": "0405da0c29698e4249c2a0eca8f6642a",
"annotations_unresolved__v": 2,
"last_modified_by__v": 25524,
"document_creation_date__v": "2016-03-23T22:03:04.094Z",
"annotations_resolved__v": 0,
"annotations_lines__v": 0,
"version_modified_date__v": "2016-03-23T22:04:16.000Z",
"created_by__v": 25524,
"media__vs": [
"Print"
]
}
},
...
Details
On SUCCESS, Vault lists all documents and binders along with their fields and field values.
The document metadata returned will vary based on your vault configuration.
Limit, Sort, and Paginate Results
By default, Vault returns a maximum of 200 documents per page. You can change (lower) this using the limit
operator. For example, to limit the number of documents to 20 per page:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents?limit=20
The limit
operator must be a positive integer. Values over 200 are ignored.
The default sort order is not based on any document field. You can change the sort parameters by including the sort
operator with a field and indicating descending desc
or ascending asc
. For example, to sort by the name of each document in descending order:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents?sort=name__v desc
With a maximum of 200 records returned per page, you must submit a new request to see the "next page" of results (when more than 200 documents exist). Use the start
operator in the same way as the limit
operator above. For example, if you're viewing the first page of 200 results out of 1000 total results found and want to see the next 200 results, enter start=201
.
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents?start=201
The start
operator must be a positive integer. Values equaling to a number larger than the total number of documents will not return any results.
To use limit
, start
, and sort
together, structure the string in the following manner:
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents?limit=10&start=51&sort=name__v desc
The request shown above will return 10 results per page, staring with page 5 (results 51-60), and sort the results by the document name in descending order.
History
Since v1
v4+ - Supports the SCOPE request parameter.
v4+ - Response includes term highlight hints.
v5+ - Includes the binder__v
true/false field to distinguish between documents and binders.
v10+ - Supports CrossLink documents.
Retrieve Document
Retrieve all metadata from a document.
Request
Send GET
to /api/{version}/objects/documents/{document_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/450
Response
{
"responseStatus": "SUCCESS",
"document": {
"id": 450,
"binder__v": false,
"allow_download_embedded_viewer__v": true,
"reviewer__v": {
"users": [
25519,
25516
],
"groups": [
1358979070034
]
},
"viewer__v": {
"users": [
25519,
25516,
25597
],
"groups": [
1358979070034
]
},
"distribution_contacts__v": {
"users": [],
"groups": []
},
"consumer__v": {
"users": [],
"groups": []
},
"approver__v": {
"users": [
25516
],
"groups": []
},
"editor__v": {
"users": [
25519,
25516
],
"groups": []
},
"owner__v": {
"users": [
46916
],
"groups": []
},
"coordinator__v": {
"users": [],
"groups": []
},
"crosslink__v": false,
"lifecycle__v": "General Lifecycle",
"version_created_by__v": 46916,
"language__v": [
"English"
],
"minor_version_number__v": 1,
"created_by__v": 46916,
"annotations_lines__v": 0,
"version_creation_date__v": "2015-03-12T16:24:33.539Z",
"country__v": [],
"md5checksum__v": "94e18bdbcf695c905a5968429e0c5204",
"restrict_fragments_by_product__v": true,
"annotations_notes__v": 0,
"version_modified_date__v": "2015-03-12T16:24:54.000Z",
"pages__v": 1,
"major_version_number__v": 1,
"annotations_anchors__v": 0,
"product__v": [
"1357662840293"
],
"export_filename__v": "451Chole",
"annotations_resolved__v": 0,
"type__v": "Reference Document",
"size__v": 11599,
"description__v": "This is my document.",
"status__v": "Draft",
"annotations_unresolved__v": 0,
"document_creation_date__v": "2015-02-25T01:26:55.845Z",
"locked__v": false,
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"annotations_links__v": 0,
"document_number__v": "REF-0201",
"annotations_all__v": 0,
"last_modified_by__v": 46916,
"name__v": "CholeCap Information",
"subtype__v": "Prescribing Information"
},
"renditions":
{
"viewable_rendition__v": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/renditions/viewable_rendition__v",
"veeva_distribution_package__vs": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/renditions/veeva_distribution_package__vs"
},
"versions": [
{
"number": "0.1",
"value": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/versions/0/1"
},
{
"number": "1.0",
"value": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/versions/1/0"
},
{
"number": "1.1",
"value": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/versions/1/1"
}
],
"attachments": [
{
"id": 547,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/450/attachments/547"
}
]
}
Identifying Binders
- A document pseudo-field
binder__v
indicates whether the returned document is a regular document or a binder. - The value of
true
means it is a binder,false
or absence of this field means it is a document. - If it is a binder, the binder node structure is not listed as part of the response and must be determined through the appropriate Binder API call.
Identifying CrossLink Documents
- A document pseudo-field
crosslink__v
indicates whether the returned document is a regular document or a CrossLink document. - The value of
true
means it is a CrossLink.
History
Since v1
v4+ - Response includes term highlight hints.
v5+ - Includes the binder__v
true/false field to distinguish between documents and binders.
v10+ - Supports CrossLink documents.
Retrieve Document Versions
Retrieve all versions of a document.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions
Response
{
"responseStatus": "SUCCESS",
"versions": [
{
"number": "0.1",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/0/1"
},
{
"number": "0.2",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/0/2"
},
{
"number": "1.0",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/1/0"
},
{
"number": "1.1",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/1/1"
},
{
"number": "2.0",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0"
},
{
"number": "2.1",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/1"
},
{
"number": "2.2",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/2"
},
{
"number": "2.3",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/3"
}
],
"renditions":
{
"viewable_rendition__v": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/viewable_rendition__v",
"veeva_distribution_package__vs": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/veeva_distribution_package__vs"
}
}
Details
On SUCCESS, Vault returns a list of all available versions of the specified document. In the response above, document id:534
has 8 different versions. Version 2.0 is the latest steady state version. Version 2.3 is the latest version. This document also has two different renditions: The viewable_rendition__v
and a veeva_distribution_package__vs
rendition.
History
Since v1
Retrieve Document Version
Retrieve all fields and values configured on a document version.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/3
Response (abridged)
{
"responseStatus": "SUCCESS",
"document": {
"id": 534,
"allow_download_embedded_viewer__v": true,
"reviewer__v": {
"users": [
46916,
45589
],
"groups": [
1359484520721
]
...
},
"crosslink__v": false,
"lifecycle__v": "General Lifecycle",
"version_created_by__v": 46916,
"language__v": [
"English"
],
"minor_version_number__v": 3,
"created_by__v": 46916,
"annotations_lines__v": 0,
"version_creation_date__v": "2015-03-13T16:24:33.539Z",
"country__v": [],
"md5checksum__v": "94e18bdbcf695c905a5989629e0c5204",
"restrict_fragments_by_product__v": true,
"annotations_notes__v": 0,
"version_modified_date__v": "2015-03-13T16:24:54.000Z",
"pages__v": 1,
"major_version_number__v": 2,
"annotations_anchors__v": 0,
"product__v": [
"1357662840293"
],
"export_filename__v": "WD",
"annotations_resolved__v": 0,
"type__v": "Reference Document",
"size__v": 11518,
"description__v": "",
"status__v": "Draft",
"annotations_unresolved__v": 0,
"document_creation_date__v": "2015-02-25T01:26:55.845Z",
"locked__v": false,
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"annotations_links__v": 0,
"document_number__v": "REF-0059",
"annotations_all__v": 0,
"last_modified_by__v": 46916,
"name__v": "Wonderdrug Information",
"binder__v": false,
"subtype__v": "Prescribing Information"
},
"renditions": [
{
"viewable_rendition__v": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/viewable_rendition__v",
"veeva_distribution_package__vs": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/veeva_distribution_package__vs"
}
],
"versions": [
{
"number": "2.3",
"value": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/3"
}
],
"attachments": [
{
"id": 547,
"url": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/attachments/547"
},
{
"id": 561,
"url": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/attachments/561"
}
]
}
Details
On SUCCESS, Vault returns all fields and values for the specified version of the document. The response above shows information for document id:534
version 2.3.
History
Since v1
Download Document File
Request
Send GET
to /api/{version}/objects/documents/{document_id}/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/file > file
You can also "check out" the document before the retrieval by setting lockDocument
request parameter to true
(this is set to false
by default).
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/file?lockDocument=true > file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="CholeCap-Presentation.pptx"
Response
On SUCCESS, Vault retrieves the latest version of the source file from the document. The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file.
History
Since v1
v6+ - Supports document lock (check-out) prior to download.
Download Document Version File
Download the file of a specific document version.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/file > file
You can also "check out" the document version before the retrieval by setting lockDocument
request parameter to true
(this is set to false
by default).
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/file?lockDocument=true > file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="CholeCap-Presentation.pptx"
Details
On SUCCESS, Vault retrieves the specified version of the source file from the document. The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file.
History
Since v1
v6+ - Supports document lock (check-out) prior to download.
Download Document Version Thumbnail File
Download the thumbnail image file of a specific document version.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/thumbnail
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/3/thumbnail > thumbnail.png
Response
On SUCCESS, Vault returns the thumbnail image for the specified version of the document. The HTTP Response Header Content-Type
is set to image/png
.
History
Since v6
Create Documents
The API supports the following create document actions:
- Create Document from Uploaded File
- Create Document from Template
- Create Content Placeholder Document
- Create Unclassified Document
- Create CrossLink Document
These all involve creating one document at a time.
About Required & Editable Fields
- When creating a new document, certain standard fields are required in all vaults. These are listed below with each request.
- Your Vault Admin may set additional standard or custom document fields to required in your vault.
- If a required field is not included in the request, Vault returns a
PARAMETER_REQUIRED
error with the name of the missing field.
To retrieve document fields in your vault:
- Use the Document Metadata API to retrieve all fields configured on documents. In the field specifications: Required fields:
required:true
/ Editable fields:editable:true
. - Use the Vault Loader Document Extract to retrieve fields and values configured on specific documents.
- Go to Admin > Configuration > Document Fields and find all fields marked "Required" and those which are editable. Learn more in Vault Help.
About Document Name Defaulting
- When creating new documents, the document
name__v
is a required standard field. - However, your Vault Admin may define a format for auto-populating the field's default value.
- When configured for document name defaulting, the
name__v
field is not required. - If the
name__v
field is provided through the API, the value overwrites the auto-generated default name. - Learn about Document Name Defaulting in Vault Help.
For example:
The table below describes the behavior when document name defaulting is not enabled.
file |
name__v |
Result |
---|---|---|
Storyboard_0725.docx | My Story Board 07-25 | The new document is created and named "My Story Board 07-25" |
Storyboard_0725.docx | The document is not created and an error is returned: "Missing required parameter name__v ". |
The table below describes the behavior when document name defaulting is enabled.
file |
name__v |
Key | Result |
---|---|---|---|
Storyboard_0725.docx | {filename} | The new document is created and named "Storyboard_0725". With document name defaulting on, the name__v field value is not required.The custom name key {filename} key tells Vault to use the name of the uploaded file as the document name. |
|
Storyboard_0725.docx | My Story Board 07-25 | {filename} | The new document is created and named "My Story Board 07-25". Even though the custom format says to use the filename, the user-defined name__v value overrides it. |
Where:
file
is the name of the file being used to create the document.name__v
is the user-defined name for the new document.- "Key" is the token entered into the "Use Custom Name" field section of the document type details.
About Default Document Field Values
Some document fields allow default values to be specified by Admin. When a field includes default values and the field is omitted from the request, the field is automatically populated with the value during document creation. When the field is included in the request, the field values specified in the input override the default values.
You can find out which field has a default by analyzing the defaultValue
metadata field on the document field.
For example:
{
"name": "region__c",
"type": "Picklist",
"required": false,
"editable": true,
"defaultValue": [
"North America"
],
"label": "Region",
"entryLabels": [
"North America",
"South America"
],...
}
Shown above are select portions of the region__c
document field metadata.
- The field is not required when creating a new document.
- The field is editable, meaning you can add or remove its values.
- The field has a default value. When a document is created, this field is automatically assigned the value "North America".
- The field can be assigned the alternate value "South America" by including it in the input when creating the document.
Create Document from Uploaded File
Most documents in your vault are created from uploaded source files, e.g., "mydocument.docx". Learn about Supported File Formats in Vault Help. Once uploaded with values assigned to document fields, Vault generates the viewable rendition, e.g., "mydocument.docx.pdf". Learn about Viewable Renditions in Vault Help.
Request
Send POST
to /api/{version}/objects/documents
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Required Standard Fields
When creating a new document, the following standard fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new document. |
type__v |
The name of the document type to assign to the new document. |
subtype__v |
The name of the document subtype (if one exists on the document type). |
classification__v |
The name of the document classification (if one exists on the document subtype). |
lifecycle__v |
The name of the document lifecycle to assign to the new document. |
major_version_number__v |
The major version number to assign to the new document. |
minor_version_number__v |
The minor version number to assign to the new document. |
Additional Required & Editable Fields
Admin may set other standard or custom document fields to required in your vault. Learn about Required Document Fields above. If a required field is not included, Vault returns a PARAMETER_REQUIRED
error with the name of the missing field. You may include name-value pairs for other optional, editable document fields and values. Learn about Editable Document Fields above.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=gludacta-document-01.docx" \
-F "name__v=Gludacta Document" \
-F "type__v=Promotional Piece" \
-F "subtype__v=Advertisement" \
-F "classification__v=Web" \
-F "lifecycle__v=Promotional Piece" \
-F "major_version_number__v=0" \
-F "minor_version_number__v=1" \
-F "product__v=0PR0303" \
-F "external_id__v=GLU-DOC-0773" \
https://myvault.veevavault.com/api/v14.0/objects/documents
This example includes:
- The
file
parameter with the name of the source file being used to create the new document. - All required fields (in our vault) to create a new document of the specified document type.
- The specified major and minor document version numbers will create this document as version 0.1.
- The optional (in our vault)
product__v
document field name with the product object record ID to assign to the new document. - The optional (in our vault)
external_id__v
document field with a document external ID to assign to the new document.
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "successfully created document",
"id": 773
}
On SUCCESS, the document is created and assigned a system-managed document id
field value.
History
Since v1
v7+ - Supports asynchronous metadata indexing.
v8+ - Supports suppress generation of viewable rendition.
Create Document from Template
Vault document templates allow quick creation of new documents from preconfigured templates in your vault. When you create the new document, Vault copies the template file and uses that copy as the source file for the new document. This process bypasses the content upload process and allows for more consistent document creation. Document templates are associated with a specific document type, like documents themselves. Learn about Document Templates in Vault Help.
Request
Send POST
to /api/{version}/objects/documents
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Select the Document Template
To indicate the template to apply, use the multi-part attachment with the file component "fromTemplate={template_name}"
. The template must exist in the vault.
Required Standard Fields
When creating a new document, the following standard fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new document. |
type__v |
The name of the document type to assign to the new document. |
subtype__v |
The name of the document subtype (if one exists on the document type). |
classification__v |
The name of the document classification (if one exists on the document subtype). |
lifecycle__v |
The name of the document lifecycle to assign to the new document. |
major_version_number__v |
The major version number to assign to the new document. |
minor_version_number__v |
The minor version number to assign to the new document. |
Additional Required & Editable Fields
Admin may set other standard or custom document fields to required in your vault. Learn about Required Document Fields above. If a required field is not included, Vault returns a PARAMETER_REQUIRED
error with the name of the missing field. You may include name-value pairs for other optional, editable document fields and values. Learn about Editable Document Fields above.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-d "fromTemplate=promo_doc_template__c" \
-d "name__v=Gludacta Document" \
-d "type__v=Promotional Piece" \
-d "subtype__v=Advertisement" \
-d "classification__v=Web" \
-d "lifecycle__v=Promotional Piece" \
-d "major_version_number__v=0" \
-d "minor_version_number__v=2" \
-d "product__v=0PR0303" \
-d "external_id__v=GLU-DOC-0774" \
https://myvault.veevavault.com/api/v14.0/objects/documents
This example includes:
- The
fromTemplate
parameter with the name of the template being used to create the new document. - All required fields (in our vault) to create a new document of the specified document type.
- The specified major and minor document version numbers will create this document as version 0.2.
- The optional (in our vault)
product__v
document field name with the product object record ID to assign to the new document. - The optional (in our vault)
external_id__v
document field with a document external ID to assign to the new document.
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "successfully created document",
"id": 774
}
On SUCCESS, the document is created and assigned a system-managed document id
field value.
History
Since v5
v7+ - Supports asynchronous metadata indexing.
v8+ - Supports suppress generation of viewable rendition.
Create Content Placeholder Document
You can create a content placeholder document when the associated source file is not yet available and then, add the source file at a later date. Creating a content placeholder document is just like creating a document from an uploaded file, but the file
parameter is not included in the request. Learn about Content Placeholders in Vault Help.
Request
Send POST
to /api/{version}/objects/documents
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Required Standard Fields
When creating a new document, the following standard fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new document. |
type__v |
The name of the document type to assign to the new document. |
subtype__v |
The name of the document subtype (if one exists on the document type). |
classification__v |
The name of the document classification (if one exists on the document subtype). |
lifecycle__v |
The name of the document lifecycle to assign to the new document. |
major_version_number__v |
The major version number to assign to the new document. |
minor_version_number__v |
The minor version number to assign to the new document. |
Additional Required & Editable Fields
Admin may set other standard or custom document fields to required in your vault. Learn about Required Document Fields above. If a required field is not included, Vault returns a PARAMETER_REQUIRED
error with the name of the missing field. You may include name-value pairs for other optional, editable document fields and values. Learn about Editable Document Fields above.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-d "name__v=Gludacta Document" \
-d "type__v=Promotional Piece" \
-d "subtype__v=Advertisement" \
-d "classification__v=Web" \
-d "lifecycle__v=Promotional Piece" \
-d "major_version_number__v=0" \
-d "minor_version_number__v=2" \
-d "product__v=0PR0303" \
-d "external_id__v=GLU-DOC-0775" \
https://myvault.veevavault.com/api/v14.0/objects/documents
This example includes:
- All required fields (in our vault) to create a new document of the specified document type.
- The specified major and minor document version numbers will create this document as version 0.2.
- The optional (in our vault)
product__v
document field name with the product object record ID to assign to the new document. - The optional (in our vault)
external_id__v
document field with a document external ID to assign to the new document.
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "successfully created document",
"id": 775
}
On SUCCESS, the document is created and assigned a system-managed document id
field value.
History
Since v1
v7+ - Supports asynchronous metadata indexing.
v8+ - Supports suppress generation of viewable rendition.
Create Unclassified Document
Unclassified documents are documents which have a source file, but no document type. Bypassing the steps to classify the document and populate document properties allows you to upload source files and create documents more quickly. Learn about Unclassified Documents in Vault Help.
Request
Send POST
to /api/{version}/objects/documents
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Required Standard Fields
When creating an unclassified document, the following standard fields are required in all vaults:
Field Name | Description |
---|---|
type__v |
Set the document type to "Undefined". |
lifecycle__v |
Set the document lifecycle to "Unclassified". |
In eTMF vaults, you can also (optionally) set the following fields:
product__v
study__v
study_country__v
site__v
Any other fields included in the input will be ignored. The document name (name__v
) will default to the name of the uploaded file.
Example (All vaults)
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap Information.docx" \
-F "type__v=Undefined" \
-F "lifecycle__v=Unclassified" \
https://myvault.veevavault.com/api/v15.0/objects/documents
Example (eTMF vaults)
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap Information.docx" \
-F "type__v=Undefined" \
-F "lifecycle__v=Unclassified" \
-F "product__v=00P000000000101" \
-F "study__v=0ST000000000501" \
-F "study_country__v=0SC000000000401" \
-F "site__v=0SI000000000301" \
https://myvault.veevavault.com/api/v15.0/objects/documents
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "successfully created document",
"id": 776
}
On SUCCESS, the new unclassified document is created and assigned a document id
.
History
Since v1
v7+ - Supports asynchronous metadata indexing.
v8+ - Supports suppress generation of viewable rendition.
Create CrossLink Document
CrossLink documents enable content from one vault to be used in another vault within the same domain. A CrossLink document in your vault uses the viewable rendition from a source document in another [source] vault, with different fields, lifecycle, and workflows. When creating a CrossLink document, you must include all document fields that are required for the specified document type/subtype/classification and no file is uploaded. You must also specify the vault ID and document ID for the source document which will be bound to the new CrossLink document. Learn about CrossLinks in Vault Help.
Request
Send POST
to /api/{version}/objects/documents
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Required Standard Fields
When creating a new CrossLink document, the following standard fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new CrossLink document. |
type__v |
The name of the document type to assign to the new CrossLink document. |
subtype__v |
The name of the document subtype (if one exists on the document type). |
classification__v |
The name of the document classification (if one exists on the document subtype). |
lifecycle__v |
The name of the document lifecycle to assign to the new CrossLink document. |
major_version_number__v |
The major version number to assign to the new CrossLink document |
minor_version_number__v |
The minor version number to assign to the new CrossLink document. |
source_vault_id__v |
The vault id field value of the vault containing the source document that will be bound to the new CrossLink document. Learn more. |
source_document_id__v |
The document id field value of the source document that will be bound to the new CrossLink document. |
Optional Standard Fields
When creating a new CrossLink document, the following standard fields referencing the source document are optional:
Field Name | Description |
---|---|
source_binding_rule__v |
Possible values: Latest version , Latest Steady State version , or Specific Document version . These define which version of the source document will be bound to the CrossLink document. If not specified, this defaults to the Latest Steady State version . |
bound_source_major_version__v |
When the source_binding_rule__v is set to Specific Document version , you must specify the major version number of the source document to bind to the CrossLink document. |
bound_source_minor_version__v |
When the source_binding_rule__v is set to Specific Document version , you must specify the minor version number of the source document to bind to the CrossLink document. |
Additional Required & Editable Fields
Admin may set other standard or custom document fields to required in your vault. Learn about Required Document Fields above. If a required field is not included, Vault returns a PARAMETER_REQUIRED
error with the name of the missing field. You may include name-value pairs for other optional, editable document fields and values. Learn about Editable Document Fields above.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-d "name__v=Gludacta Document" \
-d "type__v=Promotional Piece" \
-d "subtype__v=Advertisement" \
-d "classification__v=Web" \
-d "lifecycle__v=Promotional Piece" \
-d "major_version_number__v=0" \
-d "minor_version_number__v=1" \
-d "source_vault_id__v=2112" \
-d "source_document_id__v=101" \
-d "source_binding_rule__v=Specific Document version" \
-d "bound_source_major_version__v=1" \
-d "bound_source_major_version__v=3" \
-d "product__v=0PR0303" \
-d "external_id__v=GLU-DOC-0777" \
https://myvault.veevavault.com/api/v14.0/objects/documents
This example includes:
- All required fields (in our vault) to create a new document of the specified document type.
- The specified major and minor document version numbers will create this CrossLink document as version 0.1.
- The ID of the source vault and source document which will be bound to the CrossLink document in our vault.
- The binding rule specifying that the new CrossLink document will be statically bound to version 1.3 of the source document.
- The optional (in our vault)
product__v
document field name with the product object record ID to assign to the new CrossLink document. - The optional (in our vault)
external_id__v
document field with a document external ID to assign to the new CrossLink document.
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "successfully created document",
"id": 775
}
On SUCCESS, the document is created and assigned a system-managed document id
field value.
History
Since v10
Create Multiple Documents
This endpoint allows you to create multiple documents at once with a CSV input file.
- The maximum CSV input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
POST /api/{version}/objects/documents/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv |
Accept |
application/json (default) or text/csv |
Body Parameters
Prepare a CSV input file. There are multiple ways to create documents in bulk. The following shows the required standard fields needed to create documents, but an Admin may set other standard or custom document fields as required in your vault. To find which fields are required, retrieve document fields. You can also optionally include any editable document field.
Request
$ 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
Response
{
"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."
}
]
}
]
}
Update Documents
Update Single Document
Update editable field values on the latest version of a single document. To update past document versions, see Update Document Version.
PUT /api/{version}/objects/documents/{doc_id}
Headers
Name | Description |
---|---|
Content-Type |
application/x-www-form-urlencoded |
Accept |
application/json (default) or application/xml |
URI Path Parameters
Name | Description |
---|---|
{doc_id} |
The document id field value. |
Body Parameters
In the body of the request, add any editable field values that you wish to update. To find these fields, retrieve 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.
Example Request
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-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/v15.0/objects/documents/534
Example Response
{
"responseStatus": "SUCCESS",
"id": 534
}
Update Multiple Documents
Bulk update editable field values on multiple documents. You can only update the latest version of each document. To update past document versions, see Update Document Version.
- The maximum CSV input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 1,000.
PUT /api/{version}/objects/documents/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv or application/x-www-form-urlencoded |
Accept |
application/json (default) or text/csv |
Body Parameters
You can use Name-Value pairs in the body of your request or you can upload a CSV. id
is the only required field, and you can update values of any editable document field. To find these fields, retrieve 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.
Name | Description |
---|---|
id |
ID of the document to update |
Example Request
$ 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
Example Response
{
"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"
}
]
}
Reclassify Document
Reclassify allows you to change the document type of an existing document or assign a document type to an existing unclassified document. A document "type" is the combination of the type__v
, subtype__v
, and classification__v
fields on a document. When you reclassify, Vault may add or remove certain fields on the document. You can only reclassify the latest version of a document and only one document at a time. The API does not currently support Bulk Reclassify.
Learn more about:
- Vault Help: Reclassifying Documents.
- API: Retrieve Documents
- API: Retrieve Document Fields
- API: Retrieve Document Types, Subtypes, and Classifications
- API: Create Unclassified Documents
Request
Send PUT
to /api/{version}/objects/documents/{document_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Input
Field Name | Description |
---|---|
reclassify |
Set to true . Without this, a standard document update action is performed. |
type__v |
The name of the document type. |
subtype__v |
The name of the document subtype (if one exists on the type). |
classification__v |
The name of the document classification (if one exists on the subtype). |
lifecycle__v |
The name of the document lifecycle. |
You can also add or remove values for any other editable document field. Note that additional fields may be required depending on the document type, subtype, and classification being assigned to the document. Use the Document Metadata API to retrieve required and editable fields in your vault. If a required field is missing, the error response will list the name of the required field.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "reclassify=true" \
-d "type__v=Promotional Piece" \
-d "subtype=Advertisement" \
-d "classification__v=Web" \
-d "lifecycle__v=Promotional Piece" \
https://myvault.veevavault.com/api/v14.0/objects/documents/775
Response
{
"responseStatus": "SUCCESS",
"id": 775
}
History
Since v8
Update Document Version
Update editable field values on a specific version of a document. See also Update Document above.
Request
Send PUT
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-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/v14.0/objects/documents/534/versions/2/0
Response
{
"responseStatus": "SUCCESS",
"id": 534
}
On SUCCESS, Vault updates field values for the specified version of the document and returns the ID of the updated document.
History
Since v1
Create Multiple Document Versions
Create or add document versions in bulk.
- Your vault must be in Migration Mode.
- The maximum CSV input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
POST /api/{version}/objects/documents/versions/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv |
Accept |
application/json (default) or text/csv |
Body Parameters
Name | Description |
---|---|
file |
The filepath of your source file. If the current version of the document includes a source file, you must include a source file for any past versions. The maximum allowed file size is 4GB. |
id |
The system-assigned document ID of the document to delete. |
external_id__v |
Optional: Instead of id , you can use this user-defined document external ID. |
name__v |
Enter a name for the new document. This may be the same name as the existing document/version or a different name. |
type__v |
Enter the name of the document type to assign to the new document. |
subtype__v |
Enter the name of the document subtype (if one exists on the document type). |
classification__v |
Enter the name of the document classification (if one exists on the document subtype). |
lifecycle__v |
Enter the name of the document lifecycle to assign to the new document. This may be the same lifecycle as the existing document/version or a different lifecycle. |
major_version_number__v |
Enter the major version number to assign to the new document version. This must be a version that does not yet exist on the document being updated. |
minor_version_number__v |
Enter the minor version number to assign to the new document. This must be a version that does not yet exist on the document being updated. |
status__v |
Enter a status for the new document, e.g., Draft, In Review, Approved, etc. |
product__v |
Example: This is an example object reference field. To assign value for this field type, include either the document field name product__v or the document field name plus the name field on the object product__v.name__v . |
Query String Parameters
Name | Description |
---|---|
idParam |
If you're identifying documents in your input by their external ID, add idParam=external_id__v to the request endpoint. |
Request
$ 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
Response
{
"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."
}
]
}
]
}
Create Single Document Version
Create a new draft version of an existing document or create a new draft version by uploading and replacing the document source file. Both of these actions will increase the document by a minor version number.
Request
Send POST
to /api/{version}/objects/documents/{document_id}
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Options
To create a new draft version from the existing document in the vault, include createDraft=latestContent
in the input as shown in Example 1 below. This does not require uploading a file. For example, you want to create version 0.2 from the existing version 0.1. This is analogous to using the Create Draft action in the UI.
To create a new draft version by uploading and replacing the document source file, include the createDraft=uploadedContent
in the input as shown in Example 2 below. This requires uploading a new source file. To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB. For example, you want to create version 0.2 but do not want to use the existing version 0.1. This is analogous to using the Upload New Version action in the UI.
With either of the above options, you may suppress automatic generation of the viewable rendition by adding the suppressRendition=true
query parameter to the request endpoint. This is shown in Example 3 below.
Example 1
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "createDraft=latestContent" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534
Example 2
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Presentation.pptx" \
-F "createDraft=uploadedContent" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534
Example 3
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Presentation.pptx" \
-F "createDraft=uploadedContent" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534?suppressRendition=true
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "New draft successfully created.",
"major_version_number__v": 0,
"minor_version_number__v": 2
}
History
Since v7
v8+ - Supports suppress generation of viewable rendition
Delete Documents
The API allows you to delete all versions of a document or a specific version. This can also be done in bulk using the Bulk Documents API or Vault Loader (UI). After documents are deleted, the API allows you to retrieve their IDs for up to 30 days. The deleted files themselves are removed from the server and can only be retrieved by Vault Support.
Delete Single Document
Delete all versions of a document, including all source files and viewable renditions.
DELETE /api/{version}/objects/documents/{document_id}
Headers
Name | Description |
---|---|
Accept |
application/json (default) or application/xml |
URI Path Parameters
Name | Description |
---|---|
document_id |
The system-assigned document ID of the document to delete. |
Request
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534
Response
{
"responseStatus": "SUCCESS",
"id": 534
}
Delete Multiple Documents
Delete all versions of a document, including all source files and viewable renditions.
- The maximum input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
DELETE /api/{version}/objects/documents/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv or application/json |
Accept |
application/json (default) or text/csv |
Body Parameters
Create a CSV or JSON input file. Choose one of the following two ways to identify documents for deletion:
Name | Description |
---|---|
id |
The system-assigned document ID of the document to delete. |
external_id__v |
Optional: Instead of id , you can use this user-defined document external ID. |
Query String Parameters
Name | Description |
---|---|
idParam |
If you're identifying documents in your input by their external ID, add idParam=external_id__v to the request endpoint. |
Request
$ 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
Response
{
"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."
}
]
}
]
}
Delete Single Document Version
Request
Delete a specific version of a document, including the version's source file and viewable rendition. Other versions of the document remain unchanged. See also Delete Document.
DELETE /api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}
Headers
Name | Description |
---|---|
Accept |
application/json (default) or text/csv |
URI Path Parameters
Name | Description |
---|---|
{doc_id} |
The document id field value. |
{major_version} |
The document major_version_number__v field value. |
{minor_version} |
The document minor_version_number__v field value. |
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534/versions/0/2
Response
{
"responseStatus": "SUCCESS",
"id": 534
}
Delete Multiple Document Versions
Delete a specific version from multiple documents, including the version's source file and viewable rendition.
- The maximum input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
DELETE /api/{version}/objects/documents/versions/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv or application/json |
Accept |
application/json (default) or text/csv |
Body Parameters
Create a CSV or JSON input file.
Name | Description |
---|---|
id |
The system-assigned document ID of the document to delete. |
external_id__v |
Optional: Instead of id , you can use this user-defined document external ID. |
major_version_number__v |
Major version number of the document version to remove. |
minor_version_number__v |
Minor version number of the document version to remove. |
Query String Parameters
Name | Description |
---|---|
idParam |
If you're identifying documents in your input by their external ID, add idParam=external_id__v to the request endpoint. |
Request
$ 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
Response
{
"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."
}
]
}
]
}
Retrieve Deleted Documents
Retrieve the IDs of documents that have been deleted from a vault within the past 30 days.
After documents and document versions are deleted from a vault, their IDs are still available for retrieval for 30 days. After that, they cannot be retrieved. This request supports optional parameters to narrow the results to a specific date and time range within the past 30 days.
Request
Send GET
to /api/{version}/objects/deletions/documents
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
or CSV text/csv
Options
You can modify the request by using one or both of the following parameters:
start_date
- [Optional] Specify a date (no more than 30 days past) after which Vault will look for deleted documents.end_date
- [Optional] Specify a date (no more than 30 days past) before which Vault will look for deleted documents.
For example, assuming today is January 20:
- To retrieve all documents deleted since 7AM on January 15:
api/v14.0/objects/deletions/documents?start_date=2016-01-16T07:00:00Z
- To retrieve all documents deleted between 7AM - 5PM on January 15:
api/v14.0/objects/deletions/documents?start_date=2016-01-16T07:00:00Z&end_date=2016-01-16T17:00:00Z
About dates and times:
- Dates and times are in UTC and must be formatted as
YYYY-MM-DDTHH:MM:SSZ
. - If the time is not specified, it will default to midnight (T00:00:00Z) on the specified date.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/deletions/documents
Response (abridged)
{
"responseStatus": "SUCCESS",
"responseMessage": "OK",
"responseDetails": {
"limit": 1000,
"size": 88,
"offset": 0,
"total": 88
},
"data": [
{
"id": 690,
"major_version_number__v": 0,
"minor_version_number__v": 1,
"date_deleted": "2016-02-10T00:29:45Z"
},
{
"id": 690,
"major_version_number__v": 0,
"minor_version_number__v": 2,
"date_deleted": "2016-02-10T00:29:45Z"
},
{
"id": 691,
"major_version_number__v": 0,
"minor_version_number__v": 1,
"date_deleted": "2016-02-10T23:46:07Z"
},
{
"id": 692,
"major_version_number__v": 0,
"minor_version_number__v": 1,
"date_deleted": "2016-02-10T00:29:37Z"
},
...
Details
The abridged response shows that a total of 88 documents were deleted from this vault in the past 30 days. Document ID 690 had two versions (0.1 and 0.2) which were deleted. Document IDs 691 and 692 each has their 0.1 versions deleted. The response includes the date and time when each document was deleted. This is displayed in UTC, not in the user's time zone.
History
Since v13
Document Locks
A document "lock" is analogous to "checking out a document" but without the file attached in the response for download. To download the document file after locking it, use the Download Document File endpoint.
Learn about Document Checkout (Locks) in Vault Help.
Retrieve Document Lock Metadata
Request
Send GET
to /api/{version}/metadata/objects/documents/lock
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/lock
Response
{
"responseStatus": "SUCCESS",
"name": "lock",
"properties": [
{
"name": "locked_by__v",
"scope": "Lock",
"type": "ObjectReference",
"required": true,
"systemAttribute": true,
"editable": false,
"setOnCreateOnly": false,
"disabled": false,
"objectType": "User",
"label": "Locked By",
"hidden": false
},
{
"name": "locked_date__v",
"scope": "Lock",
"type": "DateTime",
"required": true,
"systemAttribute": true,
"editable": false,
"setOnCreateOnly": false,
"disabled": false,
"objectType": "DateTime",
"label": "Locked Date",
"hidden": false
}
]
}
Details
Metadata Field | Description |
---|---|
name |
The "name" of the field used in the API. These include locked_by__v , locked_date__v , etc. |
label |
The "label" of the field used in the UI. These include "Locked By", "Locked Date", etc. |
type |
The "type" of field. These include "ObjectReference", "DateTime", etc. |
scope |
The "scope" of the field. This value is "Lock" for all fields. |
required |
Indicates if the field is required. |
systemAttribute |
Boolean (true/false) field which indicates if the field is a standard (system-managed) field, i.e., not editable by the user. |
editable |
Boolean (true/false) field which indicates if the field can be set or changed by the user, i.e., not system-managed. |
setOnCreateOnly |
Boolean (true/false) field which indicates if the field can only be set during creation of a new document. |
objectType |
When the field type is "ObjectReference", this field indicates the object which is being referenced. |
hidden |
Boolean (true/false) field which indicates if the field is "hidden" (not available). |
History
Since v1
v6 - Changes to metadata property names.
Create Document Lock
A document lock is analogous to checking out a document but without the file attached in the response for download. To download the document file after locking it, use the Download Document File endpoint.
Request
Send POST
to /api/{version}/objects/documents/{document_id}/lock
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/lock
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Document successfully checked out."
}
On SUCCESS, Vault locks the document and other users are not allowed to lock (check-out) the document.
History
Since v1
Retrieve Document Lock
Request
Send GET
to /api/{version}/objects/documents/{document_id}/lock
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/lock
Response
{
"responseStatus": "SUCCESS",
"lock": {
"locked_by__v": 46916,
"locked_date__v": "2015-03-20T23:47:11.000Z"
}
}
Details
If the document is locked (checked out), the response includes the user id
field value of the person who checked it out and the date and time. If the document is not locked, the lock fields shown above will not be returned.
History
Since v1
Delete Document Lock
Deleting a document lock is analogous to undoing check out of a document.
Request
You can delete the document lock by sending a DELETE
request to the /api/{version}/objects/documents/{document_id}/lock
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/lock
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Undo check out successful."
}
On SUCCESS, Vault unlocks the document, allowing other users to lock/check out the document.
History
Since v1
Document Renditions
Learn about Document Renditions in Vault Help.
Retrieve Document Renditions
Request
Send GET
to /api/{version}/objects/documents/{document_id}/renditions
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions
Response
{
"responseStatus": "SUCCESS",
"renditionTypes": [
"viewable_rendition__v",
"imported_rendition__vs",
"veeva_distribution_package__vs"
],
"renditions": {
"viewable_rendition__v": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/viewable_rendition__v",
"veeva_distribution_package__vs": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/veeva_distribution_package__vs"
}
}
Details
Metadata Field | Description |
---|---|
renditionTypes[n] |
List of all rendition types configured for the specified document. |
renditions[n] |
List of renditions available for the specified document and the endpoint URL to retrieve them. |
History
Since v1
Retrieve Document Version Renditions
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/renditions
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions
Response
{
"responseStatus": "SUCCESS",
"renditionTypes": [
"viewable_rendition__v",
"imported_rendition__vs",
"veeva_distribution_package__vs"
],
"renditions": {
"viewable_rendition__v": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/viewable_rendition__v",
"veeva_distribution_package__vs": "https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/veeva_distribution_package__vs"
}
}
History
Since v7
Download Document Rendition File
Download a rendition (file) from the latest version of a document.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/renditions/{rendition_type}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
{rendition_type}
- The document rendition type.
Options
/api/{version}/objects/documents/{document_id}/renditions/{rendition_type}?steadyState=true
Download a rendition (file) from the latest steady state version (1.0, 2.0, etc.) of a document.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/viewable_rendition__v > file
Response
{
"responseStatus": "SUCCESS"
}
Details
On SUCCESS, Vault retrieves the file associated with the given renditions type for the document.
The HTTP Response Header Content-Type
is set to application/octet-stream
.
History
Since v1
v6+ - Supports the steadyState
request parameter.
Download Document Version Rendition File
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/renditions/{rendition_type}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{rendition_type}
- The document rendition type.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/viewable_rendition__v > file
Response
{
"responseStatus": "SUCCESS"
}
Details
On SUCCESS, Vault retrieves the file associated with the given renditions type for the specified document version.
The HTTP Response Header Content-Type
is set to application/octet-stream
.
History
Since v7
<
Add Multiple Document Renditions
Add document renditions in bulk.
- Your vault must be in Migration Mode.
- The maximum CSV input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
POST /api/{version}/objects/documents/renditions/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv |
Accept |
application/json (default) or text/csv |
Body Parameters
Name | Description |
---|---|
file |
The file path of your source files. |
id |
The system-assigned document ID of the document to delete. |
external_id__v |
Optional: Instead of id , you can use this user-defined document external ID. |
rendition_type__v |
Document rendition type to assign to the new rendition. Only one rendition of each type may exist on each document. |
major_version_number__v |
Major version number to assign to the new document rendition. |
minor_version_number__v |
Minor version number to assign to the new document rendition. |
Query String Parameters
Name | Description |
---|---|
idParam |
If you're identifying documents in your input by their external ID, add idParam=external_id__v to the request endpoint. |
Request
$ 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
Response
{
"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__c": "imported_rendition__c"
},
{
"responseStatus": "SUCCESS",
"id": 772,
"external_id__v": "CHO-DOC-0772",
"major_version_number__v": 0,
"minor_version_number__v": 2,
"rendition_type__c": "imported_rendition__c"
},
{
"responseStatus": "SUCCESS",
"id": 773,
"external_id__v": "GLU-DOC-0773",
"major_version_number__v": 1,
"minor_version_number__v": 0,
"rendition_type__c": "imported_rendition__c"
},
{
"responseStatus": "FAILURE",
"errors": [
{
"type": "INVALID_DATA",
"message": "Error message describing why this document rendition was not added."
}
]
}
]
}
Add Single Document Rendition
POST /api/{version}/objects/documents/{doc_id}/renditions/{rendition_type}
Headers
Name | Description |
---|---|
Content-Type |
application/json or multipart/form-data |
Accept |
application/json (default) or application/xml |
URI Path Parameters
Name | Description |
---|---|
{doc_id} |
The document id field value. |
{rendition_type} |
The document rendition type. |
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Request
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Document.pdf" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534/renditions/imported_rendition__c
Response
{
"responseStatus": "SUCCESS"
}
Response Details
On SUCCESS, Vault associates the uploaded file with the given rendition type for the specified document.
Upload Document Version Rendition
Request
Send POST
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/renditions/{rendition_type}
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{rendition_type}
- The document rendition type.
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Document.pdf" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/imported_rendition__vs
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault associates the uploaded file with the given rendition type for the document with the specified version number.
History
Since v7
Replace Document Rendition
Request
Send PUT
to /api/{version}/objects/documents/{document_id}/renditions/{rendition_type}
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{rendition_type}
- The document rendition type.
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Document.pdf" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/renditions/imported_rendition__vs
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault replaces the rendition of the given type from the latest version of the document.
History
Since v7
Replace Document Version Rendition
Request
Send PUT
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/renditions/{rendition_type}
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{rendition_type}
- The document rendition type.
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=CholeCap-Document.pdf" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/imported_rendition__vs
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault replaces the rendition of the given type for the specified version of the document.
History
Since v7
Delete Multiple Document Renditions
Delete document renditions in bulk.
- The maximum input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard format.
- The maximum batch size is 500.
DELETE /api/{version}/objects/documents/renditions/batch
Headers
Name | Description |
---|---|
Content-Type |
text/csv or application/json |
Accept |
application/json (default) or text/csv |
Body Parameters
Create a CSV or JSON input file.
Name | Description |
---|---|
id |
The system-assigned document ID of the document to delete. |
external_id__v |
Optional: Instead of id , you can use this user-defined document external ID. |
rendition_type__v |
Rendition type to delete from the document. |
rendition_type__v |
Document rendition type to delete from the document. |
major_version_number__v |
Major version number of the document rendition to remove. |
minor_version_number__v |
Minor version number of the document rendition to remove. |
Query String Parameters
Name | Description |
---|---|
idParam |
If you're identifying documents in your input by their external ID, add idParam=external_id__v to the request endpoint. |
Request
$ 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
Response
{
"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__c": "imported_rendition__c"
},
{
"responseStatus": "SUCCESS",
"id": 772,
"external_id__v": "CHO-DOC-0772",
"major_version_number__v": 0,
"minor_version_number__v": 2,
"rendition_type__c": "imported_rendition__c"
},
{
"responseStatus": "SUCCESS",
"id": 773,
"external_id__v": "GLU-DOC-0773",
"major_version_number__v": 1,
"minor_version_number__v": 0,
"rendition_type__c": "imported_rendition__c"
},
{
"responseStatus": "FAILURE",
"errors": [
{
"type": "INVALID_DATA",
"message": "Error message describing why this document rendition was not added."
}
]
}
]
}
Delete Single Document Rendition
On SUCCESS, Vault deletes the rendition of specified type from the latest document version.
DELETE /api/{version}/objects/documents/{document_id}/renditions/{rendition_type}
Headers
Name | Description |
---|---|
Accept |
application/json (default) or application/xml |
URI Path Parameters
Name | Description |
---|---|
{document_id} - The document id field value. |
|
{rendition_type} - The document rendition type. |
Request
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v15.0/objects/documents/534/renditions/imported_rendition__vs
Response
{
"responseStatus": "SUCCESS"
}
Delete Document Version Rendition
Request
Send DELETE
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/renditions/{rendition_type}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{rendition_type}
- The document rendition type.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/renditions/imported_rendition__vs
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault deletes the rendition of the given type from the specified version of the document.
History
Since v1
Document Attachments
Learn about Document Attachments in Vault Help.
Determine if a Document has Attachments
Request
Send GET
to /api/{version}/objects/documents/{document_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565
Response (abridged)
{
...
"attachments": [
{
"id": 566,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566"
},
{
"id": 567,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/567"
}
]
}
Shown above, document id
565 has two different attachments: id
566 and id
567. Note that this endpoint does not retrieve the number of versions of each attachment nor the attachment metadata. The "attachments" attribute is displayed in the response for documents in which attachments have been enabled on the document type (even if the document has no attachments).
History
Since v12
List Document Attachments
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"id": 566,
"filename__v": "Site Area Map.png",
"format__v": "image/png",
"size__v": 109828,
"md5checksum__v": "78b36d9602530e12051429e62558d581",
"version__v": 2,
"created_by__v": 46916,
"created_date__v": "2015-01-14T00:35:01.775Z",
"versions": [
{
"version__v": 1,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/1"
},
{
"version__v": 2,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/2"
}
]
},
{
"id": 567,
"filename__v": "Site Facilities Contacts.docx",
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size__v": 11483,
"md5checksum__v": "bddd2e18f40dd09ab4939ddd2acefeac",
"version__v": 3,
"created_by__v": 46916,
"created_date__v": "2015-01-14T00:35:12.320Z",
"versions": [
{
"version__v": 1,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/567/versions/1"
},
{
"version__v": 2,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/567/versions/2"
},
{
"version__v": 3,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/567/versions/3"
}
]
}
]
}
Details
Shown above, document id
565 has two different attachments. Attachment id
566 is an image file with two versions. Attachment id
567 is a Word document with three versions. Unlike "regular" document versioning, attachment versioning uses integer numbers beginning with 1 and incrementing sequentially (1, 2, 3,...). There is no concept of major or minor version numbers with attachments.
History
Since v12
Retrieve Document Attachment Metadata
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/566
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"id": 566,
"filename__v": "Site Area Map.png",
"format__v": "image/png",
"size__v": 109828,
"md5checksum__v": "78b36d9602530e12051429e62558d581",
"version__v": 2,
"created_by__v": 46916,
"created_date__v": "2015-01-14T00:35:01.775Z",
"versions": [
{
"version__v": 1,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/1"
},
{
"version__v": 2,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/2"
}
]
}
]
}
Details
The md5checksum__v
field is calculated on the latest version of the attachment. If an attachment is added which has the same MD5 checksum value as an existing attachment on a given document, the new attachment is not added.
Vault Document Attachments include the following fields (metadata):
Field Name | Description |
---|---|
id |
ID of the attachment. This is set by the system. |
version__v |
Version of the attachment. Attachment versioning uses integer numbers beginning with 1 and incrementing sequentially (1, 2, 3,...). There is no concept of major or minor version numbers with attachments. |
filename__v |
File name of the attachment. |
description__v |
Optional description added to the attachment. You can add descriptions up to 1000 characters in length. |
format__v |
File format of the attachment. You can add any type of file as an attachment. |
size__v |
File size of the attachment. You can add up to 50 attachments to a document; each must be under 2GB. |
md5checksum__v |
MD5 checksum value calculated for the attachment. To avoid creating identical versions, Vault assigns each a checksum value. When you add an attachment with the same file name and checksum value, Vault ignores the new file and does not version the existing attachment. |
created_by__v |
User ID of the person who created the attachment. |
created_date__v |
Date the attachment was created. |
versions[n] |
List of links to earlier versions of the attachment. |
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to retrieve attachments from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to retrieve metadata from an attachment {id} which does not exist on the specified document. |
History
Since v12
List Document Attachment Versions
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/versions
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/566/versions
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"version__v": 1,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/1"
},
{
"version__v": 2,
"url": "https://myvault.vaultdev.com/api/v14.0/objects/documents/565/attachments/566/versions/2"
}
]
}
Details
Unlike documents, attachment versions use integer values starting with version 1 and incrementing sequentially (2, 3, 4,...). Attachments do not use major or minor version numbers.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to retrieve attachments from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to retrieve metadata from an attachment {id} which does not exist on the specified document. |
MALFORMED_URL |
The resource [{id}/versions/{version}] does not exist. | You are trying to retrieve metadata from a specific version {version} of an attachment {id} which does not exist on the specified document. The attachment {id} exists but the version number {version} does not. |
History
Since v12
Retrieve Document Attachment Version Metadata
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/versions/{attachment_version}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
{attachment_version}
- The attachment version__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/566/versions/2
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"id": 566,
"filename__v": "Site Area Map.png",
"format__v": "image/png",
"size__v": 109828,
"md5checksum__v": "78b36d9602530e12051429e62558d581",
"version__v": 2,
"created_by__v": 46916,
"created_date__v": "2015-01-14T00:35:01.775Z"
}
]
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. You are trying to retrieve attachments from a document {id} which does not exist. | |
MALFORMED_URL |
The resource [{id}] does not exist. You are trying to retrieve metadata from an attachment {id} which does not exist on the specified document. | |
MALFORMED_URL |
The resource [{id}/versions/{version}] does not exist. You are trying to retrieve metadata from a specific version {version} of an attachment {id} which does not exist on the specified document. The attachment {id} exists but the version number {version} does not. |
History
Since v12
Download Document Attachment File
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/567/file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="file.pdf"
Details
On SUCCESS, Vault retrieves the latest version of the attachment from the document. The file name is the same as the attachment file name.
The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file. When retrieving attachments with very small file size, the HTTP Response Header Content-Length
is set to the size of the attachment. Note that for most attachment downloads (larger file sizes), the Transfer-Encoding
method is set to chunked
and the Content-Length
is not displayed.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to retrieve an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to retrieve an attachment {id} which does not exist on the specified document. |
MALFORMED_URL |
The resource does not contain attachments. | You are trying to retrieve an attachment from a document which does not have any attachments. |
History
Since v12
Download Document Attachment Version File
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/versions/{attachment_version}/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
{attachment_version}
- The attachment version__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/567/versions/1/file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="file.pdf"
Details
On SUCCESS, Vault retrieves the specified version of the attachment from the document. The file name is the same as the attachment file name.
The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file.
When downloading attachments with very small file size, the HTTP Response Header Content-Length
is set to the size of the attachment. Note that for most attachment downloads (larger file sizes), the Transfer-Encoding
method is set to chunked
and the Content-Length
is not displayed.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to retrieve an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to retrieve an attachment {id} which does not exist on the specified document. |
MALFORMED_URL |
The resource [{id}/versions/{version}] does not exist. | You are trying to retrieve a specific version {version} of an attachment {id} which does not exist on the specified document. The attachment {id} exists but the version number {version} does not. |
MALFORMED_URL |
The resource does not contain attachments. | You are trying to retrieve an attachment from a document which does not have any attachments. |
History
Since v12
Download All Document Attachment Files
Request
Send GET
to /api/{version}/objects/documents/{document_id}/attachments/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="Document VV-02839 (v0.1) - attachments.zip"
On SUCCESS, Vault retrieves the latest version of all attachments from the document. The attachments are packaged in a ZIP file with the file name: Document {document number} (v. {major version}.{minor version}) - attachments.zip.
The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file.
When downloading attachments with very small file size, the HTTP Response Header Content-Length
is set to the size of the attachment. Note that for most attachment downloads (larger file sizes), the Transfer-Encoding
method is set to chunked
and the Content-Length
is not displayed.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to retrieve an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource does not contain attachments. | You are trying to retrieve attachments from a document which does not have any attachments. |
History
Since v12
Delete Document Attachment
Request
Send DELETE
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/567
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault deletes the specific attachment and all its versions.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to delete an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to delete an attachment {id} which does not exist on the specified document. |
History
Since v12
Delete Document Attachment Version
Request
Send DELETE
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/versions/{attachment_version}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
{attachment_version}
- The attachment version__v
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/567/versions/3
Response
{
"responseStatus": "SUCCESS"
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to delete an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to delete an attachment {id} which does not exist on the specified document. |
History
Since v12
Add Document Attachment
Request
Send POST
to /api/{version}/objects/documents/{document_id}/attachments
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 2GB.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=my_attachment_file.png" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments
Response
{
"responseStatus": "SUCCESS",
"data":
{
"id": "567",
"version__v": 3
}
}
Details
On SUCCESS, the response will contain the attachment ID and version of the newly added attachment. Document attachments are automatically bound to all versions of a document. The following attribute values are determined based on the file in the request: filename__v
, format__v
, size__v
.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to add an attachment from a document {id} which does not exist. |
MALFORMED_URL |
The resource is not enabled for attachments. | You are trying to add an attachment to a document for which attachments have not been enabled. |
OPERATION_NOT_ALLOWED |
Cannot add an attachment : number of allowed attachments exceeds max [50]. | You are trying to add an attachment to a document which already has the maximum number of allowed attachments (50). |
OPERATION_NOT_ALLOWED |
Cannot add an attachment : maximum attachment file size exceeds max [{n}]. | You are trying to add an attachment to a document which exceeds the maximum file size allowed for an attachment (2GB). |
History
Since v12
Restore Document Attachment Version
Request
Send POST
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}/versions/{attachment_version}?restore=true
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
{attachment_version}
- The attachment version__v
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments/567/versions/2?restore=true
The parameter restore
must be set to true
Response
{
"responseStatus": "SUCCESS",
"data":
{
"id": "567",
"version__v": 3
}
}
On SUCCESS, Vault restores the specific version of an existing attachment to make it the latest version. The response will contain the attachment ID and version of the restored attachment.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to restore an attachment to a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to restore an attachment {id} which does not exist on the specified document. |
MALFORMED_URL |
The resource [{id}/versions/{version}] does not exist. | You are trying to restore a specific version {version} of an attachment {id} to make it the latest version, but the attachment or version do not exist. |
PARAMETER_REQUIRED |
Missing required parameter [restore]. | You are trying to restore a specific version of an attachment but did not include the "restore" parameter. |
MALFORMED_URL |
The resource is not enabled for attachments. | You are trying to restore an attachment to a document for which attachments have not been enabled. |
History
Since v12
Update Document Attachment Description
Request
Send PUT
to /api/{version}/objects/documents/{document_id}/attachments/{attachment_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{attachment_id}
- The attachment id
field value.
Input
description__v
- This is the only editable field. The maximum character length is 1000.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "description__v=This is my description for this attachment." \
https://myvault.veevavault.com/api/v14.0/objects/documents/565/attachments
Response
{
"responseStatus": "SUCCESS"
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DOCUMENT |
Document not found {id}. | You are trying to update an attachment on a document {id} which does not exist. |
MALFORMED_URL |
The resource [{id}] does not exist. | You are trying to update an attachment {id} which does not exist on the specified document. |
MALFORMED_URL |
The resource is not enabled for attachments. | You are trying to add or restore an attachment to a document for which attachments have not been enabled. |
INVALID_DATA |
Invalid value [{value}] specified for parameter [description__v] : string exceeds max length [1000]. | You are trying to update the attachment description when the description exceeds the maximum character length (1000) |
History
Since v12
Document Annotations
Learn about Document Annotations in Vault Help.
Retrieve Document Annotations
Request
Send GET
to /api/{version}/objects/documents/{document_id}/annotations
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/14/annotations
Response
On SUCCESS, Vault retrieves the specified version document rendition and its associated annotations.
- The HTTP Response Header Content-Type is set to
application/pdf
. - The HTTP Response Header
Content-Disposition
contains afilename
component which can be used when naming the local file.
History
Since v12
Retrieve Document Version Annotations
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/annotations
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/14/versions/2/1/annotations
Response
On SUCCESS, Vault retrieves the specified version document rendition and its associated annotations.
- The HTTP Response Header Content-Type is set to
application/pdf
. - The HTTP Response Header
Content-Disposition
contains afilename
component which can be used when naming the local file.
History
Since v12
Upload Document Annotations
Request
Send POST
to /api/{version}/objects/documents/{document_id}/annotations
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Parameters
{document_id}
- The document id
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=document2016.pdf" \
https://myvault.veevavault.com/api/v14.0/objects/documents/548/annotations
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "OK",
"replies": 0,
"failures": 0,
"new": 0
}
On SUCCESS, Vault uploads the file and its annotations.
History
Since v12
Upload Document Version Annotations
Request
Send POST
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/annotations
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=document2016.pdf" \
https://myvault.veevavault.com/api/v14.0/objects/documents/548/versions/2/1/annotations
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "OK",
"replies": 0,
"failures": 0,
"new": 0
}
On SUCCESS, Vault associates the uploaded file with the given rendition type for the document with the specified version number.
History
Since v12
Document Relationships
Learn about Document Relationships in Vault Help.
Retrieve Document Type Relationships
Retrieve all relationships from a document type.
Request
Send GET
to /api/{version}/metadata/objects/documents/types/{type}/relationships
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{type}
- The document type. See Retrieve Document Types.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types/promotional_piece__vs/relationships
Response (abridged)
{
"responseStatus": "SUCCESS",
"properties": [
{
"name": "id",
"type": "id",
"length": 20,
"editable": false,
"queryable": true,
"required": true,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "source_doc_id__v",
"type": "id",
"length": 20,
"editable": false,
"queryable": true,
"required": true,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "source_major_version__v",
"type": "Integer",
"length": 10,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "source_minor_version__v",
"type": "Integer",
"length": 10,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "target_doc_id__v",
"type": "id",
"length": 20,
"editable": false,
"queryable": true,
"required": true,
"multivalue": false,
"onCreateEditable": true
},
{
"name": "target_major_version__v",
"type": "Integer",
"length": 10,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": true
},
{
"name": "target_minor_version__v",
"type": "Integer",
"length": 10,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": true
},
{
"name": "relationship_type__v",
"type": "String",
"length": 255,
"editable": false,
"queryable": true,
"required": true,
"multivalue": false,
"onCreateEditable": true
},
{
"name": "created_date__v",
"type": "DateTime",
"length": 0,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "created_by__v",
"type": "ObjectReference",
"length": 10,
"object": "users",
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": false
},
{
"name": "source_vault_id__v",
"type": "id",
"length": 20,
"editable": false,
"queryable": true,
"required": false,
"multivalue": false,
"onCreateEditable": false
}
],
"relationshipTypes": [
{
"value": "crosslink_document_latest__v",
"label": "CrossLink Latest Bindings",
"sourceDocVersionSpecific": true,
"targetDocVersionSpecific": false,
"system": true,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "crosslink_document_latest_steady_state__v",
"label": "CrossLink Latest Steady State Bindings",
"sourceDocVersionSpecific": true,
"targetDocVersionSpecific": false,
"system": true,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "references__vs",
"label": "Linked Documents",
"sourceDocVersionSpecific": true,
"targetDocVersionSpecific": true,
"system": true,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "basedon__vs",
"label": "Based on",
"sourceDocVersionSpecific": false,
"targetDocVersionSpecific": true,
"system": true,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "related_claims__vs",
"label": "Related Claims",
"sourceDocVersionSpecific": false,
"targetDocVersionSpecific": false,
"system": false,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Claim",
"value": "claim__vs"
}
]
},
{
"value": "supporting_documents__vs",
"label": "Supporting Documents",
"sourceDocVersionSpecific": false,
"targetDocVersionSpecific": false,
"system": false,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "crosslink_document_static__v",
"label": "CrossLink Static Bindings",
"sourceDocVersionSpecific": true,
"targetDocVersionSpecific": true,
"system": true,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
},
{
"label": "Claim",
"value": "claim__vs"
},
...
]
},
{
"value": "related_pieces__vs",
"label": "Related Pieces",
"sourceDocVersionSpecific": false,
"targetDocVersionSpecific": false,
"system": false,
"singleUse": false,
"targetDocumentTypes": [
{
"label": "Promotional Piece",
"value": "promotional_piece__vs"
}
]
}
],
"relationships": [
{
"relationship_name": "source__vr",
"relationship_label": "Source Relationship",
"relationship_type": "reference_outbound",
"object": {
"name": "documents"
}
},
{
"relationship_name": "target__vr",
"relationship_label": "Target Relationship",
"relationship_type": "reference_outbound",
"object": {
"name": "documents"
}
}
]
}
Details
The abridged response above shows the metadata for the relationship type configured for the specified document promotional_piece__vs
.
Relationship Fields
The relationships object includes the following fields:
Field Name | Description |
---|---|
id |
The relationship id field. |
source_doc_id__v |
The document id field of the source document on which the relationship is defined. |
source_major_version__v |
The major_version_number__v of the source document. This is only applies when the target document is bound to a specific version of the source document. |
source_minor_version__v |
The minor_version_number__v of the source document. This is only applies when the target document is bound to a specific version of the source document. |
target_doc_id__v |
The document id field of the target document which is bound to the source document. |
target_major_version__v |
The major_version_number__v of the target document. This is only applies when the source document is bound to a specific version of the target document. |
target_minor_version__v |
The minor_version_number__v of the target document. This is only applies when the source document is bound to a specific version of the target document. |
relationship_type__v |
The relationship type (basedon__vs , supporting_documents__vs , related_claims__vs , related_pieces__vs , etc.). |
created_date__v |
The date and time when the relationship is created. |
created_by__v |
The user id value of the person who creates the relationship. |
source_vault_id__v |
The Vault id value where the source document exists. Learn more. |
Relationship Type Properties
Relationship types and their properties are configurable and vary from vault to vault.
Metadata Field | Description |
---|---|
value |
The relationship type name (API key). |
label |
The relationship type label. |
sourceDocVersionSpecific |
Indicates whether or not the relationship type applies to a specific version of the source document. If false , the relationship type applies to all versions. |
targetDocVersionSpecific |
Indicates whether or not the relationship type applies to a specific version of the target document. If false , the relationship type applies to all versions. |
system |
Indicates whether or not the relationship type is a standard Vault relationship type. |
singleUse |
Indicates whether or not the relationship type can only be used once for each document. |
targetDocumentTypes |
Lists all document types which are valid target documents for the relationship type. |
History
Since v3
Retrieve Document Relationships
Retrieve all relationships from a document.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/866/versions/1/1/relationships
Response
{
"responseStatus": "SUCCESS",
"responseMessage": null,
"errorCodes": null,
"relationships": [
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "related_pieces__vs",
"created_date__v": "2015-12-15T21:42:01.000Z",
"id": 214,
"target_doc_id__v": 890,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "related_pieces__vs",
"created_date__v": "2015-12-15T22:06:28.000Z",
"id": 216,
"target_doc_id__v": 884,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "supporting_documents__vs",
"created_date__v": "2015-12-15T21:41:10.000Z",
"id": 213,
"target_doc_id__v": 885,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "supporting_documents__vs",
"created_date__v": "2015-12-15T22:06:21.000Z",
"id": 215,
"target_doc_id__v": 889,
"created_by__v": 46916
}
}
],
"errorType": null
}
Details
On SUCCESS, Vault returns a list of all relationships configured on the document. In this example, document ID 886 v1.1 has reference relationships with four other documents in our vault. This is the source document. Two of the referenced documents - target_doc_id__v
890 and 884 have the related_pieces__vs
relationship type. The other two referenced documents - target_doc_id__v
885 and 887 have the supporting_documents__vs
relationship type.
History
Since v3
Create Document Relationship
Create a new relationship on a document.
Request
Send POST
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Input
Field Name | Description |
---|---|
target_doc_id__v |
[Required] The document id of the target document. |
relationship_type__v |
[Required] The relationship type retrieved from the Document Relationships Metadata call above. |
target_major_version__v |
[Optional] The major version number of the target document to which the source document will be bound. |
target_minor_version__v |
[Optional] The minor version number of the target document to which the source document will be bound. |
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "target_doc_id__v=548" \
-d "relationship_type__v=supporting_documents__vs" \
-d "target_major_version__v=0" \
-d "target_minor_version__v=2" \
https://myvault.veevavault.com/api/v14.0/objects/documents/548/versions/0/1/relationships
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Document relationship successfully created.",
"id": 200
}
On SUCCESS, Vault returns the ID of the newly created document relationship.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DATA |
Relationship already exists. | |
PARAMETER_REQUIRED |
Missing required parameter [{field_name}]. | |
INVALID_DATA |
Document version major {major_version_number__v}, minor {minor_version_number__v} not found for document {document_id}. |
History
Since v3
Retrieve Document Relationship
Retrieve details of a specific document relationship.
Request
Send GET
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships/{relationship_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{relationship_id}
- The relationship id
field value. See Retrieve Document Relationships.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/relationships/200
Response
{
"responseStatus": "SUCCESS",
"responseMessage": null,
"errorCodes": null,
"relationships": [
{
"relationship": {
"id": 200,
"source_doc_id__v": 534,
"relationship_type__v": "supporting_documents__vs",
"created_by__v": 46916,
"created_date__v": "2015-03-20T20:44:56.000Z",
"target_doc_id__v": 548
}
}
],
"errorType": null
}
Details
Field Name | Description |
---|---|
id |
Relationship ID |
source_doc_id__v |
The source document id field value. |
relationship_type__v |
The relationship type. |
target_doc_id__v |
The target document id field value. |
created_by__v |
The user id field value of the person who created the relationship. |
created_date__v |
The date and time when the relationship was created. |
History
Since v3
Delete Document Relationship
Delete a relationship from a document.
Request
Send DELETE
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships/{relationship_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
{relationship_id}
- The relationship id
field value. See Retrieve Document Relationships.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/relationships/200
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Document relationship successfully deleted.",
"id": 200
}
On SUCCESS, Vault returns the relationship ID of the deleted relationship.
History
Since v3
Document Events
Learn about Document Events in Vault Help.
Retrieve Document Event Types and Subtypes
Request
Send GET
to /api/{version}/metadata/objects/documents/events
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events
Response
{
"responseStatus": "SUCCESS",
"events": [
{
"name": "distribution__v",
"label": "Distribution Event",
"subtypes": [
{
"name": "approved_email__v",
"label": "Approved Email",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/approved_email__v"
},
{
"name": "controlled_copy__v",
"label": "Controlled Copy",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/controlled_copy__v"
},
{
"name": "irep__v",
"label": "CRM",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/irep__v"
},
{
"name": "engage__v",
"label": "Engage",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/engage__v"
},
{
"name": "published_content__v",
"label": "Published Content",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/published_content__v"
},
{
"name": "clm__v",
"label": "CLM",
"value": "https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/clm__v"
}
]
}
]
}
Details
On SUCCESS, Vault returns the list of events, and event types per each event (if applicable). If the user is not permitted to access the event data, the event type is omitted from the response. In this example, one document event distribution__v
is configured in our vault. This "Distribution Event" is configured with six document event "subtypes".
History
Since v6
Retrieve Document Event SubType Metadata
Request
Send GET
to /api/{version}/metadata/objects/documents/events/{event_type}/types/{event_subtype}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/events/distribution__v/types/approved_email__v
Response
{
"responseStatus": "SUCCESS",
"name": "approved_email__v",
"label": "Approved Email",
"properties": [
{
"name": "event_date__v",
"label": "Event Date",
"type": "DateTime",
"queryable": true,
"systemAttribute": true
},
{
"name": "document_id__v",
"label": "Document ID",
"type": "ObjectReference",
"objectType": "Documents",
"queryable": true
},
{
"name": "major_version_number__v",
"label": "Document Major Version Number",
"type": "Number",
"queryable": true
},
{
"name": "minor_version_number__v",
"label": "Document Minor Version Number",
"type": "Number",
"queryable": true
},
{
"name": "triggered_by__v",
"label": "User ID",
"type": "ObjectReference",
"objectType": "Users",
"queryable": true,
"systemAttribute": true
},
{
"name": "event_type__v",
"label": "Event Type",
"type": "String",
"required": true,
"queryable": true
},
{
"name": "event_subtype__v",
"label": "Event Subtype",
"type": "String",
"required": true,
"queryable": true
},
{
"name": "classification__v",
"label": "Event Classification",
"type": "String",
"values": [
{
"name": "distribute__v",
"label": "Distribute"
},
{
"name": "view__v",
"label": "View"
},
{
"name": "download__v",
"label": "Download"
}
],
"required": true,
"queryable": true
},
{
"name": "external_id__v",
"label": "External ID",
"type": "String",
"required": true,
"queryable": true
},
{
"name": "user_email__v",
"label": "User Email",
"type": "String",
"required": true,
"queryable": true
},
{
"name": "document_title__v",
"label": "Document Title",
"type": "String",
"queryable": true,
"systemAttribute": true
},
{
"name": "document_number__v",
"label": "Document Number",
"type": "String",
"queryable": true,
"systemAttribute": true
},
{
"name": "document_name__v",
"label": "Document Name",
"type": "String",
"queryable": true,
"systemAttribute": true
}
]
}
On SUCCESS, Vault returns all metadata for the specified event subtype.
History
Since v6
Create Document Event
Request
Send POST
to /api/{version}/objects/documents/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/events
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
{major_version_number__v}
- The document major_version_number__v
field value.
{minor_version_number__v}
- The document minor_version_number__v
field value.
Input
- Provide the name-value pairs consisting of all required fields and the values for the event subtype specified.
- The required fields are obtained from the event subtype metadata (described above).
- You can use either field value names or labels for the
event_type__v
,event_subtype__v
andclassification__v
field values in the request. - The Approved Email event subtype metadata shows the five event fields below as required.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "event_type__v=distribution__v" \
-d "event_subtype__v=approved_email__v" \
-d "classification__v=download__v" \
-d "external_id__v=1234"
https://myvault.veevavault.com/api/v14.0/objects/documents/534/versions/2/0/events
Response
{
"responseStatus": "SUCCESS"
}
On SUCCESS, Vault logs the document event.
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
You do not have permission to log an event of specified type. | |
INVALID_DATA |
The value specified for the parameter is invalid (validation error). | As part of the error, a list of all fields which have an error will be returned. |
PARAMETER_REQUIRED |
A required parameter is not provided. | As part of the error, a list of all missing parameters will be returned. |
METHOD_NOT_SUPPORTED |
The URL is constructed with an invalid event type. | This also includes other endpoint related errors. |
History
Since v6
Retrieve Document Events
Request
Send GET
to /api/{version}/objects/documents/{document_id}/events
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{document_id}
- The document id
field value.
Input
- You can include one or more queryable event fields and associated values in the request parameters to filter the response. For example:
- Specifying
event_type__v=Distribution
will return only distribution events. - Specifying
event_type__v=Distribution&event_subtype__v=Approved Email
will return only distribution events generated for/by Approved Email.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/534/events
Response
{
"responseStatus": "SUCCESS",
"events": [
{
"name": "download__v",
"label": "Approved Email Download",
"properties": {
"event_date__v": "2015-03-20T22:06:40.000Z",
"document_id__v": 534,
"major_version_number__v": 2,
"minor_version_number__v": 0,
"triggered_by__v": 46916,
"event_type__v": "Distribution Event",
"event_subtype__v": "Approved Email",
"classification__v": "Download",
"external_id__v": "1234",
"user_email__v": "quinntaylor@myemail.com",
"event_modified_by__v": 46916,
"event_modified_date__v": "2015-03-20T22:06:40.000Z",
"document_number__v": "REF-0059",
"document_name__v": "Wonderdrug Information"
}
}
]
}
Details
On SUCCESS, Vault returns the list of event objects, each containing the fields as defined by the metadata for its event type. Null and/or false valued fields are omitted from the response.
History
Since v6
Document Templates
Learn about Document Templates in Vault Help.
Retrieve Document Template Metadata
Retrieve the metadata which defines the shape of document templates in your vault.
Request
Send GET
to /api/{version}/metadata/objects/documents/templates
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/templates
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"name": "name__v",
"type": "String",
"requiredness": "required",
"max_length": 50,
"editable": true,
"multi_value": false
},
{
"name": "label__v",
"type": "String",
"requiredness": "required",
"max_length": 100,
"editable": true,
"multi_value": false
},
{
"name": "active__v",
"type": "Boolean",
"requiredness": "required",
"editable": true,
"multi_value": false
},
{
"name": "type__v",
"type": "Component",
"requiredness": "required",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "subtype__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "classification__v",
"type": "Component",
"requiredness": "optional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "format__v",
"type": "String",
"requiredness": "required",
"max_length": 200,
"editable": false,
"multi_value": false
},
{
"name": "size__v",
"type": "Number",
"requiredness": "required",
"max_value": 9223372036854775807,
"min_value": 0,
"scale": 0,
"editable": false,
"multi_value": false
},
{
"name": "created_by__v",
"type": "Number",
"requiredness": "required",
"max_value": 9223372036854775807,
"min_value": 0,
"scale": 0,
"editable": false,
"multi_value": false
},
{
"name": "file_uploaded_by__v",
"type": "Number",
"requiredness": "required",
"max_value": 9223372036854775807,
"min_value": 0,
"scale": 0,
"editable": false,
"multi_value": false
},
{
"name": "md5checksum__v",
"type": "String",
"requiredness": "required",
"max_length": 100,
"editable": false,
"multi_value": false
}
]
}
Details
Field Name | Field Type | Description | Required | Editable |
---|---|---|---|---|
name__v |
String | Document template name. Used in the API when retrieving/creating/updating templates. | True | True |
label__v |
String | Document template label. The name users see in the UI when selecting templates. | True | True |
active__v |
Boolean | Indicates whether or not the template is available for creating documents. | True | True |
type__v |
Component | The document type to which the template is associated. | True | True |
subtype__v |
Component | The document subtype to which the template is associated. | Conditional * | True |
classification__v |
Component | The document classification to which the template is associated. | Conditional * | True |
format__v |
String | Document template format (.doc, .pdf, etc.). | System-Managed | False |
size__v |
Number | Document template size (Kb). | System-Managed | False |
created_by__v |
Number | Vault user ID of the person who created the template. | System-Managed | False |
file_uploaded_by__v |
Number | Vault user ID of the person who uploaded the template file. | System-Managed | False |
md5checksum__v |
String | A string calculated using MD5 algorithm that can be used to uniquely identify the source file. | System-Managed | False |
The document subtype and classification fields are "conditional" in that they are only required if the template exists at the document subtype or classification level.
History
Since v13
Retrieve Document Template Collection
Retrieve all document templates.
Request
Send GET
to /api/{version}/objects/documents/templates
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"name__v":"claim_document_template__c",
"label__v":"Claim Document Template",
"active__v":true,
"type__v":"claim__vs",
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size__v": 2781904,
"created_by__v": 12021,
"file_uploaded_by__v": 12021,
"md5checksum__v": 98238947109287333
},
{
"name__v":"clinical_study_document_template__c",
"label__v":"Clinical Study Document Template",
"active__v":true,
"type__v":"reference_document__vs",
"subtype__v":"clinical_study__vs",
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size__v": 15776,
"created_by__v": 12021,
"file_uploaded_by__v": 12021,
"md5checksum__v": 75886214401031117
},
{
"name__v":"promo_ad_print_document_template__c",
"label__v":"Promo Ad Print Document Template",
"active__v":true,
"type__v":"promotional_piece__vs",
"subtype__v":"advertisement__vs",
"classification__v":"print__vs",
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size__v": 82923,
"created_by__v": 12021,
"file_uploaded_by__v": 12021,
"md5checksum__v": 52478042594365555
}
]
}
Details
The response lists all document templates which have been added to the vault. Shown above, three document templates exist in our vault:
- The first
claim_document_template__c
exists at the document type level. It is intended for use with new documents of theclaim__vs
type. - The second
clinical_study_document_template__c
exists at the document subtype level. It is intended for use with new documents of theclinical_study__vs
subtype. - The third
promo_ad_print_document_template__c
exists at the document classification level. It is intended for use with new documents of theprint__vs
classification.
For information about the document template metadata, refer to the "Retrieve Document Template Attributes" response below.
History
Since v13
Retrieve Document Template Attributes
Retrieve the attributes from a document template.
Request
Send GET
to /api/{version}/objects/documents/templates/{template_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The document template name__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates/promo_ad_print_document_template__c
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"name__v":"promo_ad_print_document_template__c",
"label__v":"Promo Ad Print Document Template",
"active__v":true,
"type__v":"promotional_piece__vs",
"subtype__v":"advertisement__vs",
"classification__v":"print__vs",
"format__v": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size__v": 82923,
"created_by__v": 12021,
"file_uploaded_by__v": 12021,
"md5checksum__v": 52478042594365555
}
]
}
Details
The response lists all attributes configured on a specific document template in the vault. Shown above are the attributes configured on the specified template:
Field Name | Description |
---|---|
name__v |
Name of the document template. This value is not displayed to end users in the UI. It is seen by Admins and used in the API. |
label__v |
Label of the document template. When users in the UI create documents from templates, they see this value in the list of available templates. |
type__v |
Vault document type to which the template is associated. |
subtype__v |
Vault document subtype to which the template is associated. This field is only displayed if the template exists at the document subtype or classification level. |
classification__v |
Vault document classification to which the template is associated. This field is only displayed if the template exists at the document classification level. The template shown in this response is configured for use with documents of the print__vs classification. |
format__v |
File format of the document template. |
size__v |
Size of the document template (Kb). |
created_by__v |
Vault user ID of the person who created the document template. |
file_uploaded_by__v |
Vault user ID of the person who uploaded the document template. |
md5checksum__v |
A string calculated using MD5 algorithm that can be used to uniquely identify the source file. |
History
Since v13
Download Document Template File
Download the file of a specific document template.
Request
Send GET
to /api/{version}/objects/documents/templates/{template_name}/file
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
For this request, the Accept
header controls only the error response. On SUCCESS, the response is a file stream (download).
Parameters
{template_name}
- The document template name__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates/claim_document_template__c/file
Response
Content-Type: application/octet-stream;charset=UTF-8
Content-Disposition: attachment;filename="claim_document_template__c.pdf"
Details
On SUCCESS, Vault retrieves the document template file.
The HTTP Response Header Content-Type
is set to application/octet-stream
. The HTTP Response Header Content-Disposition
contains a filename component which can be used when naming the local file.
When retrieving templates with very small file size, the HTTP Response Header Content-Length
is set to the size of the template file. Note that for template downloads of larger file sizes, the Transfer-Encoding
method is set to chunked
and the Content-Length
is not displayed.
History
Since v13
Create Document Template
Upload one document template. To upload multiple document templates, see Bulk Create Document Templates.
Request
Send POST
to /api/{version}/objects/documents/templates
Headers
Input Content-Type
- Name-Value Pair multipart/form-data
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
To upload the file, use the multi-part attachment with the file component "file={file_name}"
. The maximum allowed file size is 4GB.
Input
When creating document templates, the following fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new document template. If not included, Vault will use the specified label__v value to generate a value for the name__v field. |
label__v |
The label of the new document template. This is the name users will see among the available binder templates in the UI. |
type__v |
The name of the document type to which the template will be associated. |
subtype__v |
The name of the document subtype to which the template will be associated. This is only required if associating the template with a document subtype. |
classification__v |
The name of the document classification to which the template will be associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the new document template should be set to active, i.e., available for selection when creating a document. |
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-H "Accept: text/csv" \
-F "file=Promo Ad Template.docx" \
-F "label__v=Promo Ad Template" \
-F "type__v=promotional_piece__vs" \
-F "subtype__v=advertisement__vs" \
-F "classification__v=print__vs" \
-F "active__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates
Details
- The input format is set to
multipart/form-data
(name-value pair with file upload). - The response format is set to
text/csv
. - The path/name of the document template source file on the FTP staging server is specified.
- The
name__v
field is not included. Vault will use the specifiedlabel__v
field value to create thename__v=promo_ad_template__c
- The
label__v
field specifies the document template label "Promo Ad Template". This is what users will see among the available templates in the UI. - The document
type__v
,subtype__v
, andclassification__v
are all specified. This template is being created for documents ofclassification__v=print__vs
. - The template is being set to
active__v=true
. It will be available for selection when creating a new document.
Response
responseStatus,name,errors
SUCCESS,promo_ad_template__c,
On SUCCESS, Vault returns the name of the new document template.
Errors
Refer to the Bulk Create Document Templates Errors section below.
History
Since v13
Bulk Create Document Templates
Upload from 1-500 document templates. To upload one document template, see Create Document Template.
Request
Send POST
to /api/{version}/objects/documents/templates
Headers
Input Content-Type
- JSON application/json
or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
File Upload
Before submitting this request, you must upload the document template source files to the staging server.
Then, in your JSON or CSV input, include the file
parameter set to the {path/file_name} of each source file on the server.
Input
When creating document templates, the following fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new document template. If not included, Vault will use the specified label__v value to generate a value for the name__v field. |
label__v |
The label of the new document template. This is the name users will see among the available binder templates in the UI. |
type__v |
The name of the document type to which the template will be associated. |
subtype__v |
The name of the document subtype to which the template will be associated. This is only required if associating the template with a document subtype. |
classification__v |
The name of the document classification to which the template will be associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the new document template should be set to active, i.e., available for selection when creating a document. |
Example CSV Input
file |
name__v |
label__v |
type__v |
subtype__v |
classification__v |
active__v |
---|---|---|---|---|---|---|
templates/doc_template_1.doc | site_document_template__c | SMF Template | site_master_file__v | true | ||
templates/doc_template_2.doc | TMF Document Template | trial_master_file__v | true | |||
templates/doc_template_3.doc | Trial Protocol Document Template | central_trial_documents__vs | trial_documents__vs | protocol__vs | true | |
templates/doc_template_4.doc | Clinical Study Report Document Template | central_trial_documents__vs | reports__vs | clinical_study_report__vs | false |
In this example input, we're creating four new document templates in our vault:
- We've included the
file
parameter with the path/name of four document template source files located in the "templates" directory of our vault's staging server. - We've only specified the
name__v
value for the first template and given it a differentlabel__v
value. The other templates will inherit theirname__v
values from thelabel__v
values. - We've specified the document type, subtype, and classification to which each document template will be associated.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Templates\add_document_templates.csv" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file in our local directory is specified.
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"responseStatus":"SUCCESS",
"name":"site_document_template__c"
},
{
"responseStatus":"SUCCESS",
"name":"tmf_document_template__c"
},
{
"responseStatus":"SUCCESS",
"name":"trial_protocol_document_template__c"
},
{
"responseStatus":"FAILURE",
"errors":[
{
"type":"INVALID_DATA",
"message":"Error message describing why this template was not created."
}
]
}
]
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DATA |
Cannot parse the 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 |
Cannot create document : source file [{FILE_NAME}] not found. | When creating new document templates, you must first upload the template source files to the FTP staging server. The file value in the input may contain either a single filename (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. |
REQUIRED_PARAMETER |
Missing required parameter [{field_name}]. | A required field is missing from the input. The error message includes the missing field name. |
INVALID_VALUE |
Invalid value [{FIELD_VALUE]} specified for parameter [{PARAMETER}]. | A field value specified in the input is invalid. The error message includes invalid value and field name on which it is specified. |
INVALID_DATA |
Cannot create template : another template already exists with [name__v={specified name}]. | The name specified for the template is a duplicate of an existing document template in your vault. |
INVALID_DATA |
Cannot create template : input already defines another template with [name__v={specified name}]. | The name specified for the template is a duplicate of another template name specified in the same input. |
INVALID_DATA |
String exceeds max length [{MAX_VALUE}]. | The string value exceeds the maximum length for the label__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{type}]. | An invalid value is specified for the type__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{subtype}] under [{Value specified for type__v }]. |
An invalid value is specified for the subtype__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{classification}] under [{Value specified for classification__v }]. |
An invalid value is specified for the classification__v field. |
History
Since v13
Update Document Template
Update a document template to your vault.
See also: Bulk Update Document Templates below
Request
Send PUT
to /api/{version}/objects/documents/templates/{template_name}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The document template name__v
field value.
Input
You can update the following fields on document templates:
Field Name | Description |
---|---|
name__v |
Change the name of an existing document template. |
label__v |
Change the label of an existing document template. This is the name users will see among the available document templates in the UI. |
type__v |
Change the document type to which the template is associated. |
subtype__v |
Change the document subtype to which the template is associated. This is only required if associating the template with a document subtype. |
classification__v |
Change the document classification to which the template is associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the document template should be set to active, i.e., available for selection when creating a document. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: text/csv" \
-d "name__v=promo_ad_web_document_template__c" \
-d "label__v=Promo Ad Web Document Template" \
-d "type__v=promotional_piece__vs" \
-d "subtype__v=advertisement__vs" \
-d "classification__v=web__vs" \
-d "active__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates/promo_ad_print_document_template__c
In this example:
- The input format is set to
application/x-www-form-urlencoded
. - The response format is set to
text/csv
. - The new
name__v
field is specified. - The new
label__v
field is specified. This is what users will see among the available templates in the UI. - The document
type__v
,subtype__v
, andclassification__v
are all specified. This template is being updated for documents ofclassification__v=web__vs
. - The template is being set to
active__v=true
.
Response
responseStatus,name,errors
SUCCESS,promo_ad_web_document_template__c,
Errors
Refer to the Bulk Update Document Templates Errors section below.
History
Since v13
Bulk Update Document Templates
Update from 1-500 document templates to your vault.
See also: Update [Single] Document Template above.
Request
Send PUT
to /api/{version}/objects/documents/templates
Headers
Input Content-Type
- JSON application/json
(default) or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Input
You can update the following fields on document templates:
Field Name | Description |
---|---|
name__v |
Change the name of an existing document templates. |
label__v |
Change the label of an existing document templates. This is the name users will see among the available binder templates in the UI. |
type__v |
Change the document type to which the templates are associated. |
subtype__v |
Change the document subtype to which the templates are associated. This is only required if associating templates with document subtypes. |
classification__v |
Change the document classification to which the templates are associated. This is only required if associating templates with document classifications. |
active__v |
Set to true or false to indicate whether or not the document templates should be set to active, i.e., available for selection when creating a document. |
Example CSV Input
See Bulk Create Document Templates above for example inputs, which are the same as those used in this request.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Templates\update_document_templates.csv" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file is specified.
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"responseStatus":"SUCCESS",
"name":"claim_document_template__c"
},
{
"responseStatus":"SUCCESS",
"name":"clinical_study_document_template__c"
},
{
"responseStatus":"FAILURE",
"errors":[
{
"type":"INVALID_DATA",
"message":"Error message describing why this template was not created."
}
]
}
]
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DATA |
Cannot parse the 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 |
Cannot update document : source file [{FILE_NAME}] not found. | When updating document template files, you must first upload the template source files to the FTP staging server. The file value in the input may contain either a single filename (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. |
INVALID_VALUE |
Invalid value [{FIELD_VALUE]} specified for parameter [{PARAMETER}]. | A field value specified in the input is invalid. The error message includes invalid value and field name on which it is specified. |
INVALID_DATA |
Cannot create template : another template already exists with [name__v={specified name}]. | The name specified for the template is a duplicate of an existing document template in your vault. |
INVALID_DATA |
Cannot create template : input already defines another template with [name__v={specified name}]. | The name specified for the template is a duplicate of another template name specified in the same input. |
INVALID_DATA |
String exceeds max length [{MAX_VALUE}]. | The string value exceeds the maximum length for the label__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{type}]. | An invalid value is specified for the type__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{subtype}] under [{Value specified for type__v }]. |
An invalid value is specified for the subtype__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{classification}] under [{Value specified for classification__v }]. |
An invalid value is specified for the classification__v field. |
History
Since v13
Delete Document Template
Delete a document template from your vault.
Request
Send DELETE
to /api/{version}/objects/documents/templates/{template_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The document template name__v
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates/promo_ad_web_document_template__c
Response
{
"responseStatus": "SUCCESS"
}
History
Since v13
Document Tokens
The Vault Document Tokens API allows you to generates document access tokens needed by the external viewer to view documents outside of Vault.
Request
Send POST
to /api/{version}/objects/documents/tokens
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
Document IDs:
Required - Include the docIds
request parameter with a comma-separated string of document id
values. This will generate tokens for each document. For example: docIds=101,102,103,104
Token Expiration Date:
Optional - Include the expiryDateOffset
request parameter set to the number of days after which the tokens will expire and the documents will no longer be available in the viewer. If not specified, the tokens will expire after 10 years by default.
Download Option:
Optional - Include the downloadOption
request parameter set to PDF
, source
, both
, or none
. These allow users viewing the document to be able to download a PDF version or source version (Word, PPT, etc.) of the document. If not specified, the download options default to those set on each document.
Distribution Channel:
Optional - Include the channel
request parameter set to the website object record id
value that corresponds to the distribution channel where the document is being made available.
Token Groups:
Optional - Include the tokenGroup
request parameter. This only required if you want to group together generated tokens for multiple documents in order to display the documents being referenced in the same viewer. This value accepts strings of alphanumeric characters (a-z, A-Z, 0-9, and single consecutive underscores) up to 255 characters in length.
The token that is passed as a URL parameter to the External Viewer is the primary token and the document it references will be displayed normally. However, any additional documents that have tokens generated with the same case-sensitive tokenGroup
string will be displayed in a sidebar of the viewer.
The order of documents in the sidebar depends on the order in which the tokens are generated. If multiple tokens are generated with one request, the documents will be ordered top-to-bottom based on the order they are passed to the docIds
parameter.
For example: If passing the parameters docIds=101,102,103,104
and tokenGroup=group_1
with the request, the top-to-bottom order in the sidebar will be documents 101, 102, 103, 104. If a new request is then made with the parameters docIds=105
and tokenGroup=group_1
, document 105 will be added below document 104 in the previous list.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "docIds=101,102,103,104" \
-d "expiryDateOffset=90" \
-d "downloadOption=PDF" \
-d "channel=00W000000000301" \
https://myvault.veevavault.com/api/v14.0/objects/documents/tokens
Response
{
"responseStatus": "SUCCESS",
"tokens": [
{
"document_id__v": 101,
"token__v": "3003-cb6e5c3b-4df9-411c-abc2-6e7ae120ede7"
}
{
"document_id__v": 102,
"token__v": "3003-1174154c-ac8e-4eb9-b453-2855de273bec"
},
{
"document_id__v": 103,
"token__v": "3003-51ca652c-36d9-425f-894f-fc2f42601fa9"
},
{
"document_id__v": 104,
"errorType": "OPERATION_NOT_ALLOWED",
"errors": [
{
"type": "INVALID_DOCUMENT",
"message": "Document not found [104]."
}
]
}
]
}
Details
In the example above, tokens are generated for the first three documents. The fourth document could not be found. This indicates either an incorrect document id
or that the specified document is a binder.
History
Since v12
Binders
Binders organize documents, sections, and other binders into a hierarchical structure that is useful for packaging related documents together for easier management or eventual publishing. Binders are a kind of document and many of the Document API calls, such as metadata, retrieving and setting properties, security, etc. can be used directly on a binder and will not be replicated here. All API calls related to files and renditions will not work on a binder object. Binders do have unique APIs that allow for interrogating and manipulating the binder structure.
Learn about Documents & Binders in Vault Help.
Vault Binder Metadata
In Vault, binders are just another kind of document. See the Vault Document Metadata tables above for a complete list of metadata.
Retrieve Binders
Retrieve All Binders
In Vault, binders are just another kind of document. Therefore, to retrieve a list of all binders in your vault, you must use the same API endpoint to retrieve documents: /api/{version}/objects/documents
. By searching the response, you can distinguish binders from "regular" documents by using the document field binder__v
set to true
or false
. See the response details below.Alternatively, you can use the Query API to find just binders (SELECT id FROM documents WHERE binder__v=true). See the Vault Query API Overview article for details.
Request
Send GET
to /api/{version}/objects/documents
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/documents
Response (abridged)
{
"responseStatus": "SUCCESS",
"size": 77,
"start": 0,
"limit": 200,
"documents": [
{
"document": {
"id": 101,
"binder__v": true,
"coordinator__v": {
"groups": [],
"users": [
25525,
25513,
25514
]
},
...
"version_creation_date__v": "2015-03-11T22:04:44.725Z",
"major_version_number__v": 0,
"annotations_links__v": 0,
"annotations_all__v": 0,
"status__v": "Planned",
"language__v": [
"English"
],
"product__v": [
"1357662840171"
],
"version_created_by__v": 25524,
"country__v": [],
"annotations_anchors__v": 0,
"document_number__v": "VV-00127",
"minor_version_number__v": 1,
"lifecycle__v": "General Lifecycle",
"crosslink__v": false,
"annotations_notes__v": 0,
"name__v": "CholeCap Presentation",
...
"document": {
"id": 102,
"binder__v": false,
"coordinator__v": {
"groups": [],
"users": [
25514,
25525,
25513
]
},
...
"format__v": "application/pdf",
"version_creation_date__v": "2014-04-16T21:14:11.235Z",
"major_version_number__v": 1,
"annotations_links__v": 9,
"annotations_all__v": 9,
"status__v": "Approved for Distribution",
"language__v": [
"English"
],
"filename__v": "NYAXA 3 Page Magazine Spread.pdf",
"product__v": [
"00P000000000101"
],
"version_created_by__v": 25513,
"country__v": [
"1357662840400"
],
"annotations_anchors__v": 0,
"document_number__v": "PP-NYA-US-0001",
"minor_version_number__v": 0,
"lifecycle__v": "Promotional Piece",
"subtype__v": "Advertisement",
"crosslink__v": false,
"annotations_notes__v": 0,
"classification__v": "Print",
"name__v": "Nyaxa Print Ad",
...
}
}
Details
The abridged response above shows the field names and values configured on two separate documents in our vault:
- The first record retrieved
"id": 101
has thebinder__v
field value set to true:"binder__v": true
. This document is a "binder". - The second record retrieved
"id": 102
has thebinder__v
field value set to false:"binder__v": false
. This document is a "regular" document.
Using this endpoint allows you to retrieve all documents in your vault and distinguish those which are "documents" from those which are "binders".
- Note that for binders, this response does not show the binder section node tree structure.
- To retrieve all metadata configured on a binder, including the section nodes, you must use the binder IDs retrieved from this request in the **Retrieve Binder" endpoint described below.
History
Since v1
v5+ - Includes the binder__v
true/false field to distinguish between documents and binders.
Retrieve Binder
Request
Send GET
to /api/{version}/objects/binders/{binder_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Options
By default, the response includes only the first level of the binder section node structure, i.e., depth=1
.
To retrieve all levels of the binder, include the depth
parameter set to all
. For example:
/api/{version}/objects/binders/{binder_id}?depth=all
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29
Response
{
"responseStatus": "SUCCESS",
"document": {
"id": 29,
"binder__v": true,
"coordinator__v": {
"groups": [],
"users": [
63606
]
},
"owner__v": {
"groups": [],
"users": [
46916
]
},
"approver__v": {
"groups": [],
"users": [
25524
]
},
"reviewer__v": {
"groups": [],
"users": [
60145
]
},
"distribution_contacts__v": {
"groups": [],
"users": []
},
"viewer__v": {
"groups": [
3
],
"users": []
},
"consumer__v": {
"groups": [],
"users": [
60145
]
},
"editor__v": {
"groups": [],
"users": [
25496
]
},
"version_creation_date__v": "2016-03-09T21:55:22.000Z",
"major_version_number__v": 0,
"lifecycle__v": "Field Medical",
"subtype__v": "Training Materials",
"annotations_links__v": 0,
"annotations_notes__v": 0,
"name__v": "VeevaProm Info Binder",
"locked__v": false,
"annotations_all__v": 0,
"status__v": "Draft",
"type__v": "Field Medical",
"description__v": "",
"annotations_unresolved__v": 0,
"last_modified_by__v": 46916,
"product__v": [
"00P000000000102"
],
"version_created_by__v": 46916,
"document_creation_date__v": "2016-03-09T20:42:18.692Z",
"country__v": [
"00C000000000109"
],
"annotations_anchors__v": 0,
"document_number__v": "VV-MED-00029",
"annotations_resolved__v": 0,
"annotations_lines__v": 0,
"version_modified_date__v": "2016-03-09T21:55:22.000Z",
"created_by__v": 46916,
"minor_version_number__v": 2
},
"versions": [
{
"number": "0.1",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/1"
},
{
"number": "0.2",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/2"
}
],
"binder": {
"nodes": [
{
"properties": {
"document_id__v": 7,
"name__v": "VeevaProm Information",
"order__v": 0,
"type__v": "document",
"id": "1457556160448:810987462",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 2,
"name__v": "VeevaProm Consumer Info",
"order__v": 300,
"type__v": "document",
"id": "1457559259279:-602158059",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 5,
"name__v": "VeevaProm Brochure",
"order__v": 301,
"type__v": "document",
"id": "1457556176044:-743019200",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"section_number__v": null,
"name__v": "First Section Folder",
"order__v": 401,
"type__v": "section",
"id": "1457560333810:-909497856",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"section_number__v": null,
"name__v": "Second Section Folder",
"order__v": 501,
"type__v": "section",
"id": "1457560348267:1179700878",
"parent_id__v": "rootNode"
}
}
]
}
}
Details
The abridged response above shows fields and values configured on binder "id": 29
, including the first level of binder nodes in the binder's structure. In this first level, there is one document "id": 567
and two sections "section_number__v": "1"
and "section_number__v": "2"
. The second example below uses the depth=all
request parameter to retrieve all levels of binder nodes in the binder's structure.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29?depth=all
Response
{
"responseStatus": "SUCCESS",
"document": {
"id": 29,
"binder__v": true,
"coordinator__v": {
"groups": [],
"users": [
63606
]
},
"owner__v": {
"groups": [],
"users": [
46916
]
},
"approver__v": {
"groups": [],
"users": [
25524
]
},
"reviewer__v": {
"groups": [],
"users": [
60145
]
},
"distribution_contacts__v": {
"groups": [],
"users": []
},
"viewer__v": {
"groups": [
3
],
"users": []
},
"consumer__v": {
"groups": [],
"users": [
60145
]
},
"editor__v": {
"groups": [],
"users": [
25496
]
},
"version_creation_date__v": "2016-03-09T21:55:22.000Z",
"major_version_number__v": 0,
"lifecycle__v": "Field Medical",
"subtype__v": "Training Materials",
"annotations_links__v": 0,
"annotations_notes__v": 0,
"name__v": "VeevaProm Info Binder",
"locked__v": false,
"annotations_all__v": 0,
"status__v": "Draft",
"type__v": "Field Medical",
"description__v": "",
"annotations_unresolved__v": 0,
"last_modified_by__v": 46916,
"product__v": [
"00P000000000102"
],
"version_created_by__v": 46916,
"document_creation_date__v": "2016-03-09T20:42:18.692Z",
"country__v": [
"00C000000000109"
],
"annotations_anchors__v": 0,
"document_number__v": "VV-MED-00029",
"annotations_resolved__v": 0,
"annotations_lines__v": 0,
"version_modified_date__v": "2016-03-09T21:55:22.000Z",
"created_by__v": 46916,
"minor_version_number__v": 2
},
"versions": [
{
"number": "0.1",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/1"
},
{
"number": "0.2",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/2"
}
],
"binder": {
"nodes": [
{
"properties": {
"document_id__v": 7,
"name__v": "VeevaProm Information",
"order__v": 0,
"type__v": "document",
"id": "1457556160448:810987462",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 2,
"name__v": "VeevaProm Consumer Info",
"order__v": 300,
"type__v": "document",
"id": "1457559259279:-602158059",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 5,
"name__v": "VeevaProm Brochure",
"order__v": 301,
"type__v": "document",
"id": "1457556176044:-743019200",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"section_number__v": null,
"name__v": "First Section Folder",
"order__v": 401,
"type__v": "section",
"id": "1457560333810:-909497856",
"parent_id__v": "rootNode"
},
"nodes": [
{
"properties": {
"document_id__v": 28,
"name__v": "Alterin Prescribing Information",
"order__v": 0,
"type__v": "document",
"id": "1457560375017:-1371674753",
"parent_id__v": "1457560333810:-909497856"
}
},
{
"properties": {
"document_id__v": 26,
"name__v": "Alterin Health Notes",
"order__v": 100,
"type__v": "document",
"id": "1457560377637:-2013602559",
"parent_id__v": "1457560333810:-909497856"
}
},
{
"properties": {
"document_id__v": 27,
"name__v": "Alterin Information Packet",
"order__v": 200,
"type__v": "document",
"id": "1457560379150:954844502",
"parent_id__v": "1457560333810:-909497856"
}
}
]
},
{
"properties": {
"section_number__v": null,
"name__v": "Second Section Folder",
"order__v": 501,
"type__v": "section",
"id": "1457560348267:1179700878",
"parent_id__v": "rootNode"
},
"nodes": [
{
"properties": {
"document_id__v": 24,
"name__v": "Nyaxa Information Packet",
"order__v": 0,
"type__v": "document",
"id": "1457560406595:-2060980086",
"parent_id__v": "1457560348267:1179700878"
}
},
{
"properties": {
"document_id__v": 23,
"name__v": "Nyaxa and Your Health",
"order__v": 100,
"type__v": "document",
"id": "1457560409271:-1499449603",
"parent_id__v": "1457560348267:1179700878"
}
},
{
"properties": {
"document_id__v": 25,
"name__v": "Nyaxa Prescribing Information",
"order__v": 200,
"type__v": "document",
"id": "1457560412997:-1622511549",
"parent_id__v": "1457560348267:1179700878"
}
}
]
}
]
}
}
On SUCCESS, Vault retrieves the fields and components of the binder in a hierarchical structure clearly showing the parent-child relationships for each item and maintaining the specific order of the objects in each level.
Details
For each node in a binder, the API returns the following fields:
Field Name | Description |
---|---|
nodes [n] |
List of all nodes (documents and sections) at each level in the binder. |
properties [n] |
List of all properties associated with each document or section node. |
order__v |
Order of the document or section within the binder or within another section of the binder. |
section_number__v |
Optional number which can be added to each section. |
type |
Type of node (document or section). |
document_id__v |
The document ID of the document in the binder. This is the same as the document's actual document id |
id |
The document ID or section ID specific to the binder. For documents, this is different from the document's actual document id . |
parent_id__v |
Section ID of the parent node, e.g., "rootNode". |
name__v |
Name of the document or section. For sections, this is the name of the "subfolder" seen in the binder hierarchy in the UI. |
major_version_number__v |
If the document binding rule is "specific", this is major version number of the document. |
minor_version_number__v |
If the document binding rule is "specific", this is minor version number of the document. |
History
Since v5
Retrieve All Binder Versions
Retrieve all versions of a binder.
Request
Send GET
to /api/{version}/objects/binders/{binder_id}/versions
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29/versions
Response
{
"responseStatus": "SUCCESS",
"versions": [
{
"number": "0.1",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/1"
},
{
"number": "0.2",
"value": "https://medcomms-veevapharm.vaultdev.com/api/v14.0/objects/binders/29/versions/0/2"
}
]
}
Binders have versions just like regular documents. On SUCCESS, Vault returns a list of the available versions for the specified binder.
History
Since v5
Retrieve Binder Version
Retrieve the fields and values configured on a specific version of a specific binder.
Request
Send GET
to /api/{version}/objects/binders/{binder_id}/versions/(major_version_number__v}/{minor_version_number__v}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/versions/0/3
See the response from the Retrieve Binder endpoint above for additional details.
History
Since v5
Create Binders
Create Binder
Use this request to create a new binder in your vault. Learn about Creating Binders in Vault Help.
Request
Send POST
to /api/{version}/objects/binders
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Input
All required binder (document) fields must be included in the request. When creating a binder, no file is included in the request. Refer to the next section to create a binder from a template.
Options
When creating a binder, the binder metadata is indexed synchronously by default. To process the indexing asynchronously, include a query parameter async
set to true
(objects/binders?async=true
). This helps speed up the response time from Vault when processing large amounts of data.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name__v=Wonderdrug Compliance Package" \
-d "type__v=Compliance Package" \
-d "subtype__v=Professional" \
-d "lifecycle__v=Binder Lifecycle" \
-d "product__v=1357662840293" \
-d "major_version_number__v=0" \
-d "minor_version_number__v=1" \
https://myvault.veevavault.com/api/v14.0/objects/binders
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Successfully created binder.",
"id": 563
}
Errors
Error Type | Error Message | Comments |
---|---|---|
PARAMETER_REQUIRED |
Missing required parameter [{field_name}]. | A required field or field value was not included in the request. |
INVALID_DATA |
Invalid values {field_value} specified for parameter {field_name}. | The value entered for a specified document field does not match with available values. |
History
Since v1
v7+ - Supports asynchronous indexing.
Create Binder from Template
Request
Send POST
to /api/{version}/objects/binders
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Input
All required binder (document) fields must be included in the request. When creating a binder, no file is included in the request. Include the parameter fromTemplate
and specify the name of the template as returned from the document metadata as shown below. Only templates of "kind": binder
are allowed.
Example
Since we're creating a new binder with the document type "Compliance Package" and subtype "Professional", we need to find the available templates in the type/subtype metadata:
$ curl -X POST -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/documents/types/compliance_package__v/subtypes/professional__v
Response (abridged)
...
"templates": [
{
"label": "Compliance Package Template",
"name": "compliance_package__v",
"kind": "binder",
"definedIn": "compliance_package__v",
"definedInType": "type"
},
{
"label": "eCTD Compliance Package",
"name": "ectd_compliance_package_template__v",
"kind": "binder",
"definedIn": "compliance_package__v",
"definedInType": "type"
}
...
The abridged response above shows the "templates"
section of the type/subtype response. There are two available templates we can use to create this binder (each template has the "kind": binder
). Both are defined on the compliance_package__v
document type. We'll use the binder template ectd_compliance_package_template__v
to create our new binder as shown below.
Example (Create Binder from Template)
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "fromTemplate=ectd_compliance_package_template__v" \
-d "name__v=CholeCap eCTD Compliance Package" \
-d "type__v=Compliance Package" \
-d "subtype__v=Professional" \
-d "lifecycle__v=Binder Lifecycle" \
-d "product__v=1357662840171" \
-d "major_version_number__v=0" \
-d "minor_version_number__v=1" \
https://myvault.veevavault.com/api/v14.0/objects/binders
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Successfully created binder.",
"id": 565
}
Errors
Error Type | Error Message | Comments |
---|---|---|
PARAMETER_REQUIRED |
Missing required parameter [{field_name}]. | A required document field or field value was not included in the request. |
INVALID_DATA |
Invalid values {field_value} specified for parameter {field_name}. | The value entered for a specified document field does not match with available values. |
History
Since v5
v7+ - Supports asynchronous indexing.
Create Binder Version
Request
Send POST
to /api/{version}/objects/binders/{binder_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "New draft successfully created",
"major_version_number__v": 0,
"minor_version_number__v": 4
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
User does not have sufficient privileges to perform the action. | You are not assigned permission to complete the request. |
INVALID_BINDER |
Binder not found {id}. | The error condition occurs when the user specifies a binder {id} that does not exist. |
History
Since v7
Update Binders
Update Binder
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "audience__vs=Healthcare Provider" \
-d "country__v=1357662840400" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566
Response
{
"responseStatus": "SUCCESS",
"id": 566
}
History
Since v5
Reclassify Binder
Reclassify allows you to change the document type of an existing binder. A document "type" is the combination of the type__v
, subtype__v
, and classification__v
fields on a binder. When you reclassify, Vault may add or remove certain fields on the binder. You can only reclassify the latest version of a binder and only one binder at a time. The API does not currently support Bulk Reclassify.
Learn more about:
- Vault Help: Reclassifying Documents.
- API: Retrieve Binders
- API: Retrieve Document Fields
- API: Retrieve Document Types, Subtypes, and Classifications
About this Request
- You can only reclassify the latest version of a specified binder.
- You can only reclassify one binder at a time. Bulk reclassify is not currently supported.
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Input
Field Name | Description |
---|---|
reclassify |
Set to true . Without this, a standard binder update action is performed. |
type__v |
The name of the document type being assigned to the binder. |
subtype__v |
The name of the document subtype (if one exists on the type). |
classification__v |
The name of the document classification (if one exists on the subtype). |
lifecycle__v |
The name of the lifecycle. |
You can also add or remove values for any other editable field.
Note that additional fields may be required depending on the document type, subtype, and classification being assigned to the binder.
Use the Document Metadata API to retrieve required and editable fields in your vault.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "reclassify=true" \
-d "type__v=Claim" \
-d "lifecycle__v=Binder Lifecycle" \
https://myvault.veevavault.com/api/v14.0/objects/binders/776
Response
{
"responseStatus": "SUCCESS",
"id": 776
}
History
Since v8
Update Binder Version
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "audience__vs=Healthcare Provider" \
-d "country__v=1357662840400" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/0/1
Response
{
"responseStatus": "SUCCESS",
"id": 566
}
History
Since v5
Refresh Binder Auto-Filing
Note: This is only available in eTMF vaults on binders configured with the TMF Reference Models.
Request
Send POST
to /api/{version}/objects/binders/{binder_id}/actions
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "action=refresh_auto_filing" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/actions
Response
{
"responseStatus": "SUCCESS"
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
User does not have sufficient privileges to perform the action. | You are not assigned permission to complete the request. |
INVALID_DATA |
Invalid value [{value}] specified for parameter [{parameter}] : Object record ID does not resolve to a valid active [hierarchy__v ]. |
History
Since v13
Delete Binders
Delete Binder
Request
Send DELETE
to /api/{version}/objects/binders/{binder_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566
Response
{
"responseStatus": "SUCCESS",
"id": 35
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
User does not have sufficient privileges to perform the action. | You are not assigned permission to complete the request. |
INVALID_BINDER |
Binder not found {id}. | The error condition occurs when the user specifies a binder {id} that does not exist. |
History
Since v5
Delete Binder Version
Request
Send DELETE
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/versions/0/2
Response
{
"responseStatus": "SUCCESS",
"id": 124
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
User does not have sufficient privileges to perform the action. | You are not assigned permission to complete the request. |
INVALID_BINDER |
Binder not found {id}. | The error condition occurs when the user specifies a binder {id} that does not exist. |
History
Since v5
Export Binders
The Export Binder API allows you to export a zip archive with all documents from a binder, or a subset of those documents.
You can also export different artifacts for the selected documents, including source documents, renditions, versions, and document fields.
Learn about Exporting Binders in Vault Help.
Export Binder
Use this request to export the latest version or a specific version of a binder in your vault.
- This will export the complete binder, including all binder sections and documents.
- To export only specific binder sections and documents, refer to the next section.
- After initiating an export, you can retrieve its status, results, and download the exported binder.
Request
To export the latest version of a binder, Send POST
to /api/{version}/objects/binders/{binder_id}/actions/export
To export a specific version of a binder, Send POST
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/actions/export
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Exporting Document Source Files
- By default, the source files of all documents in the binder are exported.
- Source documents can be any type of file (ZIP, DOCX, CSV, etc.).
- To exclude source files, add the parameter
source=false
to the request endpoint. - For example:
.../actions/export?source=false
Exporting Document Renditions
- By default, document renditions are not exported.
- To include renditions, add the parameter
renditiontype={rendition_type}
to the request endpoint. - For example:
.../actions/export?renditiontype=viewable_rendition__v
- The
viewable_rendition__v
is the most common, which exports the (typically auto-generated) PDF rendition of your document. - Note that if the document source file is a PDF, there is no separate viewable rendition to download.
Exporting Document Versions
- By default, the document versions that are exported are determined by the version binding rule configured for the binder, section, or binder document.
- To override the binding rule and export all major versions of each document, add the parameter
docversion=major
to the request endpoint. - For example:
.../actions/export?docversion=major
- To override the binding rule and export all major and minor versions of each document, add the parameter
docversion=major_minor
to the request endpoint. - For example:
.../actions/export?docversion=major_minor
Exporting Attachments
- To export binder attachments, include the parameter
attachments=all
orattachments=latest
- For example:
.../actions/export?attachments=all
will export all versions of all attachments. - For example:
.../actions/export?attachments=latest
will export the latest version of all attachments.
Exporting Document Field Values & Metadata
- By default, exported files include the
name__v
field value only. - To export additional fields, include a comma-separated list of field values to export.
- For example, to export the binder name, title, document number, and export file name:
.../actions/export?name__v,title__v,document_number__v,export_filename__v
- By default, all document metadata is exported. To exclude the metadata, add the parameter
docfield=false
Combining Multiple Request Parameters
- To add multiple parameters to the request endpoint, separate each with the ampersand (
&
) character. - For example, to exclude the source file and export a rendition:
.../actions/export?source=false&renditiontype=viewable_rendition__v
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/454/actions/export
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Job for Binder Export Started",
"URL": "https://myvault.veevavault.com/api/v14.0/services/jobs/1201",
"job_id": 1201
}
Details
On SUCCESS, the response includes the following information:
URL
- The URL to retrieve the current status of the binder export job.job_id
- The Job ID value is used to retrieve the status and results of the binder export request (described below).
Errors
Vault will not start the export job until all errors have been corrected and resubmitted.
Error Type | Error Message | Comments |
---|---|---|
METHOD_NOT_SUPPORTED |
Requested method {METHOD} not supported. | You must use the HTTP POST method for this request. |
INVALID_DATA |
Invalid input parameter value for {PARAMETER}. | You have provided a parameter which is invalid. The error message includes the name of the invalid parameter. |
INVALID_BINDER |
Binder not found. | The specified binder id value was not found in your vault. |
INSUFFICIENT_ACCESS |
User {USER ID} authorized for view or export on binder. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
INSUFFICIENT_ACCESS |
User {USER ID} not licensed for this permission [VAULT ACTIONS API ACCESS]. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
INSUFFICIENT_ACCESS |
User {USER ID} not authorized for FTP download. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
OPERATION_NOT_ALLOWED |
Binder export not enabled for this vault. | The binder cannot be exported because the "Binder Export" function has not been enabled for the vault. |
History
Since v14
Export Binder Sections
Use this request to export only specific sections and documents from the latest version of a binder in your vault. This will export only parts of the binder, not the complete binder.
Before submitting this request:
- The Export Binder feature must be enabled in your vault.
- You must be assigned permissions to use the API.
- You must have the Export Binder permission.
- You must have the View Document permission for the binder.
- Only documents in the binder which you have the View Document permission are available to export.
Request
To export the latest version, Send POST
to /api/{version}/objects/binders/{binder_id}/actions/export
To export a specific version, Send POST
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/actions/export
Headers
Input Content-Type
- JSON application/json
or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Input
Create a CSV or JSON input file with the id
values of the binder sections and/or documents to be exported.
To retrieve a list of all nodes from a binder, Send GET
to /api/{version}/objects/binders/{binder_id}?depth=all
. You may include any number of valid nodes. Vault will ignore id
values which are invalid, but will export all which are valid.
For example, the abridged response below includes two nodes from a binder. Node "id": "1415381339215" is a section (folder) and "id": "1415381339220" is a document node.
Exporting a binder section node will automatically include all of its subsections and documents therein.
"nodes": [
{
"properties": {
"section_number__v": "02.01.01",
"name__v": "Investigator Brochure",
"order__v": 0,
"type__v": "section",
"id": "1415381339215",
"parent_id__v": "1415381339209"
},
"nodes": [
{
"properties": {
"document_id__v": 18,
"name__v": "CHC032-194 Investigator Brochure",
"order__v": 0,
"type__v": "document",
"id": "1415381339220",
"parent_id__v": "1415381339215"
}
},
Example CSV Input File
To export just this one section and document from the binder, we would submit the following input file:
id
1415381339215
1415381339220
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Binders\export-binder-sections.csv" \
https://myvault.veevavault.com/api/v14.0/objects/binders/454/1/0/actions/export
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path\name of the CSV input file is specified.
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Job for Binder Export Started",
"URL": "https://myvault.veevavault.com/api/v14.0/services/jobs/1201",
"job_id": 1201
}
Details
On SUCCESS, the response includes the following information:
URL
- The URL to retrieve the current status of the binder export job.job_id
- The Job ID value is used to retrieve the status and results of the binder export request (described below).
Errors
Error Type | Error Message | Comments |
---|---|---|
METHOD_NOT_SUPPORTED |
Requested method {METHOD} not supported. | You must use the HTTP POST method for this request. |
INVALID_DATA |
Invalid input parameter value for {PARAMETER}. | You have provided a parameter which is invalid. The error message includes the name of the invalid parameter. |
INVALID_BINDER |
Binder not found. | The specified binder id value was not found in your vault. |
INSUFFICIENT_ACCESS |
User {USER ID} authorized for view or export on binder. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
INSUFFICIENT_ACCESS |
User {USER ID} not licensed for this permission [VAULT ACTIONS API ACCESS]. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
INSUFFICIENT_ACCESS |
User {USER ID} not authorized for FTP download. | The logged-in API user must have API permission and proper permissions to perform an export on the requested binder. |
OPERATION_NOT_ALLOWED |
Binder export not enabled for this vault. | The binder cannot be exported because the "Binder Export" function has not been enabled for the vault. |
History
Since v14
Retrieve Binder Export Status
After submitting a request to export a binder from your vault, you can query vault to determine the status of the request.
Before submitting this request:
- You must have previously requested a binder export job (via the API).
- You must have a valid
job_id
value (retrieved from the export binder request above).
Request
Send GET
to /api/{version}/services/jobs/{job_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{job_id}
- The id
value of the requested export job. This is returned with the export binder requests above.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/services/jobs/1201
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "OK",
"data": {
"id": 1201,
"status": "SUCCESS",
"method": "POST",
"links": [
{
"rel": "self",
"href": "/api/v14.0/services/jobs/1601",
"method": "GET",
"accept": "application/json"
},
{
"rel": "artifacts",
"href": "/api/v14.0/objects/binders/actions/export/1201/results",
"method": "GET",
"accept": "application/json"
}
],
"created_by": 44533,
"created_date": "2015-12-08T18:14:42.000Z",
"run_start_date": "2015-12-08T18:14:43.000Z",
"run_end_date": "2015-12-08T18:14:44.000Z"
}
}
Details
On SUCCESS, the response includes the following information:
Metadata Field | Description |
---|---|
id |
The Job ID value for the binder being exported. |
status |
The status of the binder export job. |
method |
The method used to export the binder. |
links |
The endpoints and methods to retrieve the status and results of the binder export job. |
created_by |
The user who started the export binder job. |
created_date |
The date and time when the export binder job was started. |
run_start_date |
The date and time when the export binder job was started. |
run_end_date |
The date and time when the export binder job was completed. |
History
Since v14
Retrieve Binder Export Results
After submitting a request to export a binder from your vault, you can query vault to determine the results of the request.
Before submitting this request:
- You must have previously requested a binder export job (via the API) which is no longer active.
- You must have a valid
job_id
value (retrieved from the export binder request above).
Request
Send GET
to /api/{version}/objects/binders/actions/export/{job_id}/results
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{job_id}
- The id
value of the requested export job. This is returned with the export binder requests above.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/actions/export/1201/results
Response
{
"responseStatus": "SUCCESS",
"job_id": 1201,
"id": 454,
"major_version_number__v": 1,
"minor_version_number__v": 0,
"file": "/1201/454/1_0/Nyaxa Compliance Package.zip",
"user_id__v": 44533
}
Details
On SUCCESS, the response includes the following information:
Field Name | Description |
---|---|
job_id |
The Job ID value of the binder export request. |
id |
The id value of the exported binder. |
major_version_number__v |
The major version number of the exported binder. |
minor_version_number__v |
The minor version number of the exported binder. |
file |
The path/location of the downloaded binder ZIP file. |
user_id__v |
The id value of the Vault user who initiated the binder export job. |
History
Since v14
Download Exported Binder Files via FTP
Once your binder export job has been successfully completed, you can download the files from your FTP Staging Server.
Prerequisites
Before downloading the files, the following conditions must be met:
- The binder export job must have been successfully completed.
- The API user must have a permission set which allows them FTP download permissions.
Downloading the Files
The exported binder is packaged in a ZIP file on your FTP Staging Server.
Binder Relationships
Learn about Binder Relationships in Vault Help.
Retrieve Binder Relationship
Request
Send GET
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships/{relationship_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
{relationship_id}
- The binder relationship id
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/versions/0/3/relationships/202
Response
{
"responseStatus": "SUCCESS",
"responseMessage": null,
"errorCodes": null,
"relationships": [
{
"relationship": {
"source_doc_id__v": 566,
"relationship_type__v": "supporting_documents__vs",
"created_date__v": "2015-03-24T22:37:20.000Z",
"id": 202,
"target_doc_id__v": 254,
"created_by__v": 46916
}
}
],
"errorType": null
}
Details
Field Name | Description |
---|---|
id |
Relationship ID. |
source_doc_id |
Document ID of the source document. |
relationship_type__v |
Relationship type |
created_by__v |
User ID of user who created the relationship |
created_date__v |
Timestamp when the relationship was created |
target_doc_id__v |
Document ID for target document |
target_major_version__v |
Major version of the target document; null values indicate that the relationship applies to all major versions |
target_minor_version__v |
Minor version of the target document; null values indicate that the relationship applies to all minor versions |
History
Since v5
Create Binder Relationship
Request
Send POST
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Inputs
Set the target_doc_id__v
to the document id
of the "target document" to which a relationship will be established with the binder.
Set the relationship_type__v
to the field value of one of the desired relationshipTypes
from the "Documents Relationships Metadata" call.
[Optional] - If you're creating a relationship with a specific version of the target document, set the target_major_version__v
to the major version number of the target document.
[Optional] - If you're creating a relationship with a specific version of the target document, set the target_minor_version__v
to the minor version number of the target document.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "target_doc_id__v=13" \
-d "relationship_type__v=supporting_documents__vs" \
-d "target_major_version__v=0" \
-d "target_minor_version__v=1" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/versions/0/3/relationships
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Document relationship successfully created.",
"id": 202
}
On SUCCESS, Vault returns the relationship id
of the newly created binder relationship.
History
Since v5
Delete Binder Relationship
Request
Send DELETE
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationships/{relationship_id}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
{relationship_id}
- The binder relationship id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/versions/0/4/relationships/202
Response
{
"responseStatus": "SUCCESS",
"responseMessage": "Document relationship successfully deleted.",
"id": 202
}
On SUCCESS, Vault deletes the requested relationship and returns the relationship id
of the deleted relationship.
History
Since v5
Binder Sections
Retrieve Binder Sections
Retrieve all sections (documents and subfolders) in a binder's top-level root node or sub-level node.
Request
Send GET
to /api/{version}/objects/binders/{binder_id}/sections
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Options
/api/{version}/objects/binders/{binder_id}/sections/{node_id}
- Retrieve all sections (documents and subfolders) in a binder's sub-level node. If not included, all sections from the binder's top-level root node will be returned.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29/sections
Response
{
"responseStatus": "SUCCESS",
"binder": {
"nodes": [
{
"properties": {
"document_id__v": 7,
"name__v": "VeevaProm Information",
"order__v": 0,
"type__v": "document",
"id": "1457556160448:810987462",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 2,
"name__v": "VeevaProm Consumer Info",
"order__v": 300,
"type__v": "document",
"id": "1457559259279:-602158059",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"document_id__v": 5,
"name__v": "VeevaProm Brochure",
"order__v": 301,
"type__v": "document",
"id": "1457556176044:-743019200",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"section_number__v": null,
"name__v": "First Section Folder",
"order__v": 401,
"type__v": "section",
"id": "1457560333810:-909497856",
"parent_id__v": "rootNode"
}
},
{
"properties": {
"section_number__v": null,
"name__v": "Second Section Folder",
"order__v": 501,
"type__v": "section",
"id": "1457560348267:1179700878",
"parent_id__v": "rootNode"
}
}
]
}
}
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29/sections/1457560348267:1179700878
Response
{
"responseStatus": "SUCCESS",
"node": {
"properties": {
"section_number__v": null,
"name__v": "Second Section Folder",
"order__v": 501,
"type__v": "section",
"id": "1457560348267:1179700878",
"parent_id__v": "rootNode"
},
"nodes": [
{
"properties": {
"document_id__v": 24,
"name__v": "Nyaxa Information Packet",
"order__v": 0,
"type__v": "document",
"id": "1457560406595:-2060980086",
"parent_id__v": "1457560348267:1179700878"
}
},
{
"properties": {
"document_id__v": 23,
"name__v": "Nyaxa and Your Health",
"order__v": 100,
"type__v": "document",
"id": "1457560409271:-1499449603",
"parent_id__v": "1457560348267:1179700878"
}
},
{
"properties": {
"document_id__v": 25,
"name__v": "Nyaxa Prescribing Information",
"order__v": 200,
"type__v": "document",
"id": "1457560412997:-1622511549",
"parent_id__v": "1457560348267:1179700878"
}
}
]
}
}
Details
Field Name | Description |
---|---|
nodes [n] |
List of all nodes (documents and sections) at each level in the binder. |
properties [n] |
List of all properties associated with each document or section node. |
hierarchy__v |
Specifies a single record from the hierarchy__v object that has been mapped this binder node. |
section_number__v |
Optional number which can be added to each section. |
order__v |
Order of the document or section within the binder or within another section of the binder. |
type |
Type of node (document or section). |
document_id__v |
The document ID of the document in the binder. This is the same as the document's actual document id |
id |
The document ID or section ID specific to the binder. For documents, this is different from the document's actual document id . |
parent_id__v |
Section ID of the parent node, e.g., "rootNode". |
name__v |
Name of the document or section. For sections, this is the name of the "subfolder" seen in the binder hierarchy in the UI. |
major_version_number__v |
If the document binding rule is "specific", this is major version number of the document. |
minor_version_number__v |
If the document binding rule is "specific", this is minor version number of the document. |
History
Since v5
Retrieve Binder Version Section
For a specific version, retrieve all sections (documents and subfolders) in a binder's top-level root node or sub-level node.
Request
Send GET
to /api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/sections
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{major_version_number__v}
- The binder major_version_number__v
field value.
{minor_version_number__v}
- The binder minor_version_number__v
field value.
Options
/api/{version}/objects/binders/{binder_id}/versions/{major_version_number__v}/{minor_version_number__v}/sections/{node_id}
- Retrieve all sections (documents and subfolders) in a binder's sub-level node. If not included, all sections from the binder's top-level root node will be returned.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29/versions/0/2/sections
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/29/versions/0/2/sections/1457560348267:1179700878
Response
See Retrieve Binder Sections response above.
History
Since v5
Create Binder Section
Create a new section in a binder.
Request
Send POST
to /api/{version}/objects/binders/{binder_id}/sections
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Input
Field Name | Description |
---|---|
name__v |
[Required] You must specify a name for the new section. |
section_number__v |
[Optional] You may enter a numerical value for the new section. |
parent_id__v |
[Optional] If the new section is going to be a subsection, enter the Node ID of the parent section. If left blank, the new section will become a top-level section in the binder. |
order__v |
[Optional] Enter the new section order arrangement within the parent section or within the binder (if the new section is a top-level section). An order__v=0 means the new section will be arranged in the first position. IF left blank, the new section will be arranged in the last position (bottom of the list). |
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name__v=VeevaProm Additional Information" \
-d "section_number__v=1.3" \
-d "parent_id__v=1427232809771:1381853041" \
-d "order__v=4" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/sections
Response
{
"responseStatus": "SUCCESS",
"id": "1427486900128:1467568099"
}
On SUCCESS, Vault returns the Node ID of the newly created section. This is unique within the binder, regardless of level.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
REQUIRED_FIELD_NOT_PRESENT |
Section name not present. | |
INVALID_SECTION |
Parent section ID is not a valid section. |
History
Since v5
Update Binder Section
Update a section in a binder.
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/sections/{node_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
of the section.
Input
Configure one or more of the following fields with values. These are all optional.
Field Name | Description |
---|---|
name__v |
Change the name of the binder section. |
section_number__v |
Update the section number value. |
order__v |
The ordinal position (1, 2, 3, etc.) where the section will be moved. For example, if the section's current order is 1 (first section in the binder or subsection) and you want to move it down one, set order__v=2 . If the order is greater than the available positions, the section will be moved to the last position. When using only order__v (without parent_id__v ), the section will be moved within the same higher level section. |
parent_id__v |
To move the section to a different section in the binder, include the value of the parent node where it will be moved. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name__v=VeevaProm Additional Information" \
-d "section_number__v=3" \
-d "parent_id__v=rootNode" \
-d "order__v=4" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/sections/1427232809771:1381853041
Response
{
"responseStatus": "SUCCESS",
"id": "1427486900128:1467568099"
}
On SUCCESS, Vault returns the Node ID of the newly created section. This is unique within the binder, regardless of level.
Errors
Error Type | Error Message |
---|---|
INVALID_BINDER |
ID passed is not for a binder. |
REQUIRED_FIELD_NOT_PRESENT |
Section name not present. |
INVALID_SECTION |
Parent section ID is not a valid section. |
History
Since v5
Delete Binder Section
Delete a section from a binder.
Request
Send DELETE
to /api/{version}/objects/binders/{binder_id}/sections/{node_id}
By deleting the section, it will be removed from its parent binder and all documents will be unlinked from the binder. If there are sub-sections and documents under the current section, they will be deleted (for sections) and unlinked (for documents) as well.
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/sections/1427486900128:1467568099
Response
{
"responseStatus": "SUCCESS",
"id": "1427486900128:1467568099"
}
On SUCCESS, Vault returns the Node ID of the deleted section.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_SECTION |
Section ID is not a valid section |
History
Since v5
Binder Documents
Add Document to Binder
Add a document to a binder.
Request
Send POST
to /api/{version}/objects/binders/{binder_id}/documents
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Inputs
Field Name | Description |
---|---|
document_id__v |
[Required] ID of the document being added to the binder. |
parent_id__v |
[Required] Section ID of the parent section, if the document will be in a section rather than top-level. Note: the section ID is unique no matter where it is in the binder hierarchy. Blank means adding the document at the top-level binder. |
order__v |
[Optional] Order within the parent section or binder ("1" is the first position). Blank means add it as the last element in the binder or parent section. |
binding_rule__v |
[Optional] binding rule indicating which version of the document will be linked to the binder and the ongoing behavior. Options are: default (bind to the latest available version (assumed if binding_rule is blank)), steady-state (bind to latest version in a steady-state), current (bind to current version), or specific (bind to a specific version). |
major_version_number__v |
If the binding_rule is specific , then this is required and indicates the major version of the document to be linked. Otherwise it is ignored. |
minor_version_number__v |
If the binding_rule is specific , then this is required and indicates the minor version of the document to be linked. Otherwise it is ignored. |
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "document_id__v=585" \
-d "parent_id__v=1427232809771:1381853041" \
-d "section_id__v=1" \
-d "binding_rule__v=steady-state" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/documents
Response
{
"responseStatus": "SUCCESS",
"id": "1427491342404:-1828014479"
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_DOCUMENT |
Document ID is not present. | |
INVALID_SECTION |
Parent section ID is not a valid section. | |
MISSING_MAJOR |
Document major version was not specified and binding rule was specific . |
|
MISSING_MINOR |
Document minor version was not specified and binding rule was specific . |
History
Since v5
Move Document in Binder
Move a document to a different position within a binder.
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/documents/{node_id}
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
field value.
Input
Field Name | Description |
---|---|
order__v |
The ordinal position (1, 2, 3, etc.) where the document will be moved. For example, if the document's current order is 1 (first document in the section) and you want to move it down one, set order__v=2 . If the order is greater than the available positions, the document will be moved to the last position in the section. When using only order__v (without parent_id__v ), the document will be moved within the same section. |
parent_id__v |
To move the document to a different section in the binder, include the value of the parent node where it will be moved. |
Note: There is a known issue which prevents users from moving documents into the first position within a section with only one API call. This occurs when an existing document has an order__v=0
(first position). Setting the document to be moved to an order__v=0
may not move it above the existing first document. Setting the order__v=-1
has no effect. To accomplish this type of move, you must move the existing document with an order__v=0
down to a lower order.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "parent_id__v=1457560333810:-909497856" \
-d "order__v=2" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/documents/1457559259279:-602158059
Response
{
"responseStatus": "SUCCESS",
"id": "1457559259279:-602158059"
}
On SUCCESS, Vault returns the new node ID of the document.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_DOCUMENT |
Document ID is not a valid document or the document is not linked to the selected binder. | |
INVALID_TARGET_SECTION |
Parent ID is not a valid section within the binder or the Binder ID itself. |
History
Since v5
Remove Document from Binder
Request
Send DELETE
to /api/{version}/objects/binders/{binder_id}/documents/{node_id}
By unlinking the document, you remove it from the specified location within the binder, this does not actually delete the document from Vault.
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/documents/1427491342404:-1828014479
Response
{
"responseStatus": "SUCCESS",
"id": "1427491342404:-1828014479"
}
On SUCCESS, Vault returns the Node ID of the deleted document.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_DOCUMENT |
Document ID is not present. |
History
Since v5
Binder Templates
Retrieve Binder Template Metadata
Retrieve the metadata which defines the shape of binder templates in your vault.
Request
Send GET
to /api/{version}/metadata/objects/binders/templates
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/binders/templates
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"name": "name__v",
"type": "String",
"requiredness": "required",
"max_length": 50,
"editable": true,
"multi_value": false
},
{
"name": "label__v",
"type": "String",
"requiredness": "required",
"max_length": 100,
"editable": true,
"multi_value": false
},
{
"name": "active__v",
"type": "Boolean",
"requiredness": "required",
"editable": true,
"multi_value": false
},
{
"name": "type__v",
"type": "Component",
"requiredness": "required",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "subtype__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "classification__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "filing_model__v",
"type": "Object",
"requiredness": "optional",
"editable": true,
"multi_value": false
}
]
}
Details
Field Name | Description |
---|---|
name__v |
Binder template name, e.g., binder_template_1__c . This is used in the API when retrieving, creating, updating, or deleting binder templates. |
label__v |
Binder template label, e.g., "Binder Template 1". This is the name users see in the UI when selecting a binder template. |
type__v |
Vault document type to which the template is associated. |
subtype__v |
Vault document subtype to which the template is associated. This field is only required if the template exists at the document subtype or classification level. |
classification__v |
Vault document classification to which the template is associated. This field is only required if the template exists at the document classification level. |
filing_model__v |
eTMF vaults only. The filing model for the binder template. |
Metadata Field | Description |
---|---|
name |
The binder template field name (name__v , label__v , type__v , etc.). |
type |
The binder template field type. This can be one of String, Boolean, Component, or Object (eTMF vaults). |
requiredness |
Indicates whether or not a value must be added when creating a binder template. These include: - required : A value must be added.- conditional : For a template to exist at the document subtype or classification level, this is required. |
editable |
Boolean (true/false) field indicating whether or not a value can be added or edited by a user when creating or updating a binder template. |
multi_value |
Boolean (true/false) field indicating whether or not the field can have multiple values. |
component |
The component property applies to the type__v , subtype__v , and classification__v fields and defines the data type that can be set into this field. |
History
Since v13
Retrieve Binder Template Node Metadata
Retrieve the metadata which defines the shape of binder template nodes in your vault.
Request
Send GET
to /api/{version}/metadata/objects/binders/templates/bindernodes
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
or CSV text/csv
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/objects/binders/templates/bindernodes
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"name": "id",
"type": "id",
"requiredness": "required",
"editable": true,
"multi_value": false
},
{
"name": "parent_id__v",
"type": "id",
"requiredness": "optional",
"editable": true,
"multi_value": false
},
{
"name": "order__v",
"type": "Number",
"requiredness": "optional",
"max_value": 2147483647,
"min_value": 0,
"scale": 0,
"editable": true,
"multi_value": false
},
{
"name": "node_type__v",
"type": "Enum",
"requiredness": "required",
"editable": true,
"multi_value": false,
"enums": [
"planned_document",
"section"
]
},
{
"name": "label__v",
"type": "String",
"requiredness": "required",
"max_length": 100,
"editable": true,
"multi_value": false
},
{
"name": "number__v",
"type": "String",
"requiredness": "optional",
"max_length": 50,
"editable": true,
"multi_value": false
},
{
"name": "lifecycle__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Documentlifecycle"
},
{
"name": "type__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "subtype__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "classification__v",
"type": "Component",
"requiredness": "conditional",
"editable": true,
"multi_value": false,
"component": "Doctype"
},
{
"name": "document_template__v",
"type": "String",
"requiredness": "conditional",
"max_length": 50,
"editable": true,
"multi_value": false
}
]
}
Details
Binder "nodes" are individual sections or documents in the binder template hierarchy. These can include folders and subfolders in the binder or documents existing within the sections.
Field Name | Description |
---|---|
id |
For a given binder, these are the binder node (section or planned document) IDs. |
parent_id__v |
For a given binder template node, this is the node ID of its parent node. The top-level node is the rootNode . |
node_type__v |
Binder node types include section and planned_document (content placeholder documents within the binder template). |
label__v |
Binder template node label (name). For section node types, this is the name of the folder within the binder template. Example: "label__v": "Operational Procedures" . For planned document node types, this is the name of the content placeholder document and may include document field tokens. Example: "label__v": "${study_b} - ${site_b} Operational Procedure" . |
number__v |
These apply to binder section node types and are a numerical representation of the section's hierarchy within the binder template. Example: Given two folders in a binder (under the root node), each containing three subfolders, the first and second folder numbers would be 01 and 02, respectively. The three subfolder numbers within the first and second folders would then be 01.01, 01.02, 01.03 and 02.01, 02.02, 02.03, respectively. |
order__v |
These apply to binder section and planned_document node types and are a numerical representation of the node's hierarchy within a given node. |
type__v |
Name of the document type to which templates are associated. |
subtype__v |
Name of the document subtype to which templates are associated. |
classification__v |
Name of the document classification to which templates are associated. |
lifecycle__v |
Name of the binder lifecycle to which templates are associated. |
document_template__v |
Name of the planned document template. |
milestone_type__v |
eTMF vaults only. Name of the milestone type associated with the planned document template. |
hierarchy_mapping__v |
eTMF vaults only. Object ID pointing to the lowest level in the TMF reference model. |
Metadata Field | Description |
---|---|
name |
The binder template node field name (id , parent_id__v , node_type__v , etc.). |
type |
The binder template field type. This can be one of ID, String, Number, Enum, or Component. |
requiredness |
Indicates whether or not a value must be added when creating a binder template. These include: - required : A value must be added.- conditional : For a template to exist at the document subtype or classification level, this is required. |
editable |
Boolean (true/false) field indicating whether or not a value can be added or edited by a user when creating or updating a binder template. |
multi_value |
Boolean (true/false) field indicating whether or not the field can have multiple values. |
component |
The component property applies to the type__v , subtype__v , classification__v , and lifecycle__v fields and defines the data type that can be set into this field. |
History
Since v13
Retrieve Binder Template Collection
Retrieve the collection of all binder templates in your vault.
Request
Send GET
to /api/{version}/objects/binders/templates
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"name__v": "study_site_level_file_tmf_rm_30__c",
"label__v": "Study Site Level File TMF RM 2.0",
"active__v": true,
"type__v": "trial_master_file__v",
"subtype__v": null,
"classification__v": null,
"filing_model__v": "0MO000000000101"
},
{
"name__v": "study_site_level_file_tmf_rm_20__c",
"label__v": "Study Site Level File TMF RM 2.0",
"active__v": "true",
"type__v": "site_master_file__v",
"subtype__v": null,
"classification__v": null,
"filing_model__v": "0MO000000000102"
}
]
}
Details
The response lists all binder templates which have been added to the vault. Shown above, two binder templates exist in our vault. Both exist at the document type level and are intended for use with the compliance_package__v
type. For information about the document template metadata, refer to the "Retrieve Binder Template Attributes" response below.
History
Since v13
Retrieve Binder Template Attributes
Retrieve the attributes of a specific binder template in your vault.
Request
Send GET
to /api/{version}/objects/binders/templates/{template_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{template_name}
- The binder template name__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/study_site_level_file_tmf_rm_20__c
Example JSON Response
{
"responseStatus":"SUCCESS",
"data":[
{
"name__v": "study_site_level_file_tmf_rm_20__c",
"label__v": "Study Site Level File TMF RM 2.0",
"active__v": "true",
"type__v": "site_master_file__v",
"subtype__v": null,
"classification__v": null,
"filing_model__v": "0MO000000000102"
}
]
}
Details
The response lists all attributes configured on a specific binder template in the vault. Shown above are the attributes configured on the specified template:
Field Name | Description |
---|---|
name__v |
Name of the binder template. This value is not displayed to end users in the UI. It is seen by Admins and used in the API. |
label__v |
Label of the binder template. When users in the UI create binders from templates, they see this value in the list of available templates. |
type__v |
Vault document type to which the template is associated. |
subtype__v |
Vault document subtype to which the template is associated. This field is only displayed if the template exists at the document subtype or classification level. |
classification__v |
Vault document classification to which the template is associated. This field is only displayed if the template exists at the document classification level. |
filing_model__v |
eTMF vaults only. Filing model for the binder template. |
History
Since v13
Retrieve Binder Template Node Attributes
Retrieve the attributes of each node (folder/section) of a specific binder template in your vault.
Request
Send GET
to /api/{version}/objects/binders/templates/{template_name}/bindernodes
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The binder template name__v
field value.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/study_site_level_file_tmf_rm_20__c/bindernodes
Response
{
"responseStatus": "SUCCESS",
"data": [
{
"id": "5148",
"parent_id__v": "studySiteLevelFileTMFRM20",
"order__v": "0",
"node_type__v": "section",
"label__v": "Trial Management",
"number__v": "01"
},
{
"id": "9647",
"parent_id__v": "studySiteLevelFileTMFRM20",
"order__v": "100",
"node_type__v": "section",
"label__v": "Central Trial Documents",
"number__v": "02"
},
{
"id": "0908",
"parent_id__v": "studySiteLevelFileTMFRM20",
"order__v": "200",
"node_type__v": "section",
"label__v": "Site Management",
"number__v": "03"
},
{
"id": "6671",
"parent_id__v": "5148",
"order__v": "0",
"node_type__v": "section",
"label__v": "Trial Oversight",
"number__v": "01.01"
},
{
"id": "4509",
"parent_id__v": "5148",
"order__v": "100",
"node_type__v": "section",
"label__v": "General",
"number__v": "01.02"
},
{
"id": "3623",
"parent_id__v": "6671",
"order__v": "0",
"node_type__v": "section",
"label__v": "Operational Procedure",
"number__v": "01.01.01",
"hierarchy_mapping__v": "00H00484"
},
{
"id": "5575",
"parent_id__v": "6671",
"order__v": "100",
"node_type__v": "section",
"label__v": "Recruitment Plan",
"number__v": "01.01.02",
"hierarchy_mapping__v": "00H00488"
},
{
"id": "StudyBSiteBOperationalProcedur",
"parent_id__v": "3623",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Operational Procedure",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "trial_management__vs",
"subtype__v": "trial_oversight__vs",
"classification__v": "operational_procedure_manual__vs"
},
{
"id": "StudyBSiteBRecruitmentPlan",
"parent_id__v": "5575",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Recruitment Plan",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "trial_management__vs",
"subtype__v": "trial_oversight__vs",
"classification__v": "recruitment_plan__vs"
},
{
"id": "9454",
"parent_id__v": "4509",
"order__v": "0",
"node_type__v": "section",
"label__v": "Tracking Information",
"number__v": "01.02.01",
"hierarchy_mapping__v": "00H00511"
},
{
"id": "5014",
"parent_id__v": "4509",
"order__v": "100",
"node_type__v": "section",
"label__v": "Filenote",
"number__v": "01.02.02",
"hierarchy_mapping__v": "00H00515"
},
{
"id": "StudyBSiteBOperationalProcedu1",
"parent_id__v": "9454",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Tracking Information",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "trial_management__vs",
"subtype__v": "general__vs",
"classification__v": "tracking_information__vs"
},
{
"id": "StudyBSiteBFileNote",
"parent_id__v": "5014",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} File Note",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "trial_management__vs",
"subtype__v": "general__vs",
"classification__v": "filenote__vs"
},
{
"id": "2443",
"parent_id__v": "9647",
"order__v": "0",
"node_type__v": "section",
"label__v": "Trial Documents",
"number__v": "02.01"
},
{
"id": "0413",
"parent_id__v": "9647",
"order__v": "100",
"node_type__v": "section",
"label__v": "Subject Information Sheet",
"number__v": "02.02"
},
{
"id": "5118",
"parent_id__v": "2443",
"order__v": "0",
"node_type__v": "section",
"label__v": "Protocol",
"number__v": "02.01.01",
"hierarchy_mapping__v": "00H00536"
},
{
"id": "StudyBSiteBTrialProtocol",
"parent_id__v": "5118",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Trial Protocol",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "central_trial_documents__vs",
"subtype__v": "trial_documents__vs",
"classification__v": "protocol__vs"
},
{
"id": "StudyBSiteBSubjectInformationS",
"parent_id__v": "0413",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Subject Information Sheet",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "central_trial_documents__vs",
"subtype__v": "subject_documents__vs",
"classification__v": "subject_information_sheet__vs"
},
{
"id": "9135",
"parent_id__v": "0908",
"order__v": "0",
"node_type__v": "section",
"label__v": "Site Selection",
"number__v": "03.01"
},
{
"id": "StudyBSiteBConfidentialityAgre",
"parent_id__v": "9135",
"order__v": "0",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Confidentiality Agreement",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "site_management__vs",
"subtype__v": "site_selection__vs",
"classification__v": "confidentiality_agreement__vs"
},
{
"id": "StudyBSiteBSiteContacts",
"parent_id__v": "9135",
"order__v": "100",
"node_type__v": "planned_document",
"label__v": "${study_b} - ${site_b} Site Contacts",
"lifecycle__v": "etmf_lifecycle__vs",
"type__v": "site_management__vs",
"subtype__v": "site_selection__vs",
"classification__v": "site_contact_details__vs"
}
]
}
Details
The response lists all attributes configured on each node of a specific binder template in the vault. The binder template shown above has six nodes.
Field Name | Description |
---|---|
id |
The binder node (section or planned document) IDs. |
parent_id__v |
The node ID of a section or planned document's parent node. The top-level node is the rootNode . |
node_type__v |
Binder node types include section and planned_document (content placeholder documents within the binder template). |
label__v |
Label of the binder section or planned document. |
type__v |
Vault document type to which planned documents are associated. |
subtype__v |
Vault document subtype to which planned documents are associated. This field is only displayed if the planned document exists at the document subtype or classification level. |
classification__v |
Vault document classification to which planned documents are associated. This field is only displayed if the planned document exists at the document classification level. |
lifecycle__v |
Name of the binder lifecycle to which planned documents are associated. |
number__v |
These apply to binder section node types and are a numerical representation of the section's hierarchy within the binder template. Example: Given two folders in a binder (under the root node), each containing three subfolders, the first and second folder numbers would be 01 and 02, respectively. The three subfolder numbers within the first and second folders would then be 01.01, 01.02, 01.03 and 02.01, 02.02, 02.03, respectively. |
order__v |
These apply to binder section and planned_document node types and are a numerical representation of the node's hierarchy within a given node. |
hierarchy_mapping__v |
eTMF vaults only. Object ID pointing to the lowest level in the TMF reference model. |
History
Since v13
Create Binder Template
Create a new binder template in your vault.
See also: Bulk Create Binder Templates below.
Request
Send POST
to /api/{version}/objects/binders/templates
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Input
When creating binder templates, the following fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new binder template. If not included, Vault will use the specified label__v value to generate a value for the name__v field. |
label__v |
The label of the new binder template. This is the name users will see among the available binder templates in the UI. |
type__v |
The name of the document type to which the template will be associated. |
subtype__v |
The name of the document subtype to which the template will be associated. This is only required if associating the template with a document subtype. |
classification__v |
The name of the document classification to which the template will be associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the new binder template should be set to active, i.e., available for selection when creating a binder. |
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "label__v=Claim Binder Template" \
-d "type__v=claim__vs" \
-d "active__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates
In this example:
- The input format is set to
application/x-www-form-urlencoded
. - The response format is not set and will default to JSON.
- The
name__v
field is not included. Vault will use the specifiedlabel__v
field value to create thename__v=claim_binder_template__c
. - The
label__v
field specifies the binder template label "Claim Binder Template". This is what users will see among the available templates in the UI. - The document
type__v
is specified. This template is being created for binders oftype__v=claim__vs
. Since this exists at the document type level, the subtype and classification are not required. - The template is being set to
active__v=true
. It will be available for selection when creating a new binder.
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"responseStatus":"SUCCESS",
"name__v":"claim_binder_template__c"
}
]
}
On SUCCESS, Vault returns the name of the new binder template.
Errors
Refer to the Bulk Create Binder Templates Errors section below.
History
Since v13
Bulk Create Binder Templates
Create from 1-500 new binder templates in your vault.
See also: Create (Single) Binder Template above.
Request
Send POST
to /api/{version}/objects/binders/templates
Headers
Input Content-Type
- JSON application/json
or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Input
When creating binder templates, the following fields are required in all vaults:
Field Name | Description |
---|---|
name__v |
The name of the new binder templates. If not included, Vault will use the specified label__v value to generate a value for the name__v field. |
label__v |
The label of the new binder templates. This is the name users will see among the available binder templates in the UI. |
type__v |
The name of the document type to which the templates will be associated. |
subtype__v |
The name of the document subtype to which the templates will be associated. This is only required if associating the templates with document subtypes. |
classification__v |
The name of the document classification to which the templates will be associated. This is only required if associating the templates with document classifications. |
active__v |
Set to true or false to indicate whether or not the new binder templates should be set to active, i.e., available for selection when creating a binder. |
Example CSV Input
name__v |
label__v |
type__v |
subtype__v |
classification__v |
active__v |
---|---|---|---|---|---|
binder_template_1__c | First Binder Template | site_master_file__v | true | ||
Binder Template 2 | trial_master_file__v | true | |||
Binder Template 3 | central_trial_documents__vs | trial_documents__vs | protocol__vs | true | |
Binder Template 4 | central_trial_documents__vs | reports__vs | clinical_study_report__vs | false |
In this example input, we're creating four new binder templates in our vault:
- We've only specified the
name__v
value for the first template and given it a differentlabel__v
value. The other templates will inherit theirname__v
values from thelabel__v
values. - We've specified the document type, subtype, and classification to which each binder template will be associated.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Templates\add_binder_templates.csv" \
https://myvault.veevavault.com/api/v14.0/objects/documents/templates
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file in our local directory is specified.
Response
{
"responseStatus":"SUCCESS",
"data":[
{
"responseStatus":"SUCCESS",
"name":"binder_template_1__c"
},
{
"responseStatus":"SUCCESS",
"name":"binder_template_2__c"
},
{
"responseStatus":"SUCCESS",
"name":"binder_template_3__c"
},
{
"responseStatus":"FAILURE",
"errors":[
{
"type":"INVALID_DATA",
"message":"Error message describing why this template was not created."
}
]
}
]
}
On SUCCESS, Vault returns the names of the new binder templates.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DATA |
Cannot parse the 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). |
REQUIRED_PARAMETER |
Missing required parameter [{field_name}]. | A required field is missing from the input. The error message includes the missing field name. |
INVALID_VALUE |
Invalid value [{FIELD_VALUE]} specified for parameter [{PARAMETER}]. | A field value specified in the input is invalid. The error message includes invalid value and field name on which it is specified. |
INVALID_DATA |
Cannot create template : another template already exists with [name__v={specified name}]. | The name specified for the template is a duplicate of an existing binder template in your vault. |
INVALID_DATA |
Cannot create template : input already defines another template with [name__v={specified name}]. | The name specified for the template is a duplicate of another template name specified in the same input. |
INVALID_DATA |
String exceeds max length [{MAX_VALUE}]. | The string value exceeds the maximum length for the label__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{type}]. | An invalid value is specified for the type__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{subtype}] under [{Value specified for type__v }]. |
An invalid value is specified for the subtype__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{classification}] under [{Value specified for classification__v }]. |
An invalid value is specified for the classification__v field. |
History
Since v13
Create Binder Template Node
Create nodes in an existing binder template.
Request
Send POST
to /api/{version}/objects/binders/templates/{template_name}/bindernodes
Headers
Input Content-Type
- JSON application/json
or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The binder template name__v
field value.
Input
When creating binder template nodes, the following fields are required in all vaults:
Field Name | Description |
---|---|
id |
The ID of the binder node. This must be set to a unique number. |
parent_id__v |
If not set, the node will be created at the top level of the binder template. |
node_type__v |
Must be set to either section or planned_document . |
label__v |
The label of the binder template node (section or planned_document ). |
type__v |
The name of the document type to which the template will be associated. |
subtype__v |
The name of the document subtype to which the templates will be associated. This is only required if associating the template with a document subtype. |
classification__v |
The name of the document classification to which the template will be associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the binder template should be set to active, i.e., available for selection when creating a binder. |
Example CSV Input: Create Top-Level Section Binder Nodes
id |
node_type__v |
label__v |
order__v |
number__v |
parent_id__v |
---|---|---|---|---|---|
100 | section | Folder A | 1 | 01 | |
200 | section | Folder B | 2 | 02 | |
300 | section | Folder C | 3 | 03 |
In this example input, we're creating three new binder nodes in the template.
- These will be new
section
node types. - The required
parent_id__v
name is included but its value left blank. By default, the new sections will be added to the top-level in the binder hierarchy. - The optional section order and number are set. These define the position of the three new sections in the binder template hierarchy.
Example CSV Input: Create Sub-Level Section Binder Nodes
id |
node_type__v |
label__v |
order__v |
number__v |
parent_id__v |
---|---|---|---|---|---|
101 | section | SubFolder A1 | 1 | 01.01 | 100 |
102 | section | SubFolder A2 | 2 | 01.02 | 100 |
In this example input, we're creating three new binder nodes in the template.
- These will be new
section
node types. - The required
parent_id__v
name is included. If the values are left blank, the new sections will be added to the top-level in the binder hierarchy by default. - The optional section order and number are set. These define the position of the three new sections in the binder template hierarchy.
Example CSV Input: Create Planned Document Binder Node
id |
node_type__v |
label__v |
order__v |
parent_id__v |
type__v |
subtype__v |
classification__v |
lifecycle__v |
---|---|---|---|---|---|---|---|---|
101PD | planned_document | Planned Document A1 | 1 | 101 | promotional_piece__vs | advertisement__vs | web__vs | promotional_piece__vs |
In this example input, we're creating new binder node of the type planned_document
.
- The required
parent_id__v
name is included. If the values are left blank, the planned document will be added to the top-level in the binder hierarchy by default. - The optional section order and number are set. These define the position of the planned document in the binder template hierarchy.
Example
$ curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
--data-binary @"C:\Vault\Templates\add_binder_template_nodes.csv" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/binder_template_1__c/bindernodes
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file in our local directory is specified.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_DATA |
Cannot parse the request body. | |
REQUIRED_PARAMETER |
Missing required parameter [{field_name}]. | |
INVALID_VALUE |
Invalid value [{FIELD_VALUE]} specified for parameter [{PARAMETER}]. | |
INVALID_VALUE |
Invalid value [{FIELD_VALUE]} specified for parameter [{PARAMETER}]. One of [section, planned_document] is expected. | |
INVALID_DATA |
String exceeds max length [{MAX_VALUE}]. | The string value exceeds the maximum length for the label__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{type}]. | An invalid value is specified for the type__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{subtype}] under [{Value specified for type__v }]. |
An invalid value is specified for the subtype__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{classification}] under [{Value specified for classification__v }]. |
An invalid value is specified for the classification__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{LIFECYCLE}]. | An invalid value is specified for the lifecycle__v field. |
INVALID_DATA |
Value doesn't resolve to a valid [{DOCUMENT_TEMPLATE}] under the [{type}:{subtype}:{classification}]. | The value specified for the binder template doesn't resolve to a valid document template under for the specified document type/subtype/classification. |
INVALID_DATA |
Picklist [{Milestone Type Picklist Name}] does not contain [{Specified Picklist Entry Name}]. | A non-existing Milestone Type is specified. eTMF vaults only. |
INVALID_DATA |
One of [section,planned_document] is expected. | An invalid enum is specified for the node_type__v field. |
INVALID_DATA |
Positive whole numeric value is expected. | An invalid value is specified for the order__v field. |
History
Since v13
Update Binder Template
Update an existing binder template in your vault.
By changing the document type/subtype/classification, you can move an existing binder template to a different level of the document type hierarchy, effectively reclassifying the template.
See also: Bulk Update Binder Templates below.
Request
Send PUT
to /api/{version}/objects/binders/templates
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Input
You can update the following fields on binder templates:
Field Name | Description |
---|---|
name__v |
Change the name of an existing binder template. |
label__v |
Change the label of an existing binder template. This is the name users will see among the available binder templates in the UI. |
type__v |
Change the document type to which the template is associated. |
subtype__v |
Change the document subtype to which the template is associated. This is only required if associating the template with a document subtype. |
classification__v |
Change the document classification to which the template is associated. This is only required if associating the template with a document classification. |
active__v |
Set to true or false to indicate whether or not the binder template should be set to active, i.e., available for selection when creating a binder. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: text/csv" \
-d "active__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/binder_template_1__c
In this example:
- The input file format is set to
application/x-www-form-urlencoded
. - The response format is set to
text/csv
. - The
active__v
field is set tofalse
. We're changing the status of this binder template from "Active" to "Inactive".
Response (CSV)
responseStatus,name,errors
SUCCESS,binder_template_1__c,
On SUCCESS, Vault returns the name of the updated binder template.
History
Since v13
Bulk Update Binder Templates
Update from 1-500 binder templates in your vault.
By changing the document type/subtype/classification, you can move an existing binder template to a different level of the document type hierarchy, effectively reclassifying the template.
See also: Update [Single] Binder Template above.
Request
Send PUT
to /api/{version}/objects/binders/templates
Headers
Input Content-Type
- JSON application/json
(default) or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Input
You can update the following fields on binder templates:
Field Name | Description |
---|---|
name__v |
Change the name of existing binder templates. |
label__v |
Change the label of existing binder templates. This is the name users will see among the available binder templates in the UI. |
type__v |
Change the document type to which the templates are associated. |
subtype__v |
Change the document subtype to which the templates are associated. This is only required if associating the templates with document subtypes. |
classification__v |
Change the document classification to which the templates are associated. This is only required if associating the templates with document classifications. |
active__v |
Set to true or false to indicate whether or not the binder templates should be set to active, i.e., available for selection when creating a binder. |
Example CSV Input
name__v |
label__v |
active__v |
---|---|---|
binder_template_2__c | Second Binder Template | true |
binder_template_3__c | Binder Template 3 | true |
binder_template_4__c | Binder Template 4 | false |
In this example input, we're updating three existing binder templates in our vault.
- On the first template, we're updating both the
name__v
andlabel__v
values. - On the second template, we're updating the
name__v
value and setting theactive__v
value totrue
. - On the third template, we're updating the
name__v
value and setting theactive__v
value tofalse
.
Including a binder field name in the input but leaving its value blank will clear existing values from the field.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \
--data-binary @"C:\Vault\Templates\update_binder_templates.csv" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates
In this example:
- The input file format is set to CSV.
- The response format is not set and will default to JSON.
- The path/name of the CSV input file in our local directory is specified.
Response (CSV)
responseStatus,name,errors
SUCCESS,binder_template_2__c,
SUCCESS,binder_template_3__c,
SUCCESS,binder_template_4__c,
On SUCCESS, Vault returns the names of the updated binder templates.
History
Since v13
Replace Binder Template Nodes
Replace all binder nodes in an existing binder template. This action removes all existing nodes and replaces them with those specified in the input.
Request
Send PUT
to /api/{version}/objects/binders/templates/{template_name}/bindernodes
Headers
Input Content-Type
- JSON application/json
(default) or CSV text/csv
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The binder template name__v
field value.
Example CSV Input
See the Create Binder Template Node above for example inputs, which are the same as those used in this request.
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/binder_template_1__c
History
Since v13
Delete Binder Template
Delete an existing binder template from your vault.
Request
Send DELETE
to /api/{version}/objects/binders/templates/{template_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{template_name}
- The binder template name__v
field value.
Example
$ curl -X DELETE -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/objects/binders/templates/binder_template_1__c
Response
json
{
"responseStatus": "SUCCESS"
}
`
Errors
Error Type | Error Message | Comments |
---|---|---|
INSUFFICIENT_ACCESS |
User does not have sufficient privileges to perform the action. | You are not assigned permission to complete the request. |
METHOD_NOT_SUPPORTED |
The requested method {METHOD} is not supported. | Use the HTTP DELETE method for this request. |
MALFORMED_URL |
The resource {NAME} does not exist. | The specified binder template name could not be found in your vault. |
History
Since v13
Binding Rules
Learn about Version Binding in Vault Help.
Update Binding Rule
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/binding_rule
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
Input
Field Name | Description |
---|---|
binding_rule__v |
[Required] Indicates which binding rule to apply (which document versions to link to the section). Options are: default (bind to the latest available version (assumed if binding_rule is blank)), steady-state (bind to latest version in a steady-state), or current (bind to current version). |
binding_rule_override__v |
[Required] Set to true or false to indicate if the specified binding rule should override documents or sections which already have binding rules set. If set to true , the binding rule is applied to all documents and sections within the current section. If blank or set to false , the binding rule is applied only to documents and sections within the current section that do not have a binding rule specified. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "binding_rule__v=steady-state" \
-d "binding_rule_override__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/binding_rule
Response
{
"responseStatus": "SUCCESS",
"id": 566
}
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_BINDING_RULE |
Binder rule not recognized. |
History
Since v5
Update Binder Section Binding Rule
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/sections/{node_id}/binding_rule
Binding rule setting applies to the current section and all sub-sections.
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
field value.
Input
Field Name | Description |
---|---|
binding_rule__v |
[Required] Indicates which binding rule to apply (which document versions to link to the section). Options are: default (bind to the latest available version (assumed if binding_rule is blank)), steady-state (bind to latest version in a steady-state), or current (bind to current version). |
binding_rule_override__v |
[Required] Set to true or false to indicate if the specified binding rule should override documents or sections which already have binding rules set. If set to true , the binding rule is applied to all documents and sections within the current section. If blank or set to false , the binding rule is applied only to documents and sections within the current section that do not have a binding rule specified. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "binding_rule__v=steady-state" \
-d "binding_rule_override__v=true" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/sections/1427232809771:1381853041/binding_rule
Response
{
"responseStatus": "SUCCESS",
"id": "1427491342404:-1828014479"
}
On SUCCESS, Vault returns the Node ID of the updated section.
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_SECTION |
Section ID is not a valid section. |
History
Since v5
Update Binder Document Binding Rule
Request
Send PUT
to /api/{version}/objects/binders/{binder_id}/documents/{node_id}/binding_rule
Headers
Input Content-Type
- Name-Value Pair application/x-www-form-urlencoded
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{binder_id}
- The binder id
field value.
{node_id}
- The binder node id
field value.
Input
Field Name | Description |
---|---|
binding_rule__v |
[Optional] Indicates which binding rule to apply (which document versions to link to the section). Options are: default (bind to the latest available version (assumed if binding_rule is blank)), steady-state (bind to latest version in a steady-state), current (bind to current version), or specific (bind to a specific version). |
major_version_number__v |
If the binding_rule is specific , then this is required and indicates the major version of the document to be linked. Otherwise it is ignored. |
minor_version_number__v |
If the binding_rule is specific , then this is required and indicates the major version of the document to be linked. Otherwise it is ignored. |
Example
$ curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "binding_rule__v=specific" \
-d "major_version_number__v=1" \
-d "minor_version_number__v=0" \
https://myvault.veevavault.com/api/v14.0/objects/binders/566/documents/1427491342404:-1828014479/binding_rule
Response
{
"responseStatus": "SUCCESS",
"id": "1427491342404:-1828014479"
}
On SUCCESS, Vault returns the Node ID of the updated document node within the binder
Errors
Error Type | Error Message | Comments |
---|---|---|
INVALID_BINDER |
ID passed is not for a binder. | |
INVALID_DOCUMENT |
Document ID is not a valid document or the document is not linked to the selected binder. |
History
Since v5
Vault Objects
Each vault is configured with a set of standard objects (product__v
, country__v
, study__v
, etc.). These vary by application and configuration.
Admins may also create custom objects (region__c
, agency__c
, manufacturer__c
, etc.). Vault limits the total number of custom objects that Admins can create in a single vault. By default, the limit is 20.
- The API supports retrieval of Vault Objects and their metadata.
- The API does not support creating or updating Vault Objects. This must be done by Admin in the UI.
Each object can have multiple object records. For example, the product__v
object may have records for products named CholeCap
, Nyaxa
, and Wonderdrug
. All object records are user-defined.
- The API supports retrieval of Vault Object Records and their metadata.
- The API supports creating, updating, and deleting object records.
Learn about Vault Objects & Fields in Vault Help.
Vault Object Metadata
You can retrieve object metadata by sending a GET
request to the /api/{version}/metadata/vobjects/{OBJECT_NAME}
See the full request below.
The tables below provide detailed information about metadata available in API v14.0 and later.
Object Fields (Default)
When creating a new custom object, the following fields are added by default:
Field Name | Default Field Label | Field Type | Description | Required | Editable | Queryable |
---|---|---|---|---|---|---|
id |
ID | id | Object record ID. Unique object identifier (primary). Alphanumeric value. | System-Managed | False | True |
name__v |
Name | String | Object record name. Unique object record identifier. | True * | True * | True |
status__v |
Status | Picklist | Either active__v or inactive__v . |
False | True | True |
created_by__v |
Created By | Object | Vault user ID of the person who created the object record. | System-Managed | False | True |
created_date__v |
Created Date | DateTime | The date and time when the object record was created. | System-Managed | False | True |
modified_by__v |
Modified By | Object | Vault user ID of the person who last modified the object record. | System-Managed | False | True |
modified_date__v |
Modified Date | DateTime | The date and time when the object record was last modified. | System-Managed | False | True |
* Users cannot set or change the name__v
field on objects when system-managed naming is enabled. See About System-Managed Object Record Names below.
Object Metadata Fields (Properties)
The following properties apply to the object itself and affect its object records. Not all properties are returned on all objects.
Metadata Fields | Description |
---|---|
name |
Object name (product__v , region__c , etc.). This is the primary method of identifying objects in the API. |
label |
Object label (Product , Region , etc.). This is the primary method of identifying objects in the UI. |
label_plural |
Object label plural (Products , Regions , etc.). This is used only in the UI. It has no functional use in the API. |
prefix |
Object prefix. This is a 3-digit alphanumeric value automatically assigned to each object (00P , 00C , A01 , etc.). When creating a new record for the object, Vault uses the prefix as the first three characters of its object record ID. For example, if the Product object has the prefix 00P , all product object record IDs could be 00P077101 , 00P077102 , etc. The object prefix and object record ID values vary from vault to vault and are not editable. In the UI, the object prefix is displayed in the URL when viewing objects in the Business Admin menu. |
description |
Short description of the object. Descriptions are displayed only in the API and in the object configuration page of the UI. |
help_content |
Short help message for the object. Help content appears in the UI with the question mark icon in the header of the object's maintenance page. |
source |
Either standard or custom . Standard objects (created by the system) have the __v suffix. Custom objects (created by Admin) have the __c suffix. |
status |
Either active__v or inactive__v . Standard objects (created by the system) cannot be set to inactive. Custom objects (created by Admin) can be enabled and disabled by Admin. |
in_menu |
Whether or not Admin has enabled the object to be listed in the Business Admin UI menu. |
order |
Integer value indicating the top-to-bottom order of objects listed in the Business Admin UI menu. |
auditable |
Whether or not Admin has enabled audit trail tracking on the object to track changes made to its object records. For standard objects, this is enabled by default and cannot be disabled. For custom objects, this can be enabled and disabled by Admin. Learn about Audit Trails in Vault Help. |
role_overrides |
Whether or not Admin has configured role override rules on the object. |
dynamic_security |
Whether or not Admin has enabled dynamic security on the object. When enabled, access to object records is controlled at the object record-level instead of at the object-level. Available in v12 or later. Learn about Dynamic Security in Vault Help. |
allow_attachments |
Whether or not Admin has enabled attachments on the object. When enabled on an object, users can "attach" related files (Documents, Images, etc.) to its object records. Available in v13 or later. See Object Record Attachments below. Learn about Object Record Attachments in Vault Help. |
system_managed |
Whether or not the object fields and records are entirely managed by the system (cannot be extended by users). This is only true for a limited number of standard objects, such as workflow__v and doc_type_detail__v . This is different from the system_managed_name field property described below. |
available_lifecycles |
Lists all available lifecycles that can be assigned to the object. Available in API v14 or later. Learn about Object Lifecycles in Vault Help. |
urls |
Lists API endpoints to retrieve information about the object. |
fields |
Lists all fields (standard and custom) configured on the object. See Object Fields below. |
relationships |
Lists all relationships configured on the object. See Object Relationships below. |
created_by |
Vault user ID of the person who created the object. For standard objects (created by the system), this shows 1 (one). |
created_date |
Date and time when the object was created in UTC format (YYYY-MM-DDTHH:MM:SS.000Z ). |
modified_by |
Vault user ID of the person who last modified the object. |
modified_date |
Date and time when the object was last modified in UTC format. |
Object Metadata Fields (Properties)
The following information may be included with each field:
Metadata Fields | Description |
---|---|
name |
Field name (id , name__v , external_id__v , etc.). This is the primary method of identifying fields in the API. |
label |
Field label (ID , Name , External ID , etc.). This is the primary method of identifying fields in the UI. |
type |
Field data type. See Object Field Types below. |
source |
Either standard , sample , or custom . Standard and sample object fields (created by the system) have the __v and __vs suffix, respectively. Custom objects (created by Admin) have the __c suffix. |
required |
Either "required": true or "required": false . This indicates whether or not the field must be configured with a value when creating a new object record. |
editable |
Either "editable": true or "editable": false . This indicates whether or not users can add or change the field value. |
status |
Either active__v or inactive__v . Standard (__v ) object fields (created by the system) cannot be set to inactive. Custom object fields (__c ) (created by Admin) and sample (__vs ) object fields (created by the system) can be enabled and disabled by Admin. |
unique |
Whether or not the value stored in this field is unique. For example, the value for name__v can only be assigned to one object record ("name__v": "CholeCap" is unique); a value for therapeutic_area__vs (picklist) can be assigned to many object records ("therapeutic_area__vs": "cardiology__vs" is not unique). |
system_managed_name |
See About System-Managed Object Record Names below. |
value_format |
See About System-Managed Object Record Names below. |
start_number |
See About System-Managed Object Record Names below. |
lookup_relationship_name |
See About Lookup Fields below. |
lookup_source_field |
See About Lookup Fields below. |
component |
When the field type is Component , this lists the Vault component referenced by the field. Currently, this applies only to object lifecycles and lifecycle states. |
max_length |
This property is only on String/Text field types. It indicates the maximum number of characters that can be in the field value. |
max_value |
This property is only on Number field types. It indicates the maximum number of characters that can be set in the field value. Number fields will also show min_value and scale properties, indicating the minimum number of characters and the number of decimal places the value will store. |
list_column |
Either true or false . Whether or not the field column is displayed in the Business Admin object record table in the Vault UI. |
order |
The order (top to bottom) in which the field is listed in the object record details in Vault UI. |
created_by |
Vault user ID of the person who created the object. For standard objects (created by the system), this shows 1 (one). |
created_date |
Date and time when the object was created in UTC format (YYYY-MM-DDTHH:MM:SS.000Z ). |
modified_by |
Vault user ID of the person who last modified the object. |
modified_date |
Date and time when the object was last modified in UTC format. |
Object Relationships
The following properties apply object relationships:
Property | Description |
---|---|
field |
n the selected object, this is the name of the field on which the relationship is defined. |
relationship_name |
The name of the relationship between the two objects. This always takes the singular or plural form of the related object ending in __vr for standard objects and __cr for custom objects. |
relationship_label |
The label of the related object. |
relationship_deletion |
Whether or not deletion of the relationship is blocked. |
object |
The object which has a relationship with the specified object. This field includes the endpoint URL to access the related object and its name , label , label_plural , and prefix . |
Object Field Types
Standard and custom objects include the following field data types:
Field Type | Description |
---|---|
ID | System-managed field used only for the object record id field. |
String/Text | Stores alphanumeric values up to a maximum length. |
Number | Stores number values up to a maximum length. |
Picklist | Stores picklist values. These can be configured as single-value or multi-value. |
Boolean | Stores Yes/No and true/false values. |
Date | Stores date values in UTC format (YYYY-MM-DD ). |
Date/Time | Stores date and time values in UTC format (YYYY-MM-DDTHH:MM:SS.000Z ). |
Object | References another object. These are used to create reference relationships with other Vault Objects and users. |
Component | Used to store object lifecycles. |
About System-Managed Object Record Names
As of v14.0, Admins can configure Vault to automatically set the name__v
field value of new object records on any custom object. Learn about System-Managed Object Record Naming in Vault Help.
When retrieving object metadata, the name__v
field on all Vault Objects includes the following properties:
Metadata Field | Description |
---|---|
system_managed_name |
Indicates (true/false) whether or not Admin has enabled system-managed naming on the object. |
value_format |
When the "system_managed_name": true , this shows the numbering format which Vault uses to automatically name the object records. |
start_number |
When the "system_managed_name": true , this shows the first number which Vault will use to name the object records. |
The system_managed_name
can only be set to true for custom objects. It cannot be set on standard objects such as product, country, study, etc.
The impact of system-managed names is that users cannot set or update the name of object records when creating or updating object records.
Shown below is the name__v
field on a custom object where "system_managed_name": true
.
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"start_number": 1,
"label": "Name",
"source": "standard",
"type": "String",
"modified_date": "2016-02-29T22:36:03.000Z",
"created_by": 46916,
"required": true,
"system_managed_name": true,
"value_format": "VV-{######}",
"unique": true,
"name": "name__v",
"list_column": true,
"modified_by": 46916,
"created_date": "2016-02-29T22:34:53.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 128,
"order": 1
}
"value_format": "VV-{######}"
- The format which Vault uses to name the object records.
"start_number": 1
- The first object record will be named VV-000001
, the second VV-000002
, etc.
About Lookup Fields
As of v14.0, Admins can configure objects with fields that are mirror copies (replicas) of fields on a related object. These fields get their values by "looking up" the field values on the related objects through an object reference, parent-child, or document relationship. Hence, they are called "Lookup Fields". Learn about Object Relationships in Vault Help.
When retrieving object metadata, all standard and custom object fields include the following properties:
lookup_relationship_name
- The outbound relationship name. These are generally named for the object that they reference.lookup_source_field
- The name of the field on the referenced/parent object. Vault displays this field value in the lookup field.
The properties will only have values for fields configured as lookups. These fields must utilize an outbound (parent or reference) object relationship. Often, the name of these fields match the name of the field they pull data from, but this is not required.
Shown below is the product_therapeutic_area__c
field on the marketing_campaign__c
object. Admin has set this as a lookup field pointing to the therapeutic_area__vs
field on the product__v
object.
"lookup_relationship_name": "product__cr"
- The name of the relationship joining theproduct__v
parent object and themarketing_campaign__c
child object."lookup_source_field": "therapeutic_area__vs"
- The field on the parent object that will be used to populate theproduct_therapeutic_area__c
field on the child object.
{
"help_content": null,
"multi_value": false,
"editable": false,
"lookup_relationship_name": "product__cr",
"picklist": "therapeutic_area__vs",
"label": "Product Therapeutic Area",
"source": "custom",
"type": "Picklist",
"modified_date": "2016-02-17T18:08:07.000Z",
"created_by": 25524,
"required": false,
"unique": false,
"name": "product_therapeutic_area__c",
"list_column": false,
"modified_by": 25524,
"created_date": "2016-02-17T18:08:07.000Z",
"lookup_source_field": "therapeutic_area__vs",
"status": [
"active__v"
],
"order": 12
}
Retrieve Object Metadata
Retrieve all metadata configured on a standard or custom Vault Object.
Request
Send GET
to /api/{version}/metadata/vobjects/{object_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{object_name}
- The object name__v
field value (product__v
, country__v
, custom_object__c
, etc.).
Options
loc
- To retrieve localized (translated) strings, include the parameter loc=true
. See the next request below for details.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects/product__v
Response
{
"responseStatus": "SUCCESS",
"object": {
"available_lifecycles": [],
"label_plural": "Products",
"help_content": null,
"prefix": "00P",
"in_menu": true,
"description": null,
"label": "Product",
"source": "standard",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"allow_attachments": false,
"dynamic_security": false,
"relationships": [
{
"relationship_name": "user_role_setup__cr",
"relationship_label": "User Role Setup",
"field": "product__c",
"relationship_type": "reference_inbound",
"relationship_deletion": "block",
"object": {
"url": "/api/v14.0/metadata/vobjects/user_role_setup__v",
"label": "User Role Setup",
"name": "user_role_setup__v",
"label_plural": "User Role Setup",
"prefix": "0MY"
}
}
],
"urls": {
"field": "/api/v14.0/metadata/vobjects/product__v/fields/{name}",
"record": "/api/v14.0/vobjects/product__v/{id}",
"list": "/api/v14.0/vobjects/product__v",
"metadata": "/api/v14.0/metadata/vobjects/product__v"
},
"role_overrides": false,
"auditable": true,
"name": "product__v",
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"system_managed": false,
"fields": [
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"label": "ID",
"source": "standard",
"type": "ID",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"name": "id",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 0
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"start_number": null,
"label": "Product Name",
"source": "standard",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": true,
"system_managed_name": false,
"value_format": null,
"unique": true,
"name": "name__v",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 128,
"order": 1
},
{
"help_content": null,
"multi_value": false,
"editable": true,
"lookup_relationship_name": null,
"picklist": "default_status__v",
"label": "Status",
"source": "standard",
"type": "Picklist",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": true,
"unique": false,
"name": "status__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 2
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "Product Abbreviation",
"source": "sample",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "abbreviation__vs",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 10,
"order": 3
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "Generic Name",
"source": "sample",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "generic_name__vs",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 100,
"order": 4
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "Internal Name",
"source": "sample",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "internal_name__vs",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 100,
"order": 5
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "Compound ID",
"source": "sample",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "compound_id__vs",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 100,
"order": 6
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "INN",
"source": "sample",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "inn__vs",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 100,
"order": 7
},
{
"help_content": null,
"multi_value": false,
"editable": true,
"lookup_relationship_name": null,
"picklist": "therapeutic_area__vs",
"label": "Therapeutic Area",
"source": "sample",
"type": "Picklist",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "therapeutic_area__vs",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 8
},
{
"help_content": null,
"multi_value": true,
"editable": true,
"lookup_relationship_name": null,
"picklist": "product_family__vs",
"label": "Product Family",
"source": "sample",
"type": "Picklist",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": false,
"name": "product_family__vs",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 9
},
{
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"label": "External ID",
"source": "standard",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"unique": true,
"name": "external_id__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 50,
"order": 10
},
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"label": "Created By",
"source": "standard",
"type": "Object",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"relationship_type": "reference",
"unique": false,
"name": "created_by__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"object": {
"name": "users"
},
"order": 11
},
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"label": "Created Date",
"source": "standard",
"type": "DateTime",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"name": "created_date__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 12
},
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"label": "Last Modified By",
"source": "standard",
"type": "Object",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"relationship_type": "reference",
"unique": false,
"name": "modified_by__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"object": {
"name": "users"
},
"order": 13
},
{
"help_content": null,
"editable": false,
"lookup_relationship_name": null,
"label": "Last Modified Date",
"source": "standard",
"type": "DateTime",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": false,
"name": "modified_date__v",
"list_column": false,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"order": 14
}
],
"object_class": "base",
"status": [
"active__v"
],
"order": 1
}
}
The response includes all metadata configured on the object.
Retrieve Localized Strings
When available, you can retrieve localized (translated) strings for the label
, label_plural
, and help_content
object fields by adding loc=true
to request.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects/product__v?loc=true
Response (abridged)
{
"responseStatus": "SUCCESS",
"object": {
"available_lifecycles": [],
"label_plural": "Products",
"prefix": "00P",
"description": null,
"source": "standard",
"allow_attachments": false,
"relationships": [
{
"relationship_name": "user_role_setup__cr",
"relationship_label": "User Role Setup",
"field": "product__c",
"relationship_type": "reference_inbound",
"localized_data": {
"relationship_label": {
"en": "User Role Setup"
}
},
"relationship_deletion": "block",
"object": {
"url": "/api/v14.0/metadata/vobjects/user_role_setup__v",
"label": "User Role Setup",
"name": "user_role_setup__v",
"label_plural": "User Role Setup",
"prefix": "0MY",
"localized_data": {
"label_plural": {
"de": "Benutzerrollenkonfiguration",
"ru": "Настройки функции пользователя",
"kr": "사용자 역할 설정",
"en": "User Role Setup",
"it": "Configurazione ruolo utente",
"pt_BR": "Configuração da função de usuário",
"fr": "Configuration du rôle utilisateur",
"zh": "用户角色设置",
"es": "Configuración de cargos de usuario",
"zh_TW": "使用者角色設定",
"ja": "ユーザロール設定",
"pl": "Konfiguracja roli użytkownika",
"tr": "Kullanıcı Rolü Ayarı",
"pt_PT": "Configuração da função de utilizador"
},
"label": {
"de": "Benutzerrollenkonfiguration",
"ru": "Настройки функции пользователя",
"kr": "사용자 역할 설정",
"en": "User Role Setup",
"it": "Configurazione ruolo utente",
"pt_BR": "Configuração da função de usuário",
"fr": "Configuration du rôle utilisateur",
"zh": "用户角色设置",
"es": "Configuración de cargos de usuario",
"zh_TW": "使用者角色設定",
"ja": "ユーザロール設定",
"pl": "Konfiguracja roli użytkownika",
"tr": "Kullanıcı Rolü Ayarı",
"pt_PT": "Configuração da função de utilizador"
}
}
}
}
],
"urls": {
"field": "/api/v14.0/metadata/vobjects/product__v/fields/{name}",
"record": "/api/v14.0/vobjects/product__v/{id}",
"list": "/api/v14.0/vobjects/product__v",
"metadata": "/api/v14.0/metadata/vobjects/product__v"
},
"role_overrides": false,
"localized_data": {
"label_plural": {
"de": "Produkte",
"ru": "Продукты",
"kr": "제품",
"en": "Products",
"pt_BR": "Produtos",
"it": "Prodotti",
"fr": "Produits",
"es": "Productos",
"zh": "产品",
"zh_TW": "產品",
"ja": "製品",
"pl": "Produkty",
"tr": "Ürünler",
"pt_PT": "Produtos"
},
"label": {
"de": "Produkt",
"ru": "Продукт",
"kr": "제품",
"en": "Product",
"pt_BR": "Produto",
"it": "Prodotto",
"fr": "Produit",
"es": "Producto",
"zh": "产品",
"zh_TW": "產品",
"ja": "製品",
"pl": "Produkt",
"tr": "Ürün",
"pt_PT": "Produto"
}
},
...
Details
When localized data is requested, the response includes an additional localized_data
field. This contains translated fields and field values on each object field for which localized strings have been configured. This data is only available at the object and field level and only if localized strings have been configured on objects in your vault.
History
Since v8
Retrieve Object Field Metadata
Request
Send GET
to /api/{version}/metadata/vobjects/{object_name}/fields/{object_field_name}
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Parameters
{object_name}
- The object name__v
field value (product__v
, country__v
, custom_object__c
, etc.).
{object_field_name}
- The object field name
value (id
, name__v
, external_id__v
, etc.).
Options
loc
- To retrieve localized (translated) strings, include the parameter loc=true
. See the next request below for details.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects/product__v/fields/name__v
Response
{
"responseStatus": "SUCCESS",
"field": {
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"start_number": null,
"label": "Product Name",
"source": "standard",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": true,
"system_managed_name": false,
"value_format": null,
"unique": true,
"name": "name__v",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 128,
"order": 1
}
}
The response includes all metadata configured on the specific Vault Object field. Refer to the Vault Object Metadata tables above for field descriptions.
Retrieve Localized Strings
When available, you can retrieve localized (translated) strings for the label
and help_content
object fields by adding loc=true
to request.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects/product__v/fields/name__v?loc=true
Response
{
"responseStatus": "SUCCESS",
"field": {
"help_content": null,
"editable": true,
"lookup_relationship_name": null,
"start_number": null,
"label": "Product Name",
"source": "standard",
"type": "String",
"modified_date": "2015-07-30T20:55:16.000Z",
"created_by": 1,
"required": true,
"localized_data": {
"label": {
"de": "Produktbezeichnung",
"ru": "Название продукта",
"kr": "제품 이름",
"en": "Product Name",
"pt_BR": "Nome do produto",
"it": "Nome prodotto",
"fr": "Nom de produit",
"es": "Nombre de producto",
"zh": "产品名称",
"zh_TW": "產品名稱",
"ja": "製品名",
"pl": "Nazwa produktu",
"tr": "Ürün Adı",
"pt_PT": "Nome do produto"
}
},
"system_managed_name": false,
"value_format": null,
"unique": true,
"name": "name__v",
"list_column": true,
"modified_by": 1,
"created_date": "2015-07-30T20:55:16.000Z",
"lookup_source_field": null,
"status": [
"active__v"
],
"max_length": 128,
"order": 1
}
}
Details
When localized data is requested, the response includes an additional localized_data
field. This contains translated fields and field values on each object field for which localized strings have been configured. This data is only available at the object and field level and only if localized strings have been configured on objects in your vault.
History
Since v8
Retrieve Object Collection
Request
Send GET
to /api/{version}/metadata/vobjects
Headers
Response Accept
- JSON application/json
(default) or XML application/xml
Options
loc
- To retrieve localized (translated) strings, include the parameter loc=true
. See the next request below for details.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects
Response
{
"responseStatus": "SUCCESS",
"objects": [
{
"url": "/api/v14.0/metadata/vobjects/product__v",
"label": "Product",
"name": "product__v",
"label_plural": "Products",
"prefix": "00P",
"order": 1,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/country__v",
"label": "Country",
"name": "country__v",
"label_plural": "Countries",
"prefix": "00C",
"order": 2,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/application_role__v",
"label": "Application Role",
"name": "application_role__v",
"label_plural": "Application Role",
"prefix": "0AR",
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/doc_type_group__v",
"label": "Document Type Group",
"name": "doc_type_group__v",
"label_plural": "Document Type Groups",
"prefix": "0DG",
"order": 3,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/doc_type_detail__v",
"label": "Document Type Detail",
"name": "doc_type_detail__v",
"label_plural": "Document Type Details",
"prefix": "0DT",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/user_role_setup__v",
"label": "User Role Setup",
"name": "user_role_setup__v",
"label_plural": "User Role Setup",
"prefix": "0MY",
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/vault_component__v",
"label": "Vault Component",
"name": "vault_component__v",
"label_plural": "Vault Components",
"prefix": "0CD",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/outbound_package__v",
"label": "Outbound Package",
"name": "outbound_package__v",
"label_plural": "Outbound Packages",
"prefix": "0PO",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/package_component__v",
"label": "Package Component",
"name": "package_component__v",
"label_plural": "Package Components",
"prefix": "0CP",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/directory__v",
"label": "Directory",
"name": "directory__v",
"label_plural": "Directories",
"prefix": "0DI",
"order": 4,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/survey__v",
"label": "Survey",
"name": "survey__v",
"label_plural": "Surveys",
"prefix": "0SV",
"order": 5,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/distribution__v",
"label": "Distribution",
"name": "distribution__v",
"label_plural": "Distributions",
"prefix": "0DS",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
},
{
"url": "/api/v14.0/metadata/vobjects/crm_org__v",
"label": "CRM Org",
"name": "crm_org__v",
"label_plural": "CRM Orgs",
"prefix": "0CO",
"in_menu": false,
"source": "standard",
"status": [
"active__v"
]
}
]
}
Details
The response includes a summary of key information (url
, label
, name
, prefix
, status
, etc.) for all standard and custom Vault Objects configured in your vault. Refer to the Vault Object Metadata tables above for field descriptions.
Retrieve Localized Strings
When available, you can retrieve localized (translated) strings for the label
and label_plural
object fields by adding loc=true
to request.
Example
$ curl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v14.0/metadata/vobjects?loc=true
Response (abridged)
{
"responseStatus": "SUCCESS",
"objects": [
{
"url": "/api/v14.0/metadata/vobjects/product__v",
"label": "Product",
"name": "product__v",
"label_plural": "Products",
"prefix": "00P",
"order": 1,
"in_menu": true,
"source": "standard",
"status": [
"active__v"
],
"localized_data": {
"label_plural": {