

# PutEvents
<a name="API_UBS_PutEvents"></a>

Records item interaction event data. For more information see [Recording item interaction events](https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html).

**Note**  
 If you use an AWS Lambda function to call the PutEvents operation, your function's execution role must have permission to perform the `personalize:PutEvents` action with the wildcard `*` in the `Resource` element. 

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

```
POST /events HTTP/1.1
Content-type: application/json

{
   "eventList": [ 
      { 
         "eventId": "string",
         "eventType": "string",
         "eventValue": number,
         "impression": [ "string" ],
         "itemId": "string",
         "metricAttribution": { 
            "eventAttributionSource": "string"
         },
         "properties": "string",
         "recommendationId": "string",
         "sentAt": number
      }
   ],
   "sessionId": "string",
   "trackingId": "string",
   "userId": "string"
}
```

## URI Request Parameters
<a name="API_UBS_PutEvents_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_UBS_PutEvents_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [eventList](#API_UBS_PutEvents_RequestSyntax) **   <a name="personalize-UBS_PutEvents-request-eventList"></a>
A list of event data from the session.  
Type: Array of [Event](API_UBS_Event.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Required: Yes

 ** [sessionId](#API_UBS_PutEvents_RequestSyntax) **   <a name="personalize-UBS_PutEvents-request-sessionId"></a>
The session ID associated with the user's visit. Your application generates the sessionId when a user first visits your website or uses your application. Amazon Personalize uses the sessionId to associate events with the user before they log in. For more information, see [Recording item interaction events](https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

 ** [trackingId](#API_UBS_PutEvents_RequestSyntax) **   <a name="personalize-UBS_PutEvents-request-trackingId"></a>
The tracking ID for the event. The ID is generated by a call to the [CreateEventTracker](https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html) API.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

 ** [userId](#API_UBS_PutEvents_RequestSyntax) **   <a name="personalize-UBS_PutEvents-request-userId"></a>
The user associated with the event.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

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

```
HTTP/1.1 200
```

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

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

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

 ** InvalidInputException **   
Provide a valid value for the field or parameter.  
HTTP Status Code: 400

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