---
title: "Import Template"
method: POST
path: "/api/template/v2/templates/import"
tags: ["Template"]
---

# Import Template

`POST /api/template/v2/templates/import`

Use this API to import the metadata of a specific template in JSON format in order to migrate the template from one environment/tenant to another environment/tenant. Before calling this API, use the [Export Template](/onetrust/reference/exporttemplatewithbusinesskeysusingget) API to obtain the template metadata in JSON format. The JSON response body obtained from the Export Template API can then be pasted within the Import Template request body (BODY PARAMS).

 > 🗒 Things to Know
 > 
 > - After the import, the template will reflect on the Templates page in Draft status.
 >
 > - If a template with the same name already exists on the destination environment, then the migration will fail (HTTP Response Status Code 400: Duplicate template name). Please ensure that no templates (Active or Archived) already exist with the same name as the template being migrated.
 >
 > - If your template contains questions linked to custom inventory attributes, it is crucial that the same attributes have already been created in the destination environment/tenant and are an identical match.

## Query parameters

- `matchAttributesByName` boolean, required — If true, will match attributes by name during import

## Request body

- object

## Response `200`

OK

- TemplateTemplateCreateResponse
  - `id` string, uuid — The unique identifier of the created template.
  - `rootVersionId` string, uuid — The root version identifier of the template used for version management.
  - `templateVersion` integer — The version number of the template indicating its iteration.
  - `languageCode` string — The language code specifying the localization of the template.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `429` — Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500` — Internal Server Error

---

[API](https://skmtc.net/onetrust/apis/platform-access-management.md) · [All operations](https://skmtc.net/onetrust/apis/platform-access-management/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onetrust/platform-access-management/versions/21de3aa0b170/schema)
