Skip to content

Upload one document template. To upload multiple document templates, see Bulk Create Document Templates.

POST/api/{version}/objects/documents/templates
NameDescription
Content-Typemultipart/form-data
Acceptapplication/json (default) or application/xml

To upload the file, use the multi-part attachment with the file component "file={file_name}". The maximum allowed file size is 4GB.

When creating document templates, the following fields are required in all Vaults:

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.
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__c" \ -F "subtype__v=advertisement__c" \ -F "classification__v=print__c" \ -F "active__v=true" \ https://myvault.veevavault.com/api/v17.1/objects/documents/templates
responseStatus,name,errors SUCCESS,promo_ad_template__c,
  • 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 specified label__v field value to create the name__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, and classification__v are all specified. This template is being created for documents of classification__v=print__c.
  • The template is being set to active__v=true. It will be available for selection when creating a new document.

On SUCCESS, Vault returns the name of the new document template.