{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thousandeyes/json-schema/thousandeyes-templates-api-deploy-template-schema.json",
  "title": "Templates_API_DeployTemplate",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thousandeyes-templates-api-openapi.yml#/components/schemas/Templates_API_DeployTemplate",
  "type": "object",
  "properties": {
    "userInputValues": {
      "type": "object",
      "description": "Specifies the values to be used for all `userInputs` defined in the template. User must provide a value for each User Input defined in the template being deployed.",
      "additionalProperties": {
        "$ref": "#/$defs/Templates_API_UserInputValue"
      }
    },
    "name": {
      "type": "string",
      "description": "The name of the deployed template. This value will be used anywhere the `{{name}}` expression is used in the template being deployed."
    },
    "tags": {
      "type": "object",
      "description": "Optional overrides for tag configurations defined in the template. Each key corresponds to a tag asset key\ndefined in the template's `tags` map. Overrides are partial: you may set any combination of tag configuration fields; unspecified fields remain as defined in the template.\n",
      "additionalProperties": {
        "$ref": "#/$defs/Templates_API_TagConfigurationOverride"
      }
    }
  },
  "$defs": {
    "Templates_API_AccessType": {
      "type": "string",
      "description": "The access level of the tag. The access level determines the label's visibility in the UI and the permissions required to modify it. Accepted values are:\n\n\n* `all`: The tag is visible and editable by any user in the account group with the standard **View tags** or **Edit tags** permission. Default for all user-created tags.\n\n* `partner`: The tag is owned by a specific integration partner. Only that partner can read or modify it. It's hidden from all regular account users and excluded from their GET responses.\n\n* `system`: Reserved for ThousandEyes internal use only. This value may appear in GET responses on internally managed tags but cannot be set by users or integration partners. \n",
      "enum": [
        "all",
        "partner",
        "system"
      ]
    },
    "Templates_API_HandlebarsExpression": {
      "description": "A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.<key>}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{<asset key>.<field>}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n  **Note**: Due to dependencies, assets can only reference fields of other assets that appear earlier in the hierarchy below (e.g., labels cannot reference other assets, tests can reference labels and tags, etc.)\n  - Labels\n  - Tags\n  - Tests (can reference `{{labels.*.groupId}}` and `{{tags.*.id}}`)\n  - Endpoint Tests (can reference `{{labels.*.groupId}}` and `{{tags.*.id}}`)\n  - Connected Devices Tests (can reference `{{labels.*.groupId}}` and `{{tags.*.id}}`)\n  - Alert Rules\n  - Dashboard Filters\n  - Dashboards\n\n  Tags are deployed in two phases. Every field on the tag configuration except `assignments` (`key`, `value`, `objectType`, `accessType`, and optional `color`) is applied before dependent assets so that tag IDs are available for Handlebars references (for example, `{{tags.myTag.id}}`). The `assignments` field is applied after those assets exist (for example, after the tests you reference have been created), so it can resolve deployed IDs such as `{{tests.myTest.testId}}`. Both phases run automatically during deployment.\n",
      "type": "string",
      "pattern": ".*{{.*}}.*"
    },
    "Templates_API_TagAssignmentListTemplate": {
      "description": "A list of objects to assign a tag to.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Templates_API_TagAssignmentTemplate"
      }
    },
    "Templates_API_TagAssignmentObjectType": {
      "type": "string",
      "description": "The type of object that can be assigned a tag.",
      "enum": [
        "test",
        "endpoint-test",
        "connected-devices-test",
        "dashboard"
      ]
    },
    "Templates_API_TagAssignmentTemplate": {
      "type": "object",
      "description": "Identifies an object to assign a tag to.",
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "description": "The object ID, typically a Handlebars reference to a deployed test.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "type": {
          "description": "The type of object being assigned.",
          "anyOf": [
            {
              "$ref": "#/$defs/Templates_API_TagAssignmentObjectType"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        }
      }
    },
    "Templates_API_TagConfigurationOverride": {
      "type": "object",
      "description": "Partial override for a tag configuration defined in a template. All fields are optional;\nonly the fields you specify will override the corresponding values in the base template tag.\n",
      "properties": {
        "key": {
          "description": "The tag's key.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "value": {
          "description": "The tag's value.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "objectType": {
          "description": "The type of object the tag is associated with.",
          "anyOf": [
            {
              "$ref": "#/$defs/Templates_API_TagObjectTypeTemplate"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "accessType": {
          "description": "The access type of the tag.",
          "anyOf": [
            {
              "$ref": "#/$defs/Templates_API_AccessType"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "color": {
          "description": "The tag color as a hex code.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        },
        "assignments": {
          "description": "Override the tag assignments for this tag.",
          "anyOf": [
            {
              "$ref": "#/$defs/Templates_API_TagAssignmentListTemplate"
            },
            {
              "$ref": "#/$defs/Templates_API_HandlebarsExpression"
            }
          ]
        }
      }
    },
    "Templates_API_TagObjectTypeTemplate": {
      "type": "string",
      "description": "The type of object associated with the tag. Supported values for templates are:\n- `test` - CEA/Synthetic tests\n- `endpoint-test` - Endpoint tests\n- `connected-devices-test` - Connected Devices tests\n- `dashboard` - Dashboards\n",
      "enum": [
        "test",
        "endpoint-test",
        "connected-devices-test",
        "dashboard"
      ]
    },
    "Templates_API_UserInputValue": {
      "description": "A user input value. The type of object depends on the user input `type` field.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "object"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      ]
    }
  }
}