Events
In Amazon Pinpoint, you can create events to record and track how users interact with your app. For example, you can log interactions such as account creations, sign-in attempts, and purchases as events.
You can use the Events resource to record events for endpoints. This includes creating events and creating or updating data for endpoints that are associated with events.
URI
/v1/apps/
application-id
/events
HTTP methods
POST
Operation ID: PutEvents
Creates a new event to record for endpoints, or creates or updates endpoint data that existing events are associated with.
Name | Type | Required | Description |
---|---|---|---|
application-id | String | True | The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console. |
Name | Type | Required | Description |
---|---|---|---|
accept | String | False | Indicates which content types, expressed as MIME types, the client understands. |
Status code | Response model | Description |
---|---|---|
202 | EventsResponse | The request was accepted for processing. Processing may not be complete. |
400 | MessageBody | The request contains a syntax error (BadRequestException). |
403 | MessageBody | The request was denied because access to the specified resource is forbidden (ForbiddenException). |
404 | MessageBody | The request failed because the specified resource was not found (NotFoundException). |
405 | MessageBody | The request failed because the method is not allowed for the specified resource (MethodNotAllowedException). |
413 | MessageBody | The request failed because the payload for the body of the request is too large (RequestEntityTooLargeException). |
429 | MessageBody | The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException). |
500 | MessageBody | The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException). |
OPTIONS
Retrieves information about the communication requirements and options that are available for the Events resource.
Name | Type | Required | Description |
---|---|---|---|
application-id | String | True | The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console. |
Status code | Response model | Description |
---|---|---|
200 | None | The request succeeded. |
Schemas
Request bodies
{ "BatchItem": { } }
Response bodies
{ "Results": { } }
Properties
EndpointDemographic
Specifies demographic information about an endpoint, such as the applicable time zone and platform.
Property | Type | Required | Description |
---|---|---|---|
AppVersion | string | False | The version of the app that's associated with the endpoint. Can contain a maximum of 50 characters. |
Locale | string | False | An identifier that represents the endpoint's language, in IETF BCP 47 format.
This identifier typically consists of an ISO 639-1 alpha-2 code, followed by an
underscore (_), followed by an ISO 3166-1 alpha-2 value. For example, the locale
code for United States English is In some cases, an ISO 3166-1 numeric-3 value is used instead of an ISO 3166-1
alpha-2 value. For example, the locale code for Latin American Spanish is
In other cases, the ISO 639-1 alpha-2 is replaced with a three-letter code.
For example, the locale code for Hawaiian is |
Make | string | False | The manufacturer of the endpoint device, such as |
Model | string | False | The model name or number of the endpoint device, such as |
ModelVersion | string | False | The model version of the endpoint device. Can contain a maximum of 50 characters. |
Platform | string | False | The platform of the endpoint device, such as |
PlatformVersion | string | False | The version of the platform for the endpoint device. Can contain a maximum of 50 characters. |
Timezone | string | False | The time zone of the endpoint, specified as a tz database name value, such as
|
EndpointItemResponse
Provides the status code and message that result from processing data for an endpoint.
Property | Type | Required | Description |
---|---|---|---|
Message | string | False | The custom message that's returned in the response as a result of processing the endpoint data. |
StatusCode | integer | False | The status code that's returned in the response as a result of processing the endpoint data. |
EndpointLocation
Specifies geographic information about an endpoint.
Property | Type | Required | Description |
---|---|---|---|
City | string | False | The name of the city where the endpoint is located. Can contain a maximum of 75 characters. |
Country | string | False | A code that represents the country or region where the endpoint is located.
Must be in ISO 3166-1 Alpha-2 or Alpha-3 format. For example, for the United
States, you can use |
Latitude | number | False | The latitude coordinate of the endpoint location, rounded to one decimal place. Must be between -90 and 90. If you specify a latitude, you must also specify a longitude. |
Longitude | number | False | The longitude coordinate of the endpoint location, rounded to one decimal place. Must be between -180 and 180. If you specify a longitude, you must also specify a latitude. |
PostalCode | string | False | The postal or ZIP code for the area where the endpoint is located. |
Region | string | False | The name of the region where the endpoint is located. This value is typically a first-level subdivision a country, such as a state, province, prefecture, administrative region, district, or department. Can contain a maximum of 75 characters. |
EndpointUser
Specifies data for one or more attributes that describe the user who's associated with an endpoint.
Property | Type | Required | Description |
---|---|---|---|
UserAttributes | object | False | One or more custom attributes that describe the user by associating a name
with an array of values. For example, the value of an attribute named
An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values. |
UserId | string | False | The unique identifier for the user. The identifier can't contain |
Event
Specifies information about an event that reports data to Amazon Pinpoint.
Property | Type | Required | Description |
---|---|---|---|
AppPackageName | string | False | The package name of the app that's recording the event. |
AppTitle | string | False | The title of the app that's recording the event. |
AppVersionCode | string | False | The version number of the app that's recording the event. |
Attributes | object | False | One or more custom attributes that are associated with the event. |
ClientSdkVersion | string | False | The version of the SDK that's running on the client device. |
EventType | string | True | The name of the event. NoteAvoid using the following characters: # : ? \ /. The Amazon Pinpoint console doesn't correctly display event names that contain these characters. |
Metrics | object | False | One or more custom metrics that are associated with the event. |
SdkName | string | False | The name of the SDK that's being used to record the event. |
Session | False | Information about the session in which the event occurred. | |
Timestamp | string | True | The date and time, in ISO 8601 format, when the event occurred. |
EventItemResponse
Provides the status code and message that result from processing an event.
Property | Type | Required | Description |
---|---|---|---|
Message | string | False | A custom message that's returned in the response as a result of processing the event. |
StatusCode | integer | False | The status code that's returned in the response as a result of processing the
event. Possible values are: |
EventsBatch
Specifies a batch of endpoints and events to process.
Property | Type | Required | Description |
---|---|---|---|
Endpoint | True | A set of properties and attributes that are associated with the endpoint. | |
Events | object | True | A set of properties that are associated with the event. |
EventsRequest
Specifies a batch of events to process.
Property | Type | Required | Description |
---|---|---|---|
BatchItem | object | True | The batch of events to process. For each item in a batch, the endpoint ID acts
as a key that has an |
EventsResponse
Provides information about endpoints and the events that they're associated with.
Property | Type | Required | Description |
---|---|---|---|
Results | object | False | A map that contains a multipart response for each endpoint. For each item in
this object, the endpoint ID is the key and the item response is the value. If
no item response exists, the value can also be one of the following:
|
ItemResponse
Provides information about the results of a request to create or update an endpoint that's associated with an event.
Property | Type | Required | Description |
---|---|---|---|
EndpointItemResponse | False | The response that was received after the endpoint data was accepted. | |
EventsItemResponse | object | False | A multipart response object that contains a key and a value for each event in
the request. In each object, the event ID is the key and an
|
MessageBody
Provides information about an API request or response.
Property | Type | Required | Description |
---|---|---|---|
Message | string | False | The message that's returned from the API. |
RequestID | string | False | The unique identifier for the request or response. |
PublicEndpoint
Specifies the properties and attributes of an endpoint that's associated with an event.
Property | Type | Required | Description |
---|---|---|---|
Address | string | False | The unique identifier for the recipient, such as a device token, email address, or mobile phone number. |
Attributes | object | False | One or more custom attributes that describe the endpoint by associating a name with an array of values. You can use these attributes as filter criteria when you create segments. |
ChannelType | string Values: | False | The channel that's used when sending messages or push notifications to the endpoint. |
Demographic | False | The demographic information for the endpoint, such as the time zone and platform. | |
EffectiveDate | string | False | The date and time, in ISO 8601 format, when the endpoint was last updated. |
EndpointStatus | string | False | Specifies whether to send messages or push notifications to the endpoint.
Valid values are: Amazon Pinpoint automatically sets this value to |
Location | False | The geographic information for the endpoint. | |
Metrics | object | False | One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint. |
OptOut | string | False | Specifies whether the user who's associated with the endpoint has opted out of
receiving messages and push notifications from you. Possible values are:
|
RequestId | string | False | A unique identifier that's generated each time the endpoint is updated. |
User | False | One or more custom user attributes that your app reports to Amazon Pinpoint for the user who's associated with the endpoint. |
Session
Provides information about a session.
Property | Type | Required | Description |
---|---|---|---|
Duration | integer | False | The duration of the session, in milliseconds. Duration is required if a value is provided for the StopTimestamp. |
Id | string | True | The unique identifier for the session. |
StartTimestamp | string | True | The date and time when the session began. |
StopTimestamp | string | False | The date and time when the session ended. |
See also
For more information about using this API in one of the language-specific AWS SDKs and references, see the following: