---
title: "Create an analytic template"
method: POST
path: "/mop/createAnalyticTemplate"
tags: ["MOP"]
---

# Create an analytic template

`POST /mop/createAnalyticTemplate`

## Request

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

Creates an Analytic Template.

## Request body

- object
  - `template` 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

## Response `200`

Result of the creation.

- MopMopAnalyticTemplateDocSuccessResponse
  - `result` MopMopAnalyticTemplateDocSuccessResponseResult
    - `n` integer
    - `ok` integer
  - `ops` MopMopAnalyticTemplateDocSuccessResponseOpsItems[]
    - `_id` string
    - `name` string, required
    - `description` string
    - `namespace` MopMopAnalyticTemplateDocSuccessResponseOpsItemsNamespace
      - `type` unknown
      - `_id` string
      - `name` string
      - `accessControl` MopMopAnalyticTemplateDocSuccessResponseOpsItemsNamespaceAccessControl
        - `read` string[]
        - `execute` string[]
        - `write` string[]
        - `manage` string[]
    - `os` string
    - `passRule` boolean
    - `prepostCommands` MopMopAnalyticTemplateDocSuccessResponseOpsItemsPrepostCommandsItems[]
      - `preRawCommand` string
      - `postRawCommand` string
      - `passRule` boolean
      - `rules` MopMopAnalyticTemplateDocSuccessResponseOpsItemsPrepostCommandsItemsRulesItems[]
        - `type` string
        - `preRegex` string
        - `postRegex` string
        - `evaluation` string
      - `preCommandResHTML` string
      - `postCommandResHTML` string
    - `created` integer
    - `createdBy` string, nullable
    - `lastUpdated` integer
    - `lastUpdatedBy` string, nullable
  - `insertedCount` integer
  - `insertedIds` MopMopAnalyticTemplateDocSuccessResponseInsertedIds
    - `0` string

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