

# SetEndpointAttributes
<a name="API_SetEndpointAttributes"></a>

Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS. For more information, see [Using Amazon SNS Mobile Push Notifications](https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 

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

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

 **Attributes** Attributes.entry.N.key (key)Attributes.entry.N.value (value)  
A map of the endpoint attributes. Attributes in this map include the following:  
+  `CustomUserData` – arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
+  `Enabled` – flag that enables/disables delivery to the endpoint. Amazon SNS will set this to false when a notification service indicates to Amazon SNS that the endpoint is invalid. Users can set it back to true, typically after updating Token.
+  `Token` – device token, also referred to as a registration id, for an app and mobile device. This is returned from the notification service when an app and mobile device are registered with the notification service.
Type: String to string map  
Required: Yes

 ** EndpointArn **   
EndpointArn used for `SetEndpointAttributes` action.  
Type: String  
Required: Yes

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

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

 ** AuthorizationError **   
Indicates that the user has been denied access to the requested resource.  
HTTP Status Code: 403

 ** InternalError **   
Indicates an internal service error.  
HTTP Status Code: 500

 ** InvalidParameter **   
Indicates that a request parameter does not comply with the associated constraints.  
HTTP Status Code: 400

 ** NotFound **   
Indicates that the requested resource does not exist.  
HTTP Status Code: 404

## Examples
<a name="API_SetEndpointAttributes_Examples"></a>

The structure of `AUTHPARAMS` depends on the signature of the API request. For more information, see [Examples of the complete Signature Version 4 signing process (Python)](https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html) in the * AWS General Reference*.

### Example
<a name="API_SetEndpointAttributes_Example_1"></a>

This example illustrates one usage of SetEndpointAttributes.

#### Sample Request
<a name="API_SetEndpointAttributes_Example_1_Request"></a>

```
https://sns.us-west-2.amazonaws.com/?Action=SetEndpointAttributes
&EndpointArn=arn%3Aaws%3Asns%3Aus-west-2%3A123456789012%3Aendpoint%2FGCM%2Fgcmpushapp%2F5e3e9847-3183-3f18-a7e8-671c3a57d4b3
&Attributes.entry.1.key=CustomUserData
&Attributes.entry.1.value=My+custom+userdata
&Version=2010-03-31
&AUTHPARAMS
```

#### Sample Response
<a name="API_SetEndpointAttributes_Example_1_Response"></a>

```
<SetEndpointAttributesResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
    <ResponseMetadata>
        <RequestId>2fe0bfc7-3e85-5ee5-a9e2-f58b35e85f6a</RequestId>
    </ResponseMetadata>
</SetEndpointAttributesResponse>
```

## See Also
<a name="API_SetEndpointAttributes_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/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/sns-2010-03-31/SetEndpointAttributes) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/sns-2010-03-31/SetEndpointAttributes) 