

# SetPrincipalTagAttributeMap
<a name="API_SetPrincipalTagAttributeMap"></a>

You can use this operation to use default (username and clientID) attribute or custom attribute mappings.

## Request Syntax
<a name="API_SetPrincipalTagAttributeMap_RequestSyntax"></a>

```
{
   "IdentityPoolId": "string",
   "IdentityProviderName": "string",
   "PrincipalTags": { 
      "string" : "string" 
   },
   "UseDefaults": boolean
}
```

## Request Parameters
<a name="API_SetPrincipalTagAttributeMap_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [IdentityPoolId](#API_SetPrincipalTagAttributeMap_RequestSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-request-IdentityPoolId"></a>
The ID of the Identity Pool you want to set attribute mappings for.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 55.  
Pattern: `[\w-]+:[0-9a-f-]+`   
Required: Yes

 ** [IdentityProviderName](#API_SetPrincipalTagAttributeMap_RequestSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-request-IdentityProviderName"></a>
The provider name you want to use for attribute mappings.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Required: Yes

 ** [PrincipalTags](#API_SetPrincipalTagAttributeMap_RequestSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-request-PrincipalTags"></a>
You can use this operation to add principal tags.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Value Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** [UseDefaults](#API_SetPrincipalTagAttributeMap_RequestSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-request-UseDefaults"></a>
You can use this operation to use default (username and clientID) attribute mappings.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_SetPrincipalTagAttributeMap_ResponseSyntax"></a>

```
{
   "IdentityPoolId": "string",
   "IdentityProviderName": "string",
   "PrincipalTags": { 
      "string" : "string" 
   },
   "UseDefaults": boolean
}
```

## Response Elements
<a name="API_SetPrincipalTagAttributeMap_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [IdentityPoolId](#API_SetPrincipalTagAttributeMap_ResponseSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-response-IdentityPoolId"></a>
The ID of the Identity Pool you want to set attribute mappings for.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 55.  
Pattern: `[\w-]+:[0-9a-f-]+` 

 ** [IdentityProviderName](#API_SetPrincipalTagAttributeMap_ResponseSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-response-IdentityProviderName"></a>
The provider name you want to use for attribute mappings.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.

 ** [PrincipalTags](#API_SetPrincipalTagAttributeMap_ResponseSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-response-PrincipalTags"></a>
You can use this operation to add principal tags. The `PrincipalTags`operation enables you to reference user attributes in your IAM permissions policy.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Value Length Constraints: Minimum length of 1. Maximum length of 256.

 ** [UseDefaults](#API_SetPrincipalTagAttributeMap_ResponseSyntax) **   <a name="CognitoIdentity-SetPrincipalTagAttributeMap-response-UseDefaults"></a>
You can use this operation to select default (username and clientID) attribute mappings.  
Type: Boolean

## Errors
<a name="API_SetPrincipalTagAttributeMap_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalErrorException **   
Thrown when the service encounters an error during processing the request.    
 ** message **   
The message returned by an InternalErrorException.
HTTP Status Code: 500

 ** InvalidParameterException **   
Thrown for missing or bad input parameter(s).    
 ** message **   
The message returned by an InvalidParameterException.
HTTP Status Code: 400

 ** NotAuthorizedException **   
Thrown when a user is not authorized to access the requested resource.    
 ** message **   
The message returned by a NotAuthorizedException
HTTP Status Code: 400

 ** ResourceNotFoundException **   
Thrown when the requested resource (for example, a dataset or record) does not exist.    
 ** message **   
The message returned by a ResourceNotFoundException.
HTTP Status Code: 400

 ** TooManyRequestsException **   
Thrown when a request is throttled.    
 ** message **   
Message returned by a TooManyRequestsException
HTTP Status Code: 400

## See Also
<a name="API_SetPrincipalTagAttributeMap_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/cognito-identity-2014-06-30/SetPrincipalTagAttributeMap) 