Box Developer Documentation
Latest version

Create Box Doc Gen template

post
https://api.box.com/2.0
/docgen_templates

Marks a file as a Box Doc Gen template.

Request

bearer [ACCESS_TOKEN]
application/json

Request Headers

stringin headerrequired

Version header.

Value is always 2025.0

Request Body

objectin body

Marks the file as a Box Doc Gen template to generate the document from.

stringin bodyrequired
"42037322"

ID of the object.

stringin bodyrequired
"file"

The value will always be file.

Value is always file

Response

The file which has now been marked as a Box Doc Gen template.

application/jsonClient error

The server cannot or will not process the request due to an apparent client error.

application/jsonClient error

The client does not have access rights to the content or resource requested.

application/jsonClient error

The user has sent too many requests in a given amount of time.

application/jsonClient error

An unexpected condition was encountered on the server.

post
Create Box Doc Gen template
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versionig strategy.


cURL
curl -L 'https://api.box.com/2.0/docgen_templates' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>' \
     -H 'Content-Type: application/json' \
     -D '{
        "file": {
            "id": "12345678",
            "type": "file"
        }
}'
Node/TypeScript v10
await client.docgenTemplate.createDocgenTemplateV2025R0({
  file: new FileReferenceV2025R0({ id: file.id }),
} satisfies DocGenTemplateCreateRequestV2025R0);
Python v10
client.docgen_template.create_docgen_template_v2025_r0(FileReferenceV2025R0(id=file.id))
.NET v10
await client.DocgenTemplate.CreateDocgenTemplateV2025R0Async(requestBody: new DocGenTemplateCreateRequestV2025R0(file: new FileReferenceV2025R0(id: file.Id)));
Swift v10
try await client.docgenTemplate.createDocgenTemplateV2025R0(requestBody: DocGenTemplateCreateRequestV2025R0(file: FileReferenceV2025R0(id: file.id)))
Java v10
client.getDocgenTemplate().createDocgenTemplateV2025R0(new DocGenTemplateCreateRequestV2025R0(new FileReferenceV2025R0(file.getId())))

Response Example

{
  "file": {
    "id": "42037322",
    "type": "file"
  }
}