CognitoIdentityProvider / Client / admin_get_device



Gets the device, as an administrator.


Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

See also: AWS API Documentation

Request Syntax

response = client.admin_get_device(
  • DeviceKey (string) –


    The device key.

  • UserPoolId (string) –


    The user pool ID.

  • Username (string) –


    The username of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.

Return type:



Response Syntax

    'Device': {
        'DeviceKey': 'string',
        'DeviceAttributes': [
                'Name': 'string',
                'Value': 'string'
        'DeviceCreateDate': datetime(2015, 1, 1),
        'DeviceLastModifiedDate': datetime(2015, 1, 1),
        'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)

Response Structure

  • (dict) –

    Gets the device response, as an administrator.

    • Device (dict) –

      The device.

      • DeviceKey (string) –

        The device key.

      • DeviceAttributes (list) –

        The device attributes.

        • (dict) –

          Specifies whether the attribute is standard or custom.

          • Name (string) –

            The name of the attribute.

          • Value (string) –

            The value of the attribute.

      • DeviceCreateDate (datetime) –

        The creation date of the device.

      • DeviceLastModifiedDate (datetime) –

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • DeviceLastAuthenticatedDate (datetime) –

        The date when the device was last authenticated.


  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfigurationException

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException