---
title: "Import template"
method: POST
path: "/mop/import"
tags: ["MOP"]
---

# Import template

`POST /mop/import`

## Request

- Base URL: `https://example.itential.io`
- URL: `https://example.itential.io/mop/import`
- Auth: none declared

Imports a single template.

## Request body

- object
  - `template` union
    - MopMopTemplateDoc: A mop template object
      - `_id` string
      - `name` string, required
      - `description` string
      - `namespace` MopMopTemplateDocNamespace
        - `type` unknown
        - `_id` string
        - `name` string
        - `accessControl` MopMopTemplateDocNamespaceAccessControl
          - `read` string[]
          - `execute` string[]
          - `write` string[]
          - `manage` string[]
      - `os` string
      - `passRule` boolean
      - `commands` MopMopTemplateDocCommandsItems[]
        - `command` string
        - `passRule` boolean
        - `rules` MopMopTemplateDocCommandsItemsRulesItems[]
          - `rule` string, required
          - `eval` string, required
          - `raw` string
          - `result` boolean
      - `created` integer
      - `createdBy` string, nullable
      - `lastUpdated` integer
      - `lastUpdatedBy` string, nullable
    - MopMopAnalyticTemplateDoc: A mop analytic template object
      - `_id` string
      - `name` string, required
      - `description` string
      - `namespace` MopMopAnalyticTemplateDocNamespace
        - `type` unknown
        - `_id` string
        - `name` string
        - `accessControl` MopMopAnalyticTemplateDocNamespaceAccessControl
          - `read` string[]
          - `execute` string[]
          - `write` string[]
          - `manage` string[]
      - `os` string
      - `passRule` boolean
      - `prepostCommands` MopMopAnalyticTemplateDocPrepostCommandsItems[]
        - `preRawCommand` string
        - `postRawCommand` string
        - `passRule` boolean
        - `rules` MopMopAnalyticTemplateDocPrepostCommandsItemsRulesItems[]
          - `type` string
          - `preRegex` string
          - `postRegex` string
          - `evaluation` string
        - `preCommandResHTML` string
        - `postCommandResHTML` string
      - `created` integer
      - `createdBy` string, nullable
      - `lastUpdated` integer
      - `lastUpdatedBy` string, nullable
  - `type` 'templates' | 'analytics'

## Response `200`

Import status

- boolean

## Other responses

- `500`: Error response from API

---

[API](https://skmtc.dev/itential/apis/itential-2.md) - [All operations](https://skmtc.dev/itential/apis/itential-2/llms.txt) - [OpenAPI document](https://skmtc.dev/itential/apis/itential-2/revisions/2095cc90e583?raw)
