Create Document Template
Upload one document template. To upload multiple document templates, see Bulk Create Document Templates.
POST
/api/{version}/objects/documents/templatesHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | multipart/form-data |
Accept | application/json (default) or application/xml |
File Upload
Section link for File UploadTo upload the file, use the multi-part attachment with the file component "file={file_name}". The maximum allowed file size is 4GB.
Body Parameters
Section link for Body ParametersWhen creating document templates, the following fields are required in all Vaults:
| 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. |
Request
Section link for Requestcurl -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/templatesResponse
Section link for ResponseresponseStatus,name,errors
SUCCESS,promo_ad_template__c,Response Details
Section link for Response 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__vfield is not included. Vault will use the specifiedlabel__vfield value to create thename__v=promo_ad_template__c - The
label__vfield 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__vare all specified. This template is being created for documents ofclassification__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.