---
title: "Validate a command template"
method: POST
path: "/mop/validateTemplate"
tags: ["MOP"]
---

# Validate a command template

`POST /mop/validateTemplate`

## Request

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

Validates a command template without saving it. Ensures that no UI-based rules are ignored on the create and update endpoints.

## Request body

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

## Response `200`

Validation result: { isValid, errors, warnings }

- MopValidateTemplateResponse200
  - `isValid` boolean: Whether the template passed every deep-validation check.
  - `errors` MopValidateTemplatePostResponsesContentApplicationJsonSchemaErrorsItems[]: Errors found, each shaped { path, message }. Empty when isValid is true.
    - `path` string
    - `message` string
  - `warnings` MopValidateTemplatePostResponsesContentApplicationJsonSchemaWarningsItems[]: Non-blocking issues found, each shaped { path, message }.
    - `path` string
    - `message` 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)
