UpdateTaskTemplateCommand

Updates details about a specific task template in the specified Amazon Connect instance. This operation does not support partial updates. Instead it does a full update of template content.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ConnectClient, UpdateTaskTemplateCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, UpdateTaskTemplateCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // UpdateTaskTemplateRequest
  TaskTemplateId: "STRING_VALUE", // required
  InstanceId: "STRING_VALUE", // required
  Name: "STRING_VALUE",
  Description: "STRING_VALUE",
  ContactFlowId: "STRING_VALUE",
  SelfAssignFlowId: "STRING_VALUE",
  Constraints: { // TaskTemplateConstraints
    RequiredFields: [ // RequiredTaskTemplateFields
      { // RequiredFieldInfo
        Id: { // TaskTemplateFieldIdentifier
          Name: "STRING_VALUE",
        },
      },
    ],
    ReadOnlyFields: [ // ReadOnlyTaskTemplateFields
      { // ReadOnlyFieldInfo
        Id: {
          Name: "STRING_VALUE",
        },
      },
    ],
    InvisibleFields: [ // InvisibleTaskTemplateFields
      { // InvisibleFieldInfo
        Id: {
          Name: "STRING_VALUE",
        },
      },
    ],
  },
  Defaults: { // TaskTemplateDefaults
    DefaultFieldValues: [ // TaskTemplateDefaultFieldValueList
      { // TaskTemplateDefaultFieldValue
        Id: {
          Name: "STRING_VALUE",
        },
        DefaultValue: "STRING_VALUE",
      },
    ],
  },
  Status: "ACTIVE" || "INACTIVE",
  Fields: [ // TaskTemplateFields
    { // TaskTemplateField
      Id: {
        Name: "STRING_VALUE",
      },
      Description: "STRING_VALUE",
      Type: "NAME" || "DESCRIPTION" || "SCHEDULED_TIME" || "QUICK_CONNECT" || "URL" || "NUMBER" || "TEXT" || "TEXT_AREA" || "DATE_TIME" || "BOOLEAN" || "SINGLE_SELECT" || "EMAIL" || "SELF_ASSIGN" || "EXPIRY_DURATION",
      SingleSelectOptions: [ // SingleSelectOptions
        "STRING_VALUE",
      ],
    },
  ],
};
const command = new UpdateTaskTemplateCommand(input);
const response = await client.send(command);
// { // UpdateTaskTemplateResponse
//   InstanceId: "STRING_VALUE",
//   Id: "STRING_VALUE",
//   Arn: "STRING_VALUE",
//   Name: "STRING_VALUE",
//   Description: "STRING_VALUE",
//   ContactFlowId: "STRING_VALUE",
//   SelfAssignFlowId: "STRING_VALUE",
//   Constraints: { // TaskTemplateConstraints
//     RequiredFields: [ // RequiredTaskTemplateFields
//       { // RequiredFieldInfo
//         Id: { // TaskTemplateFieldIdentifier
//           Name: "STRING_VALUE",
//         },
//       },
//     ],
//     ReadOnlyFields: [ // ReadOnlyTaskTemplateFields
//       { // ReadOnlyFieldInfo
//         Id: {
//           Name: "STRING_VALUE",
//         },
//       },
//     ],
//     InvisibleFields: [ // InvisibleTaskTemplateFields
//       { // InvisibleFieldInfo
//         Id: {
//           Name: "STRING_VALUE",
//         },
//       },
//     ],
//   },
//   Defaults: { // TaskTemplateDefaults
//     DefaultFieldValues: [ // TaskTemplateDefaultFieldValueList
//       { // TaskTemplateDefaultFieldValue
//         Id: {
//           Name: "STRING_VALUE",
//         },
//         DefaultValue: "STRING_VALUE",
//       },
//     ],
//   },
//   Fields: [ // TaskTemplateFields
//     { // TaskTemplateField
//       Id: {
//         Name: "STRING_VALUE",
//       },
//       Description: "STRING_VALUE",
//       Type: "NAME" || "DESCRIPTION" || "SCHEDULED_TIME" || "QUICK_CONNECT" || "URL" || "NUMBER" || "TEXT" || "TEXT_AREA" || "DATE_TIME" || "BOOLEAN" || "SINGLE_SELECT" || "EMAIL" || "SELF_ASSIGN" || "EXPIRY_DURATION",
//       SingleSelectOptions: [ // SingleSelectOptions
//         "STRING_VALUE",
//       ],
//     },
//   ],
//   Status: "ACTIVE" || "INACTIVE",
//   LastModifiedTime: new Date("TIMESTAMP"),
//   CreatedTime: new Date("TIMESTAMP"),
// };

UpdateTaskTemplateCommand Input

See UpdateTaskTemplateCommandInput for more details

Parameter
Type
Description
InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

TaskTemplateId
Required
string | undefined

A unique identifier for the task template.

Constraints
TaskTemplateConstraints | undefined

Constraints that are applicable to the fields listed.

ContactFlowId
string | undefined

The identifier of the flow that runs by default when a task is created by referencing this template.

Defaults
TaskTemplateDefaults | undefined

The default values for fields when a task is created by referencing this template.

Description
string | undefined

The description of the task template.

Fields
TaskTemplateField[] | undefined

Fields that are part of the template.

Name
string | undefined

The name of the task template.

SelfAssignFlowId
string | undefined

The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task.

Status
TaskTemplateStatus | undefined

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.

UpdateTaskTemplateCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

The Amazon Resource Name (ARN) for the task template resource.

Constraints
TaskTemplateConstraints | undefined

Constraints that are applicable to the fields listed.

ContactFlowId
string | undefined

The identifier of the flow that runs by default when a task is created by referencing this template.

CreatedTime
Date | undefined

The timestamp when the task template was created.

Defaults
TaskTemplateDefaults | undefined

The default values for fields when a task is created by referencing this template.

Description
string | undefined

The description of the task template.

Fields
TaskTemplateField[] | undefined

Fields that are part of the template.

Id
string | undefined

The identifier of the task template resource.

InstanceId
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

LastModifiedTime
Date | undefined

The timestamp when the task template was last modified.

Name
string | undefined

The name of the task template.

SelfAssignFlowId
string | undefined

The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task.

Status
TaskTemplateStatus | undefined

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.

Throws

Name
Fault
Details
InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

PropertyValidationException
client

The property is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ServiceQuotaExceededException
client

The service quota has been exceeded.

ThrottlingException
client

The throttling limit has been exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.