Skip to main content
POST
/
docgen_templates
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"
        }
}'
client.docgen_template.create_docgen_template_v2025_r0(FileReferenceV2025R0(id=file.id))
await client.docgenTemplate.createDocgenTemplateV2025R0({
file: new FileReferenceV2025R0({ id: file.id }),
} satisfies DocGenTemplateCreateRequestV2025R0);
try await client.docgenTemplate.createDocgenTemplateV2025R0(requestBody: DocGenTemplateCreateRequestV2025R0(file: FileReferenceV2025R0(id: file.id)))
client.getDocgenTemplate().createDocgenTemplateV2025R0(new DocGenTemplateCreateRequestV2025R0(new FileReferenceV2025R0(file.getId())))
await client.DocgenTemplate.CreateDocgenTemplateV2025R0Async(requestBody: new DocGenTemplateCreateRequestV2025R0(file: new FileReferenceV2025R0(id: file.Id)));
{
  "file": {
    "type": "file",
    "id": "42037322"
  }
}
{
"type": "error",
"status": 400,
"code": "item_name_invalid",
"message": "Method Not Allowed",
"context_info": {
"message": "Something went wrong"
},
"help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
"request_id": "abcdef123456"
}
{
"type": "error",
"status": 400,
"code": "item_name_invalid",
"message": "Method Not Allowed",
"context_info": {
"message": "Something went wrong"
},
"help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
"request_id": "abcdef123456"
}
{
"type": "error",
"status": 400,
"code": "item_name_invalid",
"message": "Method Not Allowed",
"context_info": {
"message": "Something went wrong"
},
"help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
"request_id": "abcdef123456"
}
{
"type": "error",
"status": 400,
"code": "item_name_invalid",
"message": "Method Not Allowed",
"context_info": {
"message": "Something went wrong"
},
"help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
"request_id": "abcdef123456"
}
Learn more about Box SDK versioning strategy.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

box-version
enum<string>
required

Version header.

Available options:
2025.0

Body

application/json

Marks the provided file as a Box Doc Gen template.

The schema for marking document as Box Doc Gen template.

file
File reference · object
required

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

Response

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

A base representation of a Box Doc Gen template, used when nested within another resource.

file
File reference · object

Enable the file to generate a document from.

Last modified on January 23, 2026