Skip to main content
POST
/
docgen_batches
cURL
curl -L 'https://api.box.com/2.0/docgen_batches' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>' \
     -D '{
        "file": {
            "id": "12345678",
            "type": "file"
        },
        "input_source": "api",
        "destination_folder": {
            "id": "12345678",
            "type": "folder"
        },
        "output_type": "docx",
        "document_generation_data": [
            {
                "generated_file_name": "Image test",
                "user_input": {
                    "order": {
                        "id": "12305",
                        "date": "18-08-2023",
                        "country": "US",
                        "expiryDate": "18-08-2024",
                        "currency": "$",
                        "amount": 5060.5,
                        "taxRate": 10,
                        "requester": "John",
                        "approver": "Smith",
                        "department": "Procurement",
                        "paymentTerms": "30 days",
                        "deliveryTerms": "30 days",
                        "deliveryDate": "18-09-2023",
                        "vendor": {
                            "company": "Example company",
                            "address": {
                                "street": "Example street",
                                "city": "Example city",
                                "zip": "EX-456"
                            }
                        },
                        "products": [
                            {
                                "id": 1,
                                "name": "A4 Papers",
                                "type": "non-fragile",
                                "quantity": 100,
                                "price": 29,
                                "amount": 2900
                            },
                            {
                                "id": 2,
                                "name": "Ink  Cartridge",
                                "type": "non-fragile",
                                "quantity": 40,
                                "price": 39,
                                "amount": 1560
                            },
                            {
                                "id": 3,
                                "name": "Adhesive tape",
                                "type": "non-fragile",
                                "quantity": 20,
                                "price": 30,
                                "amount": 600.5
                            }
                        ]
                    }
                }
            }
        ]`
{
  "id": "12345",
  "type": "docgen_batch"
}

Documentation Index

Fetch the complete documentation index at: https://developer.box.com/llms.txt

Use this file to discover all available pages before exploring further.

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

The schema for creating a Box Doc Gen job batch request.

file
File reference · object
required

A Box Doc Gen template that is used to generate the document.

input_source
string
required

Source of input. The value has to be api for all the API-based document generation requests.

Example:

"api"

destination_folder
Folder reference · object
required

Destination folder for the generated files.

output_type
string
required

Type of the output file.

Example:

"docx"

document_generation_data
Document generation data · object[]
required
file_version
File version (Base) · object

File version of a template.

Response

The created Batch ID.

The basic representation of a Box Doc Gen batch object. A Box Doc Gen batch contains one or more Box Doc Gen jobs.

id
string
required

The unique identifier that represents a Box Doc Gen batch.

Example:

"12345"

type
enum<string>
required

The value will always be docgen_batch.

Available options:
docgen_batch
Example:

"docgen_batch"