Skip to content

update_contact

update_contact(
    instance_id: InstanceId,
    contact_id: ContactId,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    name: Optional[Name] = None,
    description: Optional[Description] = None,
    references: Optional[ContactReferences] = None,
    segment_attributes: Optional[SegmentAttributes] = None,
    queue_info: Optional[QueueInfoInput] = None,
    user_info: Optional[UserInfo] = None,
    customer_endpoint: Optional[Endpoint] = None,
    system_endpoint: Optional[Endpoint] = None,
) -> UpdateContactResponse

This API is in preview release for Connect Customer and is subject to change.

Adds or updates user-defined contact information associated with the specified contact. At least one field to be updated must be present in the request.

You can add or update user-defined contact information for both ongoing and completed contacts.

Parameters:

  • instance_id (InstanceId) –

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

  • contact_id (ContactId) –

    The identifier of the contact. This is the identifier of the contact associated with the first interaction with your contact center.

  • name (Optional[Name], default: None ) –

    The name of the contact.

  • description (Optional[Description], default: None ) –

    The description of the contact.

  • references (Optional[ContactReferences], default: None ) –

    Well-formed data on contact, shown to agents on Contact Control Panel (CCP).

  • segment_attributes (Optional[SegmentAttributes], default: None ) –

    A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Connect Customer attributes. They can be accessed in flows.

    Attribute keys can include only alphanumeric, -, and _.

    This field can be used to show channel subtype, such as connect:Guide.

    Contact Expiry, and user-defined attributes (String - String) that are defined in predefined attributes, can be updated by using the UpdateContact API.

  • queue_info (Optional[QueueInfoInput], default: None ) –

    Information about the queue associated with a contact. This parameter can only be updated for external audio contacts. It is used when you integrate third-party systems with Contact Lens for analytics. For more information, see Connect Customer Contact Lens integration in the Connect Customer Administrator Guide.

  • user_info (Optional[UserInfo], default: None ) –

    Information about the agent associated with a contact. This parameter can only be updated for external audio contacts. It is used when you integrate third-party systems with Contact Lens for analytics. For more information, see Connect Customer Contact Lens integration in the Connect Customer Administrator Guide.

  • customer_endpoint (Optional[Endpoint], default: None ) –

    The endpoint of the customer for which the contact was initiated. For external audio contacts, this is usually the end customer's phone number. This value can only be updated for external audio contacts. For more information, see Connect Customer Contact Lens integration in the Connect Customer Administrator Guide.

  • system_endpoint (Optional[Endpoint], default: None ) –

    External system endpoint for the contact was initiated. For external audio contacts, this is the phone number of the external system such as the contact center. This value can only be updated for external audio contacts. For more information, see Connect Customer Contact Lens integration in the Connect Customer Administrator Guide.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def update_contact(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    name: Optional["capo_connect.types.name.Name"] = None,
    description: Optional["capo_connect.types.description.Description"] = None,
    references: Optional[
        "capo_connect.types.contact_references.ContactReferences"
    ] = None,
    segment_attributes: Optional[
        "capo_connect.types.segment_attributes.SegmentAttributes"
    ] = None,
    queue_info: Optional[
        "capo_connect.types.queue_info_input.QueueInfoInput"
    ] = None,
    user_info: Optional["capo_connect.types.user_info.UserInfo"] = None,
    customer_endpoint: Optional["capo_connect.types.endpoint.Endpoint"] = None,
    system_endpoint: Optional["capo_connect.types.endpoint.Endpoint"] = None,
) -> "capo_connect.types.update_contact_response.UpdateContactResponse":
    """<p>This API is in preview release for Connect Customer and is subject to change.</p> <p>Adds or updates user-defined contact information associated with the specified contact. At least one field to be updated must be present in the request.</p> <important> <p>You can add or update user-defined contact information for both ongoing and completed contacts.</p> </important>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        contact_id: <p>The identifier of the contact. This is the identifier of the contact associated with the first interaction with your contact center.</p>
        name: <p>The name of the contact.</p>
        description: <p>The description of the contact.</p>
        references: <p>Well-formed data on contact, shown to agents on Contact Control Panel (CCP).</p>
        segment_attributes: <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Connect Customer attributes. They can be accessed in flows.</p> <p>Attribute keys can include only alphanumeric, -, and _.</p> <p>This field can be used to show channel subtype, such as <code>connect:Guide</code>.</p> <p>Contact Expiry, and user-defined attributes (String - String) that are defined in predefined attributes, can be updated by using the UpdateContact API.</p>
        queue_info: <p> Information about the queue associated with a contact. This parameter can only be updated for external audio contacts. It is used when you integrate third-party systems with Contact Lens for analytics. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Connect Customer Contact Lens integration</a> in the <i> Connect Customer Administrator Guide</i>.</p>
        user_info: <p>Information about the agent associated with a contact. This parameter can only be updated for external audio contacts. It is used when you integrate third-party systems with Contact Lens for analytics. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Connect Customer Contact Lens integration</a> in the <i> Connect Customer Administrator Guide</i>.</p>
        customer_endpoint: <p>The endpoint of the customer for which the contact was initiated. For external audio contacts, this is usually the end customer's phone number. This value can only be updated for external audio contacts. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Connect Customer Contact Lens integration</a> in the <i>Connect Customer Administrator Guide</i>.</p>
        system_endpoint: <p>External system endpoint for the contact was initiated. For external audio contacts, this is the phone number of the external system such as the contact center. This value can only be updated for external audio contacts. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Connect Customer Contact Lens integration</a> in the <i>Connect Customer Administrator Guide</i>.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.conflict_exception.ConflictException: <p>Operation cannot be performed at this time as there is a conflict with another operation or contact state.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_active_region_exception.InvalidActiveRegionException: <p>This exception occurs when an API request is made to a non-active region in an Amazon Connect instance configured with Amazon Connect Global Resiliency. For example, if the active region is US West (Oregon) and a request is made to US East (N. Virginia), the exception will be returned.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.update_contact_request.UpdateContactRequest]",
    ) -> OperationResponse[
        "capo_connect.types.update_contact_response.UpdateContactResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.update_contact

        output, http_response = (
            capo_connect._operations.amazon_connect_service.update_contact.update_contact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_connect.types.update_contact_request.UpdateContactRequest",
    ) -> dict[str, Any]:
        import capo_connect.types.update_contact_request

        return capo_connect.types.update_contact_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateContact", redact_input=_redact_input),
    )
    input_: capo_connect.types.update_contact_request.UpdateContactRequest = {
        "instance_id": instance_id,
        "contact_id": contact_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if references is not None:
        input_["references"] = references
    if segment_attributes is not None:
        input_["segment_attributes"] = segment_attributes
    if queue_info is not None:
        input_["queue_info"] = queue_info
    if user_info is not None:
        input_["user_info"] = user_info
    if customer_endpoint is not None:
        input_["customer_endpoint"] = customer_endpoint
    if system_endpoint is not None:
        input_["system_endpoint"] = system_endpoint

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output