> ## 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.

# Box Doc Gen resources

Box Doc Gen automatically generates documents from Box Doc Gen templates. These resources represent the generation jobs and batches returned by the Box Doc Gen endpoints, including their status and output files.

## Box Doc Gen batch (Base)

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

<Accordion title="Attributes and example">
  | Property | Type           | Required | Description                                                                 |
  | -------- | -------------- | -------- | --------------------------------------------------------------------------- |
  | `id`     | `string`       | Yes      | The unique identifier that represents a Box Doc Gen batch.                  |
  | `type`   | `enum<string>` | Yes      | The value will always be `docgen_batch`. Available options: `docgen_batch`. |

  ```json Example theme={null}
  {
    "id": "12345",
    "type": "docgen_batch"
  }
  ```
</Accordion>

## Box Doc Gen job

A standard representation of a Box Doc Gen job.

<Accordion title="Attributes and example">
  | Property                | Type                                                | Required | Description                                                                                                  |
  | ----------------------- | --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
  | `id`                    | `string`                                            | Yes      | The unique identifier that represent a Box Doc Gen job.                                                      |
  | `type`                  | `enum<string>`                                      | Yes      | The value will always be `docgen_job`. Available options: `docgen_job`.                                      |
  | `batch`                 | [Box Doc Gen batch (Base)](#box-doc-gen-batch-base) | Yes      | Box Doc Gen batch that the job belongs to.                                                                   |
  | `template_file`         | `File reference`                                    | Yes      | Box Doc Gen template used in the job.                                                                        |
  | `template_file_version` | `File version (Base)`                               | Yes      | File version of a template.                                                                                  |
  | `output_file`           | `File reference`                                    | No       | The output file of the job. This property is `null` until the job is completed. Can be `null`.               |
  | `output_file_version`   | `File version (Base)`                               | No       | File version of the output file. This property is `null` until the job is completed. Can be `null`.          |
  | `status`                | `enum<string>`                                      | Yes      | Status of the job. Available options: `submitted`, `completed`, `failed`, `completed_with_error`, `pending`. |
  | `output_type`           | `string`                                            | Yes      | Type of the generated file.                                                                                  |
  | `failures`              | `object`                                            | No       | Errors and warnings that occurred during document generation. Can be `null`.                                 |

  ```json Example theme={null}
  {
    "id": "12345",
    "type": "docgen_job",
    "batch": {
      "id": "12345",
      "type": "docgen_batch"
    },
    "template_file": {
      "type": "file",
      "id": "42037322"
    },
    "template_file_version": {
      "id": "12345",
      "type": "file_version"
    },
    "output_file": {
      "type": "file",
      "id": "42037322"
    },
    "output_file_version": {
      "id": "12345",
      "type": "file_version"
    },
    "status": "completed",
    "output_type": "docx",
    "failures": {
      "errors": [
        "The tag 'customer_name' was not provided in the input data."
      ],
      "warnings": [
        "The tag 'optional_field' was provided but not used in the template."
      ]
    }
  }
  ```
</Accordion>

## Box Doc Gen job (Base)

The basic representation of a Box Doc Gen job.

<Accordion title="Attributes and example">
  | Property | Type           | Required | Description                                                             |
  | -------- | -------------- | -------- | ----------------------------------------------------------------------- |
  | `id`     | `string`       | Yes      | The unique identifier that represent a Box Doc Gen job.                 |
  | `type`   | `enum<string>` | Yes      | The value will always be `docgen_job`. Available options: `docgen_job`. |

  ```json Example theme={null}
  {
    "id": "12345",
    "type": "docgen_job"
  }
  ```
</Accordion>

## Box Doc Gen job (Full)

A full representation of a Box Doc Gen job.

<Accordion title="Attributes and example">
  | Property                | Type                                                | Required | Description                                                                                                  |
  | ----------------------- | --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
  | `id`                    | `string`                                            | Yes      | The unique identifier that represent a Box Doc Gen job.                                                      |
  | `type`                  | `enum<string>`                                      | Yes      | The value will always be `docgen_job`. Available options: `docgen_job`.                                      |
  | `batch`                 | [Box Doc Gen batch (Base)](#box-doc-gen-batch-base) | Yes      | Box Doc Gen batch that the job belongs to.                                                                   |
  | `template_file`         | `File reference`                                    | Yes      | Box Doc Gen template used in the job.                                                                        |
  | `template_file_version` | `File version (Base)`                               | Yes      | File version of a template.                                                                                  |
  | `output_file`           | `File reference`                                    | No       | The output file of the job. This property is `null` until the job is completed. Can be `null`.               |
  | `output_file_version`   | `File version (Base)`                               | No       | File version of the output file. This property is `null` until the job is completed. Can be `null`.          |
  | `status`                | `enum<string>`                                      | Yes      | Status of the job. Available options: `submitted`, `completed`, `failed`, `completed_with_error`, `pending`. |
  | `output_type`           | `string`                                            | Yes      | Type of the generated file.                                                                                  |
  | `failures`              | `object`                                            | No       | Errors and warnings that occurred during document generation. Can be `null`.                                 |
  | `created_at`            | `string`                                            | No       | Time of job creation. Read-only.                                                                             |
  | `created_by`            | `User (Base)`                                       | Yes      | User who created the job.                                                                                    |
  | `enterprise`            | `Enterprise reference`                              | Yes      | ID of the enterprise.                                                                                        |
  | `source`                | `string`                                            | Yes      | Source of the request. Read-only.                                                                            |

  ```json Example theme={null}
  {
    "id": "12345",
    "type": "docgen_job",
    "batch": {
      "id": "12345",
      "type": "docgen_batch"
    },
    "template_file": {
      "type": "file",
      "id": "42037322"
    },
    "template_file_version": {
      "id": "12345",
      "type": "file_version"
    },
    "output_file": {
      "type": "file",
      "id": "42037322"
    },
    "output_file_version": {
      "id": "12345",
      "type": "file_version"
    },
    "status": "completed",
    "output_type": "docx",
    "failures": {
      "errors": [
        "The tag 'customer_name' was not provided in the input data."
      ],
      "warnings": [
        "The tag 'optional_field' was provided but not used in the template."
      ]
    },
    "created_at": "2022-05-11T10:56:11-07:00",
    "created_by": {
      "id": "11446498",
      "type": "user"
    },
    "enterprise": {
      "id": "1910967",
      "type": "enterprise"
    },
    "source": "api"
  }
  ```
</Accordion>

## Box Doc Gen jobs

A list of Box Doc Gen jobs with a standard set of parameters.

<Accordion title="Attributes and example">
  | Property      | Type                                         | Required | Description                                                                                                                                                                            |
  | ------------- | -------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `limit`       | `integer`                                    | No       | The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API. |
  | `next_marker` | `string`                                     | No       | The marker for the start of the next page of results. Can be `null`.                                                                                                                   |
  | `prev_marker` | `string`                                     | No       | The marker for the start of the previous page of results. Can be `null`.                                                                                                               |
  | `entries`     | array of [Box Doc Gen job](#box-doc-gen-job) | No       | List of jobs.                                                                                                                                                                          |

  ```json Example theme={null}
  {
    "limit": 1000,
    "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
    "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih",
    "entries": [
      {
        "id": "12345",
        "type": "docgen_job",
        "batch": {
          "id": "12345",
          "type": "docgen_batch"
        },
        "template_file": {
          "type": "file",
          "id": "42037322"
        },
        "template_file_version": {
          "id": "12345",
          "type": "file_version"
        },
        "output_file": {
          "type": "file",
          "id": "42037322"
        },
        "output_file_version": {
          "id": "12345",
          "type": "file_version"
        },
        "status": "completed",
        "output_type": "docx",
        "failures": {
          "errors": [
            "The tag 'customer_name' was not provided in the input data."
          ],
          "warnings": [
            "The tag 'optional_field' was provided but not used in the template."
          ]
        }
      }
    ]
  }
  ```
</Accordion>

## Box Doc Gen jobs (Full)

A list of Box Doc Gen jobs with a full set of parameters.

<Accordion title="Attributes and example">
  | Property      | Type                                                     | Required | Description                                                                                                                                                                            |
  | ------------- | -------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `limit`       | `integer`                                                | No       | The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API. |
  | `next_marker` | `string`                                                 | No       | The marker for the start of the next page of results. Can be `null`.                                                                                                                   |
  | `prev_marker` | `string`                                                 | No       | The marker for the start of the previous page of results. Can be `null`.                                                                                                               |
  | `entries`     | array of [Box Doc Gen job (Full)](#box-doc-gen-job-full) | No       | List of jobs.                                                                                                                                                                          |

  ```json Example theme={null}
  {
    "limit": 1000,
    "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
    "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih",
    "entries": [
      {
        "id": "12345",
        "type": "docgen_job",
        "batch": {
          "id": "12345",
          "type": "docgen_batch"
        },
        "template_file": {
          "type": "file",
          "id": "42037322"
        },
        "template_file_version": {
          "id": "12345",
          "type": "file_version"
        },
        "output_file": {
          "type": "file",
          "id": "42037322"
        },
        "output_file_version": {
          "id": "12345",
          "type": "file_version"
        },
        "status": "completed",
        "output_type": "docx",
        "failures": {
          "errors": [
            "The tag 'customer_name' was not provided in the input data."
          ],
          "warnings": [
            "The tag 'optional_field' was provided but not used in the template."
          ]
        },
        "created_at": "2022-05-11T10:56:11-07:00",
        "created_by": {
          "id": "11446498",
          "type": "user"
        },
        "enterprise": {
          "id": "1910967",
          "type": "enterprise"
        },
        "source": "api"
      }
    ]
  }
  ```
</Accordion>
