{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-update-task-template-request-schema.json",
  "title": "UpdateTaskTemplateRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-task-api-openapi.yml#/components/schemas/UpdateTaskTemplateRequest",
  "type": "object",
  "properties": {
    "TaskTemplateId": {
      "type": "string",
      "description": "A unique identifier for the task template."
    },
    "InstanceId": {
      "type": "string",
      "description": "The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance."
    },
    "Name": {
      "type": "string",
      "description": "The name of the task template."
    },
    "Description": {
      "type": "string",
      "description": "The description of the task template."
    },
    "ContactFlowId": {
      "type": "string",
      "description": "The identifier of the flow that runs by default when a task is created by referencing this template. Although this parameter is marked as optional, the request must contain either a ContactFlowId or a field of type QUICK_CONNECT."
    },
    "SelfAssignFlowId": {
      "type": "string",
      "description": "The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task."
    },
    "ContactHooks": {
      "$ref": "#/$defs/TaskTemplateContactHooks"
    },
    "Constraints": {
      "$ref": "#/$defs/TaskTemplateConstraints"
    },
    "Defaults": {
      "$ref": "#/$defs/TaskTemplateDefaults"
    },
    "Status": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "INACTIVE"
      ],
      "description": "Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be created from ACTIVE templates. If a template is marked as INACTIVE, then a task that refers to this template cannot be created. Although this parameter is marked as optional, the service requires it when calling UpdateTaskTemplate."
    },
    "Fields": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TaskTemplateField"
      },
      "description": "Fields that are part of the template. The request must contain exactly one field of type NAME. This field must also be listed in the RequiredFields array within the Constraints parameter."
    }
  },
  "required": [
    "TaskTemplateId",
    "InstanceId"
  ],
  "$defs": {
    "InvisibleFieldInfo": {
      "type": "object",
      "properties": {
        "Id": {
          "$ref": "#/$defs/TaskTemplateFieldIdentifier"
        }
      }
    },
    "ReadOnlyFieldInfo": {
      "type": "object",
      "properties": {
        "Id": {
          "$ref": "#/$defs/TaskTemplateFieldIdentifier"
        }
      }
    },
    "RequiredFieldInfo": {
      "type": "object",
      "properties": {
        "Id": {
          "$ref": "#/$defs/TaskTemplateFieldIdentifier"
        }
      }
    },
    "TaskTemplateConstraints": {
      "type": "object",
      "properties": {
        "RequiredFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RequiredFieldInfo"
          },
          "description": "Lists the fields that are required to be filled by agents."
        },
        "ReadOnlyFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReadOnlyFieldInfo"
          },
          "description": "Lists the fields that are read-only to agents, and cannot be edited."
        },
        "InvisibleFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InvisibleFieldInfo"
          },
          "description": "Lists the fields that are invisible to agents."
        }
      }
    },
    "TaskTemplateContactHooks": {
      "type": "object",
      "properties": {
        "WrapUpFlowId": {
          "type": "string",
          "description": "The identifier of the flow module that runs when an agent attempts to disconnect from a task created by referencing this template. If no agent ever connects to the task, the flow module runs when the task is terminated."
        }
      }
    },
    "TaskTemplateDefaultFieldValue": {
      "type": "object",
      "properties": {
        "Id": {
          "$ref": "#/$defs/TaskTemplateFieldIdentifier"
        },
        "DefaultValue": {
          "type": "string",
          "description": "Default value for the field."
        }
      }
    },
    "TaskTemplateDefaults": {
      "type": "object",
      "properties": {
        "DefaultFieldValues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TaskTemplateDefaultFieldValue"
          },
          "description": "Default value for the field."
        }
      }
    },
    "TaskTemplateField": {
      "type": "object",
      "properties": {
        "Id": {
          "$ref": "#/$defs/TaskTemplateFieldIdentifier"
        },
        "Description": {
          "type": "string",
          "description": "The description of the field."
        },
        "Type": {
          "type": "string",
          "enum": [
            "NAME",
            "DESCRIPTION",
            "SCHEDULED_TIME",
            "QUICK_CONNECT",
            "URL",
            "NUMBER",
            "TEXT",
            "TEXT_AREA",
            "DATE_TIME",
            "BOOLEAN",
            "SINGLE_SELECT",
            "EMAIL",
            "SELF_ASSIGN",
            "EXPIRY_DURATION"
          ],
          "description": "Indicates the type of field."
        },
        "SingleSelectOptions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of options for a single select field."
        }
      },
      "required": [
        "Id"
      ]
    },
    "TaskTemplateFieldIdentifier": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the task template field."
        }
      }
    }
  }
}