Skip to content

delete_all_entity_sessions

delete_all_entity_sessions(
    instance_id: InstanceId,
    entity_id: EntityId,
    entity_type: SessionEntityType,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
) -> DeleteAllEntitySessionsResponse

Deletes all active sessions for the specified entity in the specified Connect Customer instance. The operation supports only the USER entity type, so you can use it to sign out all of a user's active sessions. Use it when you need to end a user's access right away, for example when they leave your organization or you suspect that their credentials are compromised.

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.

  • entity_id (EntityId) –

    The identifier of the entity whose sessions you want to delete. For USER, use the user ID or the user ARN.

  • entity_type (SessionEntityType) –

    The type of entity whose sessions you want to delete.

    The only valid value is USER, which signs out a user in your Connect Customer instance.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def delete_all_entity_sessions(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    entity_id: "capo_connect.types.entity_id.EntityId",
    entity_type: "capo_connect.types.session_entity_type.SessionEntityType",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
) -> "capo_connect.types.delete_all_entity_sessions_response.DeleteAllEntitySessionsResponse":
    """<p>Deletes all active sessions for the specified entity in the specified Connect Customer instance. The operation supports only the <code>USER</code> entity type, so you can use it to sign out all of a user's active sessions. Use it when you need to end a user's access right away, for example when they leave your organization or you suspect that their credentials are compromised.</p>

    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>
        entity_id: <p>The identifier of the entity whose sessions you want to delete. For <code>USER</code>, use the user ID or the user ARN.</p>
        entity_type: <p>The type of entity whose sessions you want to delete.</p> <note> <p>The only valid value is <code>USER</code>, which signs out a user in your Connect Customer instance.</p> </note>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</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_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.delete_all_entity_sessions_request.DeleteAllEntitySessionsRequest]",
    ) -> OperationResponse[
        "capo_connect.types.delete_all_entity_sessions_response.DeleteAllEntitySessionsResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.delete_all_entity_sessions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAllEntitySessions")
    )
    input_: capo_connect.types.delete_all_entity_sessions_request.DeleteAllEntitySessionsRequest = {
        "instance_id": instance_id,
        "entity_id": entity_id,
        "entity_type": entity_type,
    }

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