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

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = href;
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

Box Doc Gen API allows you to retrieve information related to Box Doc Gen templates.

## Prerequisites

Before you start using Box Doc Gen API, follow the steps listed in the <Link href="/guides/docgen/docgen-getting-started">get started with Box Doc Gen</Link> guide to create a platform app and a Box Doc Gen template.

## List Box Doc Gen templates

To get a list of all created Box Doc Gen templates,
use the `GET /2.0/docgen_templates` endpoint. You don't have to provide any additional parameters.

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_templates' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplatesV2025R0();
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_templates_v2025_r0()
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplatesV2025R0Async();
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplatesV2025R0()
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplatesV2025R0()
  ```
</CodeGroup>

The response will contain an `entries` array listing the already created Box Doc Gen templates.

## Get a  Box Doc Gen template by ID

To get a specific Box Doc Gen template,
use the `GET /2.0/docgen_templates_id` endpoint and provide the `template_id`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_templates/12345678' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplateByIdV2025R0(
    createdDocgenTemplate.file!.id,
  );
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_template_by_id_v2025_r0(
      created_docgen_template.file.id
  )
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplateByIdV2025R0Async(templateId: NullableUtils.Unwrap(createdDocgenTemplate.File).Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplateByIdV2025R0(templateId: createdDocgenTemplate.file!.id)
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplateByIdV2025R0(createdDocgenTemplate.getFile().getId())
  ```
</CodeGroup>

The response will contain details of a file that was used as a Box Doc Gen template.

## List all document generation jobs for a template

To get a list of all created Box Doc Gen templates,
use the `GET /2.0/docgen_template_jobs_id` endpoint and provide the `template_id`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_template_jobs/12345678' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(
    fetchedDocgenTemplate.file!.id,
  );
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_template_job_by_id_v2025_r0(
      fetched_docgen_template.file.id
  )
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplateJobByIdV2025R0Async(templateId: NullableUtils.Unwrap(fetchedDocgenTemplate.File).Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(templateId: fetchedDocgenTemplate.file!.id)
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplateJobByIdV2025R0(fetchedDocgenTemplate.getFile().getId())
  ```
</CodeGroup>

The response will contain a list of Box Doc Gen jobs that were run to generate
documents.

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Get started with Box Doc Gen"), href: "/guides/docgen/docgen-getting-started", badge: "GUIDE" },
{ label: translate("Generate documents"), href: "/guides/docgen/generate-document", badge: "GUIDE" }
]}
/>
