**Source URL:** https://general.veevavault.dev/regulatory/vault-api/api-reference/17.3/documents/document-templates/bulk-create-document-templates.md

# Bulk Create Document Templates



Upload from 1-500 document templates. To upload one document template, see [Create Document Template](/vault-api/api-reference/17.3/documents/document-templates/create-document-template).

<Endpoint path="/api/{version}/objects/documents/templates" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Content-Type` | `application/json` or `text/csv` |
| `Accept` | `application/json` (default) or `application/xml` |
</FieldTable>

## File Upload {#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.

## Body Parameters {#body-parameters}

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

<FieldTable>
| 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. |
</FieldTable>

## Example CSV Input {#example-csv-input}

<FieldTable>
| `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 |
</FieldTable>
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.

## Request {#request}

<CodeExample title="">
```
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/v15.0/objects/documents/templates

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
   "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."
            }
         ]
      }
   ]
}

```
</CodeExample>

## Response Details {#response-details}

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.



---

**Previous:** [Create Document Template](/regulatory/vault-api/api-reference/17.3/documents/document-templates/create-document-template)  
**Next:** [Update Document Template](/regulatory/vault-api/api-reference/17.3/documents/document-templates/update-document-template)