> For the complete documentation index, see [llms.txt](https://docs.durohub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.durohub.com/exports/export-templates.md).

# Exports and Export Templates

An export turns a set of components into a spreadsheet you can hand to purchasing, a contract manufacturer, or another system. Every export is driven by an **export template**: a short YAML file, saved in your library, that decides how deep to walk each BOM, which revision to read, which columns to write and what to call them, and whether to bundle documents.

This page walks through building a template from scratch and running it from the Duro app and from the API, then covers every setting in detail.

{% hint style="info" %}
**Change order packages are separate.** When a change order closes, Duro builds its export package (summary, items, approval record and documents) automatically. Those packages don't use export templates and aren't covered here. See [Change Orders](https://docs.durohub.com/core-concepts/change-orders.md).
{% endhint %}

## How an Export Works

Three things come together when you run an export:

| Piece                 | What it decides                                                                | Where it lives                       |
| --------------------- | ------------------------------------------------------------------------------ | ------------------------------------ |
| **Sources**           | The components you picked. Each one is a BOM root or a row in a component list | Chosen per export                    |
| **Template**          | Depth, revision, documents, columns, column headers                            | Saved in the library and reused      |
| **Per-job overrides** | Changes for this one export only, such as a different depth                    | Sent with the export and never saved |

Duro copies the template's settings into the export job when it starts, applies any overrides on top, and builds the file in the background. Editing a template later never changes an export that has already run.

The result is always a **`.zip` package**. It holds the spreadsheet and, when documents are included, the document files:

```
bom-export-3f2a9c1d.zip
└── PCA-100045-Export-2026-11-09/
    ├── export.xlsx
    ├── documents/
    │   ├── PCA-100045/
    │   │   └── assembly-drawing.pdf
    │   └── 210-000123/
    │       └── datasheet.pdf
    └── general-documents/
        └── test-procedure.docx
```

Documents linked to a part or assembly go under `documents/<CPN>/`. Document components you picked directly as sources go under `general-documents/`.

***

## Tutorial: Build a Purchasing BOM Template

Say purchasing wants a flat list of every part in an assembly, with part numbers, quantities, mass and finish, and the current quotes, using their own column names. Here's how to set that up.

### Step 1: Look at the Default template

Every library starts with a template named **Default**, which is the library's default template. Find it in the app under **Library Settings → Templates → Exports**. It exports everything:

```yaml
assembly_depth: all_levels_indented
revision: latest
include_documents: true
fields:
  include_all: true
```

`include_all: true` writes every system column, every sourcing column and every custom attribute in your library. That's a good start, but it's often far more than anyone needs.

### Step 2: Find your column keys

A template names columns by **key**, not by the header you see in the spreadsheet. There are three kinds:

* **System fields** such as `cpn`, `name`, `quantity` and `revision`. See [System fields](#system-fields).
* **Sourcing fields**, written as `src:` and then the field name, such as `src:mpn` and `src:unitPrice`. See [Sourcing fields](#sourcing-fields).
* **Custom attributes**, written as `attr_` and then the attribute's name exactly as it appears in your library's category registry: `attr_Mass`, `attr_Finish`, `attr_Operating Temperature`.

{% hint style="warning" %}
**Attribute keys match the attribute name exactly, including case and spaces.** If your registry defines `Mass`, the key is `attr_Mass`. `mass` and `attr_mass` don't match. Duro refuses to save a template with a key that matches nothing, and suggests the key you probably meant. See [When Duro refuses a template](#when-duro-refuses-a-template).
{% endhint %}

### Step 3: Write the template

```yaml
# Purchasing BOM: every part once, with quotes, in purchasing's column names.

assembly_depth: all_levels_flat   # whole tree, no indentation
revision: released                # what was last released, not work in progress
include_documents: false          # spreadsheet only, no files

fields:
  include_all: false              # write only the columns listed below, in this order
  include:
    - cpn
    - name
    - quantity
    - ref_des
    - attr_Mass
    - attr_Finish
    - src:manufacturer
    - src:mpn
    - src:distributor
    - src:unitPrice
    - src:leadTime

mappings:
  cpn: Part Number
  name: Part Name
  ref_des: RefDes
  attr_Mass: Weight (g)
  src:mpn: Mfr Part Number
  src:unitPrice: Unit Cost
```

Some notes:

* With `include_all: false`, the columns are exactly the `include` list, in that order.
* `mappings` only renames headers. Its keys are column keys, so the Mass attribute is renamed with `attr_Mass`, not `mass`.
* Any `src:` column turns on sourcing. Each quote gets its own row: the component's first quote goes on its own row, and each further quote goes on a row that repeats only the CPN, the name and the sourcing columns. Sourcing is always today's sourcing, even with `revision: released`.

### Step 4: Save it

**In the app:** go to **Library Settings → Templates → Exports**, create a template, name it `Purchasing BOM`, paste the YAML and save. You need the **Manage Export Templates** permission.

**Through the API:**

```graphql
mutation CreatePurchasingTemplate($yaml: String!) {
  exportTemplate {
    create(input: { name: "Purchasing BOM", configYAML: $yaml }) {
      id
      name
      isDefault
      config
    }
  }
}
```

Duro checks the template when you save it. If anything is wrong, the save fails with `EXPORT_INVALID_CONFIG`, and the message lists every problem it found:

```
Invalid export template configuration: unknown key "include-documents" (did you mean "include_documents"?); mappings: unknown column "mass" (did you mean "attr_Mass"?)
```

See [When Duro refuses a template](#when-duro-refuses-a-template).

{% hint style="info" %}
**Duro stores templates as data, not as text.** Comments and formatting in your YAML are not kept: reading the template back returns its `config` as JSON. If the comments matter to your team, keep the YAML in source control and treat that copy as the original.
{% endhint %}

### Step 5: Run it from the app

1. Select components in your library and choose **Export**, or open the **Export** page and add them from the **Library** tab.
2. On the **Settings** tab, choose **Purchasing BOM** under **Template**. The settings below it fill in from the template.
3. Change anything you need for this export only. Under **Fields included**, **Customize** lists every column the export can write: the system fields, the sourcing fields and each of your library's attributes, with its key on the left. Tick, drag and rename columns there.
4. Choose **Export**, then **Download**, **Email**, or both.

If you change nothing, the export runs exactly as the template says. If you do change something, only that change is applied, for this export only. It isn't saved to the template, and everything else in the template still applies, including columns and renames the page doesn't list.

The app picks the export type from the **Assembly** setting: **None** runs a component list, and any other choice runs a BOM. See [BOM or component list?](#bom-or-component-list).

### Step 6: Run it from the API

Running an export through the API takes three calls: start the job, poll it, then download the package.

**Start the job.** Pick the template with `templateName` or `templateId`. Leave both out to use the library's default template.

```graphql
mutation StartExport {
  exportJob {
    create(input: {
      exportType: BOM
      sources: [{ componentId: "8b0e6a52-1c3f-4a8e-9d55-2f7c1a9e4b10" }]
      templateName: "Purchasing BOM"
      deliveryMethod: DOWNLOAD
    }) {
      id
      status
    }
  }
}
```

```bash
curl 'https://api.durohub.com/graphql' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-organization: @your-org' \
  -H 'x-library: @your-org/your-library' \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation { exportJob { create(input: { exportType: BOM, sources: [{ componentId: \"8b0e6a52-1c3f-4a8e-9d55-2f7c1a9e4b10\" }], templateName: \"Purchasing BOM\", deliveryMethod: DOWNLOAD }) { id status } } }"}'
```

**Poll until the job finishes.** The status moves from `PENDING` to `PROCESSING`, and ends at `COMPLETED`, `FAILED` or `CANCELLED`. A few seconds between polls is plenty.

```graphql
query ExportStatus($id: ID!) {
  exportJob {
    findOne(id: $id) {
      status
      fileName
      fileSizeBytes
      downloadUrl
      failureReason
      errorMessage
    }
  }
}
```

**Download the package.** `downloadUrl` is only set once the job is `COMPLETED`. Each query returns a new signed link that expires after about an hour, so query the job again whenever you need a link instead of storing one.

With `deliveryMethod: EMAIL` or `BOTH`, Duro also emails a download link. The user the request runs as always gets the email, and `emailRecipients` adds more addresses:

```graphql
emailRecipients: ["buyer@your-company.com", "cm@partner.com"]
```

| Input                         | Required | Notes                                                                                                        |
| ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `exportType`                  | Yes      | `BOM` or `COMPONENT_LIST`. See [BOM or component list?](#bom-or-component-list)                              |
| `sources`                     | Yes      | One or more `{ componentId, revisionId }`. `revisionId` is optional and pins a source to a specific revision |
| `deliveryMethod`              | Yes      | `DOWNLOAD`, `EMAIL` or `BOTH`                                                                                |
| `templateId` / `templateName` | No       | Use one or the other, not both. With neither, Duro uses the library's default template                       |
| `configOverrides`             | No       | Settings changed for this export only. See [Per-job overrides](#per-job-overrides)                           |
| `emailRecipients`             | No       | More addresses for `EMAIL` or `BOTH`                                                                         |

{% hint style="info" %}
**Exports have their own rate limits.** Starting exports (`exportJob.create`) and checking on them (`exportJob.findOne`) each have a budget. See [Budget Reference](https://docs.durohub.com/rate-limits/budgets.md).
{% endhint %}

***

## BOM or Component List?

The **export type** decides what shape the rows take. The template's `assembly_depth` setting only applies to BOMs.

|                                                                           | `BOM`                                                                              | `COMPONENT_LIST`                                                     |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| Rows                                                                      | Each source, then its BOM down to `assembly_depth`                                 | Exactly the sources, one row each                                    |
| `assembly_depth`                                                          | Used                                                                               | Ignored                                                              |
| BOM-only columns (`level`, `quantity`, `ref_des`, `item_number`, `notes`) | Always kept                                                                        | Left out when every row would be blank, even if `include` lists them |
| `include_variants`                                                        | Used                                                                               | Ignored                                                              |
| File name inside the package                                              | `<CPN>-Export-<date>.xlsx` for a single source, otherwise `BOM-Export-<date>.xlsx` | `Component-Export-<date>.xlsx`                                       |

**In the app**, the type follows the **Assembly** setting: **None** runs a component list, and anything else runs a BOM.

**In the API**, you set `exportType` yourself, and it doesn't change with the template. A `BOM` export with `assembly_depth: none` exports the sources alone, but still as BOM lines with a level of 0.

If a source also appears in the BOM of another source in the same export, it isn't repeated as a separate root. It appears once, in its place in that tree.

***

## Template Reference

A template has four required keys and four optional ones:

```yaml
assembly_depth: all_levels_indented   # required
revision: latest                      # required
include_documents: true               # required
include_document_files: false         # optional, defaults to false
document_file_extensions: [pdf, step] # optional, defaults to every document
include_variants: false               # optional, defaults to false
fields:                               # required
  include_all: true
mappings: {}                          # optional
```

Duro refuses to save a template that's missing a required key, has a value of the wrong type, or uses a key or column it doesn't recognise. See [When Duro refuses a template](#when-duro-refuses-a-template).

### `assembly_depth`

How far down each BOM to go. Only used by `BOM` exports: a `COMPONENT_LIST` export always writes exactly the selected components, one row each.

| Value                 | Rows                                              | The Level column                        |
| --------------------- | ------------------------------------------------- | --------------------------------------- |
| `none`                | Only the sources                                  | `0`                                     |
| `first_level`         | Sources and their direct children                 | `0` for sources, `1` for children       |
| `all_levels_indented` | The whole tree, each child right after its parent | The depth of each row: `0`, `1`, `2`, … |
| `all_levels_flat`     | The whole tree, in the same order                 | Blank                                   |

The full tree goes up to 10 levels deep. A part used in more than one place appears once in each place, so its quantities aren't added together.

### `revision`

Which version of each component to export.

| Value      | Behavior                                                                                                                                  |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `latest`   | The current, working data                                                                                                                 |
| `released` | Each source at its last release, and the BOM as it stood in that release. A source that was never released falls back to its current data |

A source's `revisionId` in `sources` always wins: that revision is exported whatever `revision` says.

### Documents

| Key                        | Required | Effect                                                                                                                                                                                                                                                                                                   |
| -------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `include_documents`        | Yes      | `true` fills the **Documents** column with a download link for each linked document, **and** adds the document files to the package                                                                                                                                                                      |
| `include_document_files`   | No       | Defaults to `false`. With `include_documents: false`, `true` adds the document files to the package without filling the Documents column. It makes no difference when `include_documents` is `true`, which already bundles the files                                                                     |
| `document_file_extensions` | No       | A list of file extensions, each written without the dot and matched in any case, for example `[pdf, step]`. Only documents whose file name ends in one of them are included. An empty list, `[]`, includes no documents. Leave it out to include every document. Applies to both the links and the files |

To leave documents out completely, set `include_documents: false` and leave out `include_document_files`. To ship the files but keep the spreadsheet free of links, set `include_documents: false` and `include_document_files: true`.

The Documents column is part of `include_all`. With documents turned off it's written but stays empty. To drop it, add `documents` to `exclude`.

Document links in the spreadsheet are signed links that expire, just like `downloadUrl`. For a copy that lasts, use the files in the package.

### `include_variants`

For `BOM` exports only. When `true`, each BOM line that has permitted variants gets one extra row for each permitted variant after the active part and its sub-tree. A **Variant** column marks each of these rows `Active` or `Alternate`.

* The Variant column goes right after `cpn`, even when you use an `include` list. To leave it out, add `variant` to `exclude`. To place it yourself, list `variant` where you want it.
* An alternate row shares the line's quantity, reference designators, item number and notes. Its own BOM isn't expanded, and it gets no sourcing rows.
* A line with no explicit permitted variants gets no extra rows.

### `fields`

`fields` decides which columns are written and in what order.

| Key           | Type              | Purpose                                                                                                       |
| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------- |
| `include_all` | boolean, required | `true`: start from every system, sourcing and custom attribute column. `false`: write only the `include` list |
| `include`     | list of keys      | With `include_all: false`, the exact columns in the exact order                                               |
| `order`       | list of keys      | With `include_all: true`, columns to move to the front. Every other column follows in the default order       |
| `exclude`     | list of keys      | Columns to remove. Applied last, in both modes                                                                |

Here's how Duro works out the columns:

1. **`include_all: false` with an `include` list:** the columns are the `include` list, in order. `order` is ignored.
2. **`include_all: true`:** start with every column in the default order: the [system fields](#system-fields) as shown in that table, then the [sourcing fields](#sourcing-fields) as shown in theirs, then every custom attribute in the library sorted by name. If there's an `order` list, those columns move to the front, in the order listed, and the rest keep the default order after them.
3. **Then `exclude`:** drop any column it names.

{% hint style="warning" %}
**`include_all: false` needs an `include` list.** Without one, Duro writes every column, as if `include_all` were `true`.
{% endhint %}

Example: put the identifying columns first and remove internal ones, keeping everything else:

```yaml
fields:
  include_all: true
  order: [cpn, name, revision, attr_Mass]
  exclude: [eid, where_used, last_updated]
```

### `mappings`

Renames column headers. Each key is a column key, the same `cpn`, `src:` or `attr_` key you'd write in `fields`, and each value is the header you want:

```yaml
mappings:
  cpn: Part Number
  src:unitPrice: Unit Cost (USD)
  attr_Operating Temperature: Temp Range
```

A column you don't rename keeps its default header: the **Default header** shown in the tables below, or the attribute's name for an `attr_` column.

***

## Column Keys

### System fields

These are listed in their default order, which is the order `include_all: true` uses.

| Key            | Default header       | Value                                                               |
| -------------- | -------------------- | ------------------------------------------------------------------- |
| `level`        | Level                | The row's depth in the BOM. See [`assembly_depth`](#assembly_depth) |
| `item`         | Item                 | The row's position in this export: 1, 2, 3, …                       |
| `cpn`          | CPN                  | The component's part number                                         |
| `category`     | Category             | The category name                                                   |
| `name`         | Name                 | The component name                                                  |
| `where_used`   | Where Used           | In a BOM, the CPNs of the parents that use this part in this export |
| `eid`          | EID                  | The external ID                                                     |
| `revision`     | Revision             | The revision value                                                  |
| `status`       | Status               | The status name                                                     |
| `state`        | State                | `Released` or `Modified`                                            |
| `description`  | Description          | The component description                                           |
| `quantity`     | Quantity             | The BOM line's quantity                                             |
| `ref_des`      | Reference Designator | The BOM line's reference designators                                |
| `item_number`  | Item Number          | The item number stored on the BOM line                              |
| `notes`        | Notes                | The BOM line's notes                                                |
| `last_updated` | Last Updated         | When the component was last updated                                 |
| `documents`    | Documents            | Links to linked documents. See [Documents](#documents)              |
| `variant`      | Variant              | `Active` or `Alternate`. Only exists with `include_variants: true`  |

`quantity`, `ref_des`, `item_number` and `notes` belong to a BOM line, so a source at the top of a BOM has none.

### Sourcing fields

Sourcing columns use the same keys and headers as the component import, so you can edit an export and [import it again](https://docs.durohub.com/core-concepts/importing-components.md#exporting-and-re-importing-sourcing). They are listed in their default order.

| Key                   | Default header           |
| --------------------- | ------------------------ |
| `src:manufacturer`    | Manufacturer             |
| `src:mpn`             | MPN                      |
| `src:mfrDescription`  | Manufacturer Description |
| `src:datasheet`       | Datasheet                |
| `src:mpnUrl`          | MPN Link                 |
| `src:warranty`        | Warranty (Months)        |
| `src:mfrLeadTime`     | Manufacturer Lead Time   |
| `src:distributor`     | Distributor              |
| `src:dpn`             | DPN                      |
| `src:packageQuantity` | Package Quantity         |
| `src:minQuantity`     | Minimum Quantity         |
| `src:maxQuantity`     | Maximum Quantity         |
| `src:unitPrice`       | Unit Price               |
| `src:currency`        | Currency                 |
| `src:leadTime`        | Quote Lead Time          |
| `src:distDescription` | Distributor Description  |
| `src:dpnUrl`          | DPN Link                 |
| `src:packageType`     | Package Type             |
| `src:priority`        | Priority                 |

Sourcing is written only when at least one `src:` column is left after `include`, `order` and `exclude` are applied. To export without sourcing, leave every `src:` key out of `include`, or list all of them in `exclude`.

{% hint style="info" %}
**Older "Sourcing" attributes.** Some libraries still have the older sourcing attributes, such as `MPN`, `Manufacturer` and `Unit Price`, as custom attributes. When an export writes sourcing, an older attribute column with no values is left out so no header appears twice. One that still holds values is kept, under the header `<Name> (legacy attribute)`.
{% endhint %}

### Custom attributes

Write `attr_` followed by the attribute's name exactly as it appears in your category registry. See [Category Registry](https://docs.durohub.com/library-configuration/registry.md).

| Attribute in the registry | Key                          |
| ------------------------- | ---------------------------- |
| `Mass`                    | `attr_Mass`                  |
| `Operating Temperature`   | `attr_Operating Temperature` |
| `RoHS`                    | `attr_RoHS`                  |

An attribute column's default header is the attribute's name. A component with no value for that attribute gets an empty cell.

***

## Per-job Overrides

`configOverrides` on `exportJob.create` changes settings for one export without touching the template. Duro merges it over the template like this:

* **Top-level keys replace the template's value.** That includes `mappings`: send the complete set of renames you want, not just the ones that change.
* **Keys inside `fields` replace the template's matching key**, and the rest of `fields` stays as it is. An `exclude` you send replaces the template's `exclude` list rather than adding to it.

Duro checks the keys and columns in `configOverrides` the same way it checks a template you save, and refuses an override with an unknown one with `EXPORT_INVALID_CONFIG`. An override may repeat any column the template itself names, and an override that is exactly the settings of an earlier export in this library is accepted as it is, so re-running a past export always works. The template you run isn't checked again, so a template saved earlier keeps working even if an attribute it names has since been renamed.

```graphql
mutation {
  exportJob {
    create(input: {
      exportType: BOM
      sources: [{ componentId: "8b0e6a52-1c3f-4a8e-9d55-2f7c1a9e4b10" }]
      templateName: "Purchasing BOM"
      deliveryMethod: EMAIL
      configOverrides: {
        assembly_depth: "first_level"
        revision: "latest"
        fields: { exclude: ["src:leadTime"] }
      }
    }) { id status }
  }
}
```

Any template setting can be overridden, including [`document_file_extensions`](#documents), for example `document_file_extensions: ["pdf"]` to send only PDFs this time.

***

## When Duro Refuses a Template

Saving a template, with `exportTemplate.create`, `exportTemplate.update` or in the app, checks the whole configuration. The save fails with `EXPORT_INVALID_CONFIG` if any of these is true:

* A required key is missing, or a value has the wrong type or isn't one of the allowed values.
* There's a top-level key other than `assembly_depth`, `revision`, `include_documents`, `include_document_files`, `include_variants`, `document_file_extensions`, `fields` and `mappings`.
* `fields` has a key other than `include_all`, `include`, `exclude` and `order`.
* A column key in `include`, `exclude`, `order` or `mappings` isn't one of the [system fields](#system-fields), `variant`, a [sourcing field](#sourcing-fields), or `attr_` followed by the exact name of an attribute in this library.

The error lists every problem at once, in the message and as a list in `extensions.problems`:

```json
{
  "errors": [
    {
      "message": "Invalid export template configuration: unknown key \"bogus_option\"; fields.exclude: unknown column \"mass\" (did you mean \"attr_Mass\"?)",
      "extensions": {
        "code": "EXPORT_INVALID_CONFIG",
        "problems": [
          "unknown key \"bogus_option\"",
          "fields.exclude: unknown column \"mass\" (did you mean \"attr_Mass\"?)"
        ]
      }
    }
  ]
}
```

When Duro can tell what you meant, it adds a suggestion. Here are some common mistakes:

| You wrote                                               | Duro suggests                                       |
| ------------------------------------------------------- | --------------------------------------------------- |
| `includeDocuments`, `include-documents`                 | `include_documents`                                 |
| `mass`, `Mass`, `attr_mass`, `attr:Mass`, `system:mass` | `attr_Mass`, if your library has a `Mass` attribute |
| `attr:<attribute id>`                                   | `attr_` followed by that attribute's name           |
| `CPN`, `system:cpn`                                     | `cpn`                                               |
| `SRC:MPN`                                               | `src:mpn`                                           |

{% hint style="info" %}
**Templates saved before these checks keep working.** Running an export doesn't re-check the template, so a template saved earlier, or one naming an attribute that has since been renamed, still exports as before. It has to be fixed the next time someone saves it.
{% endhint %}

***

## Managing Templates Through the API

| Operation                                                                         | Purpose                                                        |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `exportTemplate.findAll(input: { first, after })`                                 | List the library's templates, newest first                     |
| `exportTemplate.findOne(id)`                                                      | Read one template                                              |
| `exportTemplate.create(input: { name, configYAML \| configJSON, isDefault })`     | Create a template                                              |
| `exportTemplate.update(input: { id, name, configYAML \| configJSON, isDefault })` | Change a template. Leave a field out to keep its current value |
| `exportTemplate.setDefault(id)`                                                   | Make this the library's default template                       |
| `exportTemplate.delete(id)`                                                       | Archive a template                                             |

* Send the configuration as YAML in `configYAML` or as an object in `configJSON`, not both.
* A library has one default template. Making a template the default, with `setDefault` or `isDefault: true`, removes the flag from the old one.
* Template names are unique within a library. Creating a template, or renaming one, with a name that's already in use fails with `EXPORT_TEMPLATE_NAME_TAKEN`. An archived template's name can be used again.
* Archiving the default template leaves the library without one. After that, an export that names no template fails with `EXPORT_NO_DEFAULT_TEMPLATE` until you set a new default.

```graphql
mutation {
  exportTemplate {
    update(input: {
      id: "c1d2e3f4-0000-4000-8000-000000000001"
      configJSON: {
        assembly_depth: "all_levels_flat"
        revision: "released"
        include_documents: false
        fields: { include_all: false, include: ["cpn", "name", "quantity", "src:mpn"] }
      }
    }) { id updatedAt }
  }
}
```

***

## Permissions

| Permission                                           | Lets you                                                   |
| ---------------------------------------------------- | ---------------------------------------------------------- |
| `exports.create` (Run Exports)                       | Run exports, read export jobs, and list and read templates |
| `exports.templates.manage` (Manage Export Templates) | Create, update, set the default for and delete templates   |

See [Role-Based Access Control](https://docs.durohub.com/advanced-topics/rbac.md).

***

## Troubleshooting

| Symptom                                                                   | Cause and fix                                                                                                                             |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| A column is empty and its header is the key itself, such as `attr_Weight` | The template names an attribute that has since been renamed or archived. Edit the template; the save will tell you the key to use         |
| A rename in `mappings` does nothing                                       | The key under `mappings` isn't the column's key. Attributes need the `attr_` prefix: `attr_Mass`, not `mass`                              |
| Every column is written although `include_all` is `false`                 | The template has no `include` list                                                                                                        |
| Level, Quantity or Ref Des is missing from a component list               | They're left out of a component list when every row would be blank. Run a `BOM` export to keep them                                       |
| Some components have more than one row                                    | They have more than one quote. Each quote gets its own row while a `src:` column is in the export                                         |
| The package has document files you didn't expect                          | `include_documents: true` adds the files as well as the links                                                                             |
| `EXPORT_TEMPLATE_NOT_FOUND`                                               | The `templateId` or `templateName` doesn't match a template in this library. Names are case-sensitive, and archived templates don't count |
| `EXPORT_TEMPLATE_NAME_TAKEN`                                              | Another template in this library already has that name. Choose a different name, or update the existing template                          |
| `EXPORT_TEMPLATE_LOOKUP_CONFLICT`                                         | You sent both `templateId` and `templateName`. Send one                                                                                   |
| `EXPORT_NO_DEFAULT_TEMPLATE`                                              | You named no template and the library has no default. Name one, or set a default                                                          |
| `EXPORT_CONFIG_REQUIRED` / `EXPORT_CONFIG_CONFLICT`                       | Creating a template needs exactly one of `configYAML` and `configJSON`                                                                    |
| `EXPORT_INVALID_CONFIG`                                                   | The template or override isn't valid. The message lists every problem. See [When Duro refuses a template](#when-duro-refuses-a-template)  |
| A job ends `FAILED` with `failureReason: SOURCING_UNAVAILABLE`            | Sourcing couldn't be read in time. This is temporary, so run the export again                                                             |

## Next Steps

* Edit an exported sheet and bring it back with [Importing Components](https://docs.durohub.com/core-concepts/importing-components.md)
* Define the attributes your templates reference in the [Category Registry](https://docs.durohub.com/library-configuration/registry.md)
* Handle failures generally with [Error Handling](https://docs.durohub.com/advanced-topics/error-handling.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.durohub.com/exports/export-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
