Skip to content

Create up to 500 document templates.

POST/api/{version}/objects/documents/templates
NameDescription
Content-Typeapplication/json or text/csv
Acceptapplication/json (default) or application/xml

Body Parameters: Basic Document Templates

Section link for Body Parameters: Basic Document Templates

To create basic document templates, create a CSV or JSON input file with the following fields:

NameDescription
name__vThe 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__vThe label of the new document template. This is the name users will see among the available binder templates in the UI.
type__vThe name of the document type to which the template will be associated.
subtype__vThe 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__vThe 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__vSet 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.
fileThe filepath of the file for this document template, from the FTP Staging Server. Maximum allowed size is 4GB.
Download Input File

Body Parameters: Controlled Document Templates

Section link for Body Parameters: Controlled Document Templates

To create controlled document templates, create a CSV or JSON input file with the following fields:

NameDescription
name__vThe 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__vThe label of the new document template. This is the name users will see among the available binder templates in the UI.
active__vSet 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.
is_controlled__vSet to true to indicate this template is a controlled document template.
template_doc_id__vThe document id value to use as the Template Document for this controlled document template. Learn more about setting up valid Template Documents in Vault Help.

Example CSV Input: Basic Document Templates

Section link for Example CSV Input: Basic Document Templates
filename__vlabel__vtype__vsubtype__vclassification__vactive__v
templates/doc_template_1.docsite_document_template__cSMF Templatesite_master_file__vtrue
templates/doc_template_2.docTMF Document Templatetrial_master_file__vtrue
templates/doc_template_3.docTrial Protocol Document Templatecentral_trial_documents__vstrial_documents__vsprotocol__vstrue
templates/doc_template_4.docClinical Study Report Document Templatecentral_trial_documents__vsreports__vsclinical_study_report__vsfalse

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 different label__v value. The other templates will inherit their name__v values from the label__v values.
  • We've specified the document type, subtype, and classification to which each document template will be associated.
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/v19.3/objects/documents/templates
{ "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." } ] } ] }