> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vern.so/llms.txt
> Use this file to discover all available pages before exploring further.

# List templates

> List the templates in your account — the importable objects, with their columns and validation rules — so your customers can pick what to import.

```http theme={null}
GET https://app.vern.so/api/v1/templates
GET https://app.vern.so/api/v1/templates/{template_slug}
```

Returns the **templates** in your account — the importable objects (Contacts,
Companies, and so on), each with its columns and validation rules. Use the list
to show your customer what they can import and let them choose, then pass the
chosen **slugs** as `templates` when you
[create a migration](/migration-api/create-a-migration).

Templates are scoped to your **account**, not to a single source — the same
object set is available to every source. List sources and templates separately
and let your customer pick each.

## Authentication

Requires an `x-api-key` header. See [Authentication](/migration-api/authentication).

## List all templates

```http theme={null}
GET https://app.vern.so/api/v1/templates
```

`200 OK`. Each template carries its `columns`, so you can render a preview of
exactly what each object holds.

```json theme={null}
{
  "templates": [
    {
      "slug": "contacts",
      "name": "Contacts",
      "description": "People at the customer's accounts.",
      "columns": [
        {
          "name": "Email",
          "description": "Primary email address.",
          "required": true,
          "unique": true,
          "desiredRule": "strict",
          "strictRule": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
        },
        {
          "name": "Account",
          "description": "The company this contact belongs to.",
          "required": true,
          "unique": false,
          "desiredRule": "link",
          "linkRule": [{ "templateId": "…", "columnName": "Name" }]
        }
      ]
    }
  ]
}
```

## Fetch one template

```http theme={null}
GET https://app.vern.so/api/v1/templates/{template_slug}
```

Returns a single active template by its slug. `404` if no active template has
that slug.

```json theme={null}
{
  "slug": "contacts",
  "name": "Contacts",
  "description": "People at the customer's accounts.",
  "columns": [ /* … */ ]
}
```

## Fields

<ResponseField name="slug" type="string">
  The template's stable public identifier — a snake\_case form of its name (e.g.
  `contacts`). Pass it in `templates` when you
  [create a migration](/migration-api/create-a-migration), and use it to address
  the sheet on [export](/migration-api/export-csv).
</ResponseField>

<ResponseField name="name" type="string">
  The template's display name — the object (e.g. "Contacts"). Becomes the sheet
  name on the migration's workbook.
</ResponseField>

<ResponseField name="description" type="string | null">
  An optional human description of the object.
</ResponseField>

<ResponseField name="columns" type="object[]">
  The object's fields and validation rules, in order. Each column has:

  <Expandable title="column">
    <ResponseField name="name" type="string">
      The column's display name.
    </ResponseField>

    <ResponseField name="description" type="string">
      What the column holds.
    </ResponseField>

    <ResponseField name="required" type="boolean">
      Whether every row must have a value for this column.
    </ResponseField>

    <ResponseField name="unique" type="boolean">
      Whether values in this column must be unique across rows.
    </ResponseField>

    <ResponseField name="desiredRule" type="string">
      The validation rule applied to the column: `none` (no format check), `ai`
      (Vern infers validity), `strict` (must match `strictRule`), or `link` (must
      reference another template via `linkRule`).
    </ResponseField>

    <ResponseField name="strictRule" type="string">
      A regular expression the value must match. Present only when `desiredRule`
      is `strict`.
    </ResponseField>

    <ResponseField name="linkRule" type="object[]">
      Cross-template references — `{ "templateId": "...", "columnName": "..." }`
      pointing at the column this one links to. Present only when `desiredRule`
      is `link`.
    </ResponseField>
  </Expandable>
</ResponseField>

## Errors

| Status | Meaning                                           |
| ------ | ------------------------------------------------- |
| `401`  | API key missing or invalid.                       |
| `404`  | (single fetch) No active template with that slug. |
| `429`  | Rate limit hit — back off and retry.              |
| `500`  | Server error.                                     |

## Example

```bash theme={null}
curl https://app.vern.so/api/v1/templates \
  -H "x-api-key: $VERN_API_KEY"

curl https://app.vern.so/api/v1/templates/contacts \
  -H "x-api-key: $VERN_API_KEY"
```

## Next

* [List sources](/migration-api/list-sources) — the systems you migrate from.
* [Create a migration](/migration-api/create-a-migration) — create a migration with the chosen templates.
