Amazon Pinpoint
REST API Reference

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 the 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.

Path Parameters

Name Type Required Description
application-id String True

The unique identifier for the application.

Header Parameters

Name Type Required Description
accept String False

Indicates which content types, expressed as MIME types, the client understands.

Responses

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).

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.

Responses

Status Code Response Model Description
200 None

The request succeeded.

Schemas

Request Bodies

Example POST

{ "BatchItem": { } }

Response Bodies

Example EventsResponse

{ "Results": { } }

Example MessageBody

{ "RequestID": "string", "Message": "string" }

Properties

EndpointDemographic

Provides demographic information about an endpoint, such as the applicable time zone and platform.

Property Type Required Description
Make

string

False

The manufacturer of the endpoint device, such as Apple or Samsung.

Model

string

False

The model name or number of the endpoint device, such as iPhone.

ModelVersion

string

False

The model version of the endpoint device.

Timezone

string

False

The time zone of the endpoint, specified as a tz database name value, such as America/Los_Angeles.

Locale

string

False

The locale of the endpoint, in the following format: the ISO 639-1 alpha-2 code, followed by an underscore (_), followed by an ISO 3166-1 alpha-2 value.

AppVersion

string

False

The version of the app that's associated with the endpoint.

Platform

string

False

The platform of the endpoint device, such as iOS or Android.

PlatformVersion

string

False

The platform version of the endpoint device.

EndpointItemResponse

Property Type Required Description
StatusCode

integer

False

The status code that's returned in the response as a result of merging the endpoint.

Message

string

False

The custom message that's returned in the response as a result of registering the endpoint.

EndpointLocation

Provides geographic information about an endpoint.

Property Type Required Description
Latitude

number

False

The latitude coordinate of the endpoint location, rounded to one decimal place.

Longitude

number

False

The longitude coordinate of the endpoint location, rounded to one decimal place.

PostalCode

string

False

The postal or ZIP code for the area where the endpoint is located.

City

string

False

The name of the city where the endpoint is located.

Region

string

False

The name of the region where the endpoint is located. For locations in the United States, this value is the name of a state.

Country

string

False

The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the endpoint is located. For example, US for the United States.

EndpointUser

Provides data for one or more custom, user-specific attributes.

Property Type Required Description
UserId

string

False

The unique identifier for the user.

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 Interests might be: ["science", "music", "travel"]. You can use these attributes as filter criteria when you create segments.

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 limitation doesn't apply to attribute values.

Event

Property Type Required Description
EventType

string

True

The name of the event to record.

Attributes

object

False

One or more custom attributes that are associated with the event.

Metrics

object

False

One or more custom metrics that are associated with the event.

Timestamp

string

True

The date and time, in ISO 8601 format, when the event occurred.

ClientSdkVersion

string

False

The version of the SDK that's running on the client device.

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.

SdkName

string

False

The name of the SDK that's being used to record the event.

Session

Session

False

Information about the session in which the event occurred.

EventItemResponse

Property Type Required Description
StatusCode

integer

False

The status code that's returned in the response as a result of processing the event. Possible values are: 202, for events that were accepted; and, 400, for events that weren't valid.

Message

string

False

A custom message that's returned in the response as a result of processing the event.

EventsBatch

Property Type Required Description
Endpoint

PublicEndpoint

True

A set of properties that are associated with the endpoint.

Events

object

True

The set of events that are associated with the endpoint.

EventsRequest

Property Type Required Description
BatchItem

object

True

The batch of events to process. For each item in a batch, an endpoint ID acts as a key that has an EventsBatch object as its value.

EventsResponse

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: 202, the request was processed successfully; or 400, the payload wasn't valid or required fields were missing.

ItemResponse

Property Type Required Description
EndpointItemResponse

EndpointItemResponse

False

The response that was received after the endpoint was accepted.

EventsItemResponse

object

False

A multipart response object that contains a key and a value for each event ID in the request. In each object, the event ID is the key and an EventItemResponse object is the value.

MessageBody

Provides information about an API request or response.

Property Type Required Description
RequestID

string

False

The unique identifier for the request or response.

Message

string

False

The message that's returned from the API.

PublicEndpoint

Property Type Required Description
ChannelType

string

Values: GCM | APNS | APNS_SANDBOX | APNS_VOIP | APNS_VOIP_SANDBOX | ADM | SMS | VOICE | EMAIL | BAIDU | CUSTOM

False

The channel that's used when sending messages or push notifications to the endpoint.

Address

string

False

The unique identifier for the recipient, such as a device token, email address, or mobile phone number.

EndpointStatus

string

False

The status of the update request for the endpoint. Possible values are: INACTIVE, the update failed; and, ACTIVE, the endpoint was updated successfully.

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: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.

RequestId

string

False

A unique identifier that's generated each time the endpoint is updated.

Location

EndpointLocation

False

The geographic information for the endpoint.

Demographic

EndpointDemographic

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.

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.

Metrics

object

False

One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.

User

EndpointUser

False

One or more custom user attributes that your app reports to Amazon Pinpoint for the user who's associated with the endpoint.

Session

Property Type Required Description
Id

string

True

The unique identifier for the session.

Duration

integer

False

The duration of the session, in milliseconds.

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:

PutEvents