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

# List all metadata 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 = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

<RelatedLinks
  title="REQUIRED GUIDES"
  items={[
{ label: translate("Metadata template scopes"), href: "/guides/metadata/scopes", badge: "GUIDE" }
]}
/>

Metadata templates can be listed for either the <Link href="/guides/metadata/scopes">enterprise or the global
scope</Link>.

## List global templates

To list all global metadata templates, call the <Link href="/reference/get-metadata-templates-global">`GET
/metadata_templates/global`</Link> API endpoint.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/metadata_templates/global" \
       -H "authorization: Bearer <ACCESS_TOKEN>"
  ```

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

  ```python Python v10 theme={null}
  client.metadata_templates.get_global_metadata_templates()
  ```

  ```csharp .NET v10 theme={null}
  await client.MetadataTemplates.GetGlobalMetadataTemplatesAsync();
  ```

  ```swift Swift v10 theme={null}
  try await client.metadataTemplates.getGlobalMetadataTemplates()
  ```

  ```java Java v10 theme={null}
  client.getMetadataTemplates().getGlobalMetadataTemplates()
  ```

  ```java Java v5 theme={null}
  Iterable<MetadataTemplate> templates = MetadataTemplate.getEnterpriseMetadataTemplates('global', api);
  for (MetadataTemplate templateInfo : templates) {
      // Do something with the metadata template.
  }
  ```

  ```py Python v4 theme={null}
  templates = client.get_metadata_templates(scope='global)
  for template in templates:
      print(f'Metadata template {template.templateKey} is in global scope')
  ```

  ```csharp .NET v6 theme={null}
  BoxEnterpriseMetadataTemplateCollection<BoxMetadataTemplate> templates = await client.MetadataManager
      .GetEnterpriseMetadataAsync("global");
  ```

  ```js Node v4 theme={null}
  client.metadata.getTemplates('global')
   .then(templates => {
    // ...
   });
  ```
</CodeGroup>

<Info>
  This API returns a list of all the metadata templates created by Box and made
  available to all enterprises.
</Info>

## List current enterprise's templates

To list all metadata templates created for usage within the current
enterprise, call the <Link href="/reference/get-metadata-templates-enterprise">`GET  /metadata_templates/enterprise`</Link> API
endpoint.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/metadata_templates/enterprise" \
       -H "authorization: Bearer <ACCESS_TOKEN>"
  ```

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

  ```python Python v10 theme={null}
  client.metadata_templates.get_enterprise_metadata_templates()
  ```

  ```csharp .NET v10 theme={null}
  await client.MetadataTemplates.GetEnterpriseMetadataTemplatesAsync();
  ```

  ```swift Swift v10 theme={null}
  try await client.metadataTemplates.getEnterpriseMetadataTemplates()
  ```

  ```java Java v10 theme={null}
  client.getMetadataTemplates().getEnterpriseMetadataTemplates()
  ```

  ```java Java v5 theme={null}
  Iterable<MetadataTemplate> templates = MetadataTemplate.getEnterpriseMetadataTemplates(api);
  for (MetadataTemplate templateInfo : templates) {
      // Do something with the metadata template.
  }
  ```

  ```py Python v4 theme={null}
  templates = client.get_metadata_templates()
  for template in templates:
      print(f'Metadata template {template.templateKey} is in enterprise scope')
  ```

  ```csharp .NET v6 theme={null}
  BoxEnterpriseMetadataTemplateCollection<BoxMetadataTemplate> templates = await client.MetadataManager
      .GetEnterpriseMetadataAsync();
  ```

  ```js Node v4 theme={null}
  client.metadata.getTemplates('enterprise')
   .then(templates => {
    /* templates -> {
     limit: 100,
     entries: 
     [ { templateKey: 'documentFlow',
      scope: 'enterprise_12345',
      displayName: 'Document Flow',
      hidden: false,
      fields: 
       [ { type: 'string',
        key: 'currentDocumentStage',
        displayName: 'Current Document Stage',
        hidden: false }
       { type: 'string',
        key: 'needsApprovalFrom',
        displayName: 'Needs Approval From',
        hidden: false },
       { type: 'string',
        key: 'nextDocumentStage',
        displayName: 'Next Document Stage',
        hidden: false }
       { type: 'float',
        key: 'maximumDaysAllowedInCurrentStage',
        displayName: 'Maximum Days Allowed In Current Stage',
        hidden: false }
      { templateKey: 'marketingCollateral',
      scope: 'enterprise_12345',
      displayName: 'Marketing Collateral',
      hidden: false,
      fields: 
       [ { type: 'string',
        key: 'audience1',
        displayName: 'Audience',
        hidden: false },
       { type: 'string',
        key: 'previousState',
        displayName: 'Previous State',
        hidden: false } ] },
      { templateKey: 'productInfo',
      scope: 'enterprise_12345',
      displayName: 'Product Info',
      hidden: false,
      fields: 
       [ { type: 'float',
        key: 'skuNumber',
        displayName: 'SKU Number',
        hidden: false },
       { type: 'enum',
        key: 'department',
        displayName: 'Department',
        hidden: false,
        options: 
        [ { key: 'Beauty' },
        { key: 'Shoes' },
        { key: 'Accessories' },
        { key: 'Clothing' },
        { key: 'Handbags' },
        { key: 'Bedding' },
        { key: 'Watches' } ] },
       { type: 'date',
        key: 'displayDate',
        displayName: 'Display Date',
        hidden: false } ] } ],
     next_marker: null,
     prev_marker: null }
    */
   });
  ```
</CodeGroup>

<Info>
  This API returns a list of all the metadata templates created by this
  enterprise, and these templates are only available to apply to files in this enterprise.
</Info>

## Pagination

This API uses <Link href="/guides/api-calls/pagination/marker-based">marker-based pagination</Link> and can return a
`next_marker` value in the response body to indicate that more templates might
be available.

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("List all metadata templates for enterprise"), href: "/reference/get-metadata-templates-enterprise", badge: "GET" },
{ label: translate("List all global metadata templates"), href: "/reference/get-metadata-templates-global", badge: "GET" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Get a metadata template"), href: "/guides/metadata/templates/get", badge: "GUIDE" },
{ label: translate("Create a metadata template"), href: "/guides/metadata/templates/create", badge: "GUIDE" },
{ label: translate("Update a metadata template"), href: "/guides/metadata/templates/update", badge: "GUIDE" }
]}
/>
