Connect / Client / create_user

create_user#

Connect.Client.create_user(**kwargs)#

Creates a user account for the specified Amazon Connect instance.

Warning

Certain UserIdentityInfo parameters are required in some situations. For example, Email is required if you are using SAML for identity management. FirstName and LastName are required if you are using Amazon Connect or SAML for identity management.

For information about how to create users using the Amazon Connect admin website, see Add Users in the Amazon Connect Administrator Guide.

See also: AWS API Documentation

Request Syntax

response = client.create_user(
    Username='string',
    Password='string',
    IdentityInfo={
        'FirstName': 'string',
        'LastName': 'string',
        'Email': 'string',
        'SecondaryEmail': 'string',
        'Mobile': 'string'
    },
    PhoneConfig={
        'PhoneType': 'SOFT_PHONE'|'DESK_PHONE',
        'AutoAccept': True|False,
        'AfterContactWorkTimeLimit': 123,
        'DeskPhoneNumber': 'string'
    },
    DirectoryUserId='string',
    SecurityProfileIds=[
        'string',
    ],
    RoutingProfileId='string',
    HierarchyGroupId='string',
    InstanceId='string',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • Username (string) –

    [REQUIRED]

    The user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from [a-zA-Z0-9_-.@]+.

    Username can include @ only if used in an email format. For example:

  • Password (string) – The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.

  • IdentityInfo (dict) –

    The information about the identity of the user.

    • FirstName (string) –

      The first name. This is required if you are using Amazon Connect or SAML for identity management.

    • LastName (string) –

      The last name. This is required if you are using Amazon Connect or SAML for identity management.

    • Email (string) –

      The email address. If you are using SAML for identity management and include this parameter, an error is returned.

    • SecondaryEmail (string) –

      The user’s secondary email address. If you provide a secondary email, the user receives email notifications - other than password reset notifications - to this email address instead of to their primary email address.

      Pattern: (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}

    • Mobile (string) –

      The user’s mobile number.

  • PhoneConfig (dict) –

    [REQUIRED]

    The phone settings for the user.

    • PhoneType (string) – [REQUIRED]

      The phone type.

    • AutoAccept (boolean) –

      The Auto accept setting.

    • AfterContactWorkTimeLimit (integer) –

      The After Call Work (ACW) timeout setting, in seconds. This parameter has a minimum value of 0 and a maximum value of 2,000,000 seconds (24 days). Enter 0 if you don’t want to allocate a specific amount of ACW time. It essentially means an indefinite amount of time. When the conversation ends, ACW starts; the agent must choose Close contact to end ACW.

      Note

      When returned by a SearchUsers call, AfterContactWorkTimeLimit is returned in milliseconds.

    • DeskPhoneNumber (string) –

      The phone number for the user’s desk phone.

  • DirectoryUserId (string) –

    The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.

    This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.

  • SecurityProfileIds (list) –

    [REQUIRED]

    The identifier of the security profile for the user.

    • (string) –

  • RoutingProfileId (string) –

    [REQUIRED]

    The identifier of the routing profile for the user.

  • HierarchyGroupId (string) – The identifier of the hierarchy group for the user.

  • InstanceId (string) –

    [REQUIRED]

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

  • Tags (dict) –

    The tags used to organize, track, or control access for this resource. For example, { “Tags”: {“key1”:”value1”, “key2”:”value2”} }.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'UserId': 'string',
    'UserArn': 'string'
}

Response Structure

  • (dict) –

    • UserId (string) –

      The identifier of the user account.

    • UserArn (string) –

      The Amazon Resource Name (ARN) of the user account.

Exceptions

  • Connect.Client.exceptions.InvalidRequestException

  • Connect.Client.exceptions.InvalidParameterException

  • Connect.Client.exceptions.LimitExceededException

  • Connect.Client.exceptions.DuplicateResourceException

  • Connect.Client.exceptions.ResourceNotFoundException

  • Connect.Client.exceptions.ThrottlingException

  • Connect.Client.exceptions.InternalServiceException