

**End of support notice:** On October 30, 2026, AWS will end support for Amazon Pinpoint. After October 30, 2026, you will no longer be able to access the Amazon Pinpoint console or Amazon Pinpoint resources (endpoints, segments, campaigns, journeys, and analytics). For more information, see [Amazon Pinpoint end of support](https://docs.aws.amazon.com/console/pinpoint/migration-guide). **Note:** APIs related to SMS, voice, mobile push, OTP, and phone number validate are not impacted by this change and are supported by AWS End User Messaging.

# Amazon Pinpoint segments
<a name="segments"></a>

When you create a campaign, you choose a *segment* to send that campaign to. A segment is a group of your customers that share certain attributes. For example, a segment might contain all of your customers who use version 2.0 of your app on an Android device, or all customers who live in the city of Los Angeles. You can send multiple campaigns to a single segment, and you can send a single campaign to multiple segments.

**Note**  
We recommend you use data from all segments you import, and delete segment data from a project you no longer need. For example, you can [delete endpoints programmatically](https://docs.aws.amazon.com/pinpoint/latest/developerguide/audience-define-remove.html) to remove unutilized segment data. Accumulating segment data within a project may cause delays in subsequent import processes.

There are two types of segments that you can create in Amazon Pinpoint:
+ **Dynamic segments** – Segments that are based on attributes that you define. Dynamic segments can change over time. For example, if you add new endpoints to Amazon Pinpoint, or if you modify or delete existing endpoints, the number of endpoints in that segment may increase or decrease. For more information about dynamic segments, see [Building segments](segments-building.md).
+ **Imported segments** – Segments that are created outside of Amazon Pinpoint and saved in CSV or JSON format. When you create an imported segment, you upload your files to Amazon Simple Storage Service (Amazon S3). Amazon Pinpoint retrieves the files from Amazon S3 and creates new endpoints based on the contents of those files. Imported segments are static—they never change. To make changes, you must reimport the segment with those changes. When you create a new segment, you can use an imported segment as a base segment, and then refine it by adding filters. For more information about importing segments, see [Importing segments](segments-importing.md).

# Building segments
<a name="segments-building"></a>

After you integrate your apps with Amazon Pinpoint, you can create dynamic segments that are based on the data your apps provide to Amazon Pinpoint. When you create a dynamic segment, you choose the type of segment you want to create, create a segment group, and then refine that segment group by choosing the segments and the criteria that define those segments. For example, you could create a dynamic segment group, and then choose an audience segment and criteria of all customers who use version 2.0 of your app on an Android device and who have used your app within the past 30 days. Amazon Pinpoint continuously re-evaluates your segments as your app records new customer interactions. As a result, the size and membership of each segment changes over time. For information about integrating your apps with Amazon Pinpoint, see [Integrating Amazon Pinpoint with your application](https://docs.aws.amazon.com/pinpoint/latest/developerguide/integrate.html) in the *Amazon Pinpoint Developer Guide*.

## Segment groups
<a name="segments-building-groups"></a>

When you create a dynamic segment, you create one or more *segment groups*. A segment group consists of these components:
+ **Base segments** – The segments that define the initial user population. You can specify a single base segment, several base segments, or all of the segments in your Amazon Pinpoint project.
+ **Criteria** – Categories of audience information that you apply on top of the base segments. You can add multiple groups of criteria and then create relationships between those criteria. 
+ **Filters** – Filters reduce the audience number that belong to the segment. You can add as many filters as you want in order to tailor the segment to your needs. 

You have to create at least one segment group, but you can optionally create a second segment group, and then create a relationship between the two groups. 

## Creating a dynamic segment
<a name="segments-building-procedure"></a>

The following steps describe creating and configuring a segment:
+ [Step 1: Build a new segment or import an existing segment](#segment-building-new)
+ [Step 2: Configure segment group 1](#segmentconfigure)
+ [Step 3: Choose the segments to include in the group](#choosesegments)
+ [Step 4: Choose and configure the segment criteria](#choosecriteria)
+ [Step 5: Add a second criteria group](#addsecondcriteria)
+ [Step 6: Add segment group 2](#addsegmentgroup)

### Step 1: Build a new segment or import an existing segment
<a name="segment-building-new"></a>

**To build a segment**

1. Sign in to the AWS Management Console and open the Amazon Pinpoint console at [https://console.aws.amazon.com/pinpoint/](https://console.aws.amazon.com/pinpoint/).

1. On the **All projects** page, choose the project to which you want to add the segment.

1. In the navigation pane, choose **Segments**. The **Segments** page opens and displays segments that you previously defined.

1. Choose **Create a segment**.

1. Under **Create a segment**, choose **Build a segment**.  
![\[The Create a segment page with the Build a segment option selected.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_build.png)

1. For **Segment name**, enter a name for the segment.

### Step 2: Configure segment group 1
<a name="segmentconfigure"></a>

You will first choose how you want to define the audience segments for the segment group.

**To configure segment group 1**
+ Under **Segment group 1**, for **Base segments**, choose one of the following options:
  + **Include any audiences** – If you use more than one segment as a base segment, your new segment contains endpoints that are in at least one of the segments you choose. For example, you might have two dynamic segments, *Older than 18* and *Lives in New York City*. Your target audience when choosing this option is any audience older than 18 *or* who live in New York City. 
  + **Include all audiences** – If you use more than one segment as a base segment, your new segment only contains endpoints common to all of the selected segments. For example, you might have two dynamic segments, *Older than 18* and *Lives in New York City*. Your target audience when choosing this option is all audiences older than 18 *and* who live in New York City.   
![\[The Segment group 1 section showing Include any audiences.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_any_all.png)

### Step 3: Choose the segments to include in the group
<a name="choosesegments"></a>

The next step is to choose which segments you will include in the group. These segments are composed of the audience that you want to target in the segment group.

1. For the dropdown list, select one or more segments to include in the segment group. Each segment that you add displays in the section. 
**Note**  
The segments dropdown list doesn't close when you choose a segment. It remains open, with a check mark by each segment you're including in the group. You can clear the checkbox by any segment that you want to remove. When you're done choosing segments, choose an area outside of the dropdown list to close it.  
![\[The Segment group 1 dropdown list showing available segments.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_any_drop_down_selected.png)

1. As you add or remove segments, the Segment estimate section updates to display the eligible and total endpoints set to receive the campaign. Eligible endpoints are those endpoints determined by the any/and relationship for the segment group, while the total is the sum of all endpoints regardless of the relationship connector.  
![\[The segment estimate showing available endpoints and eligible endpoints.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_estimate.png)

### Step 4: Choose and configure the segment criteria
<a name="choosecriteria"></a>

After you've chosen your segments, you can further refine the target audience by applying attributes, operators, and values to those segments. 

**To choose and configure the segment criteria**

1. For **Attribute**, you can choose from the following types: 
   +  **Standard attributes** – Filter the audience based on one of its default attributes. 
   + **Channel Types** – Filter the audience based on the recipient's endpoint type: EMAIL, SMS, PUSH, or CUSTOM. 
   + **Activity** – Filters the audience on whether they've been Active or Inactive. 
   + **Custom Endpoint Attributes** – Filter the audience based on an endpoint-specific attribute. For example, this might be a list of your customers who have opted out of a distribution list or a list of customers who signed up for a distribution list. 
   + **Customer User Attributes** – Filter the audience based on a user-specific attribute. For example, this might be *LastName* or *FirstName*. 
   + **Metrics** – Filter the audience based on a quantitative evaluation. For example, you might have a metric, *Visits*, that you can choose if you want to target an audience who have visited a specific location *x* number of times.

1. Choose the **Operator** and enter a **Value**. Operators determine the relationship of the attribute to a value that you enter. Values can be no longer than 100 characters and you can have no more than 100 total values between all groups, criteria, and filters. The following describes the available operators. Each attribute has its own set of supported operators. 
**Note**  
The Channel Types attributes don't use operators or values.
   + **After** – Filters the audience after a specific date. 
   + **Before** – Filters the audience before a specific date. 
   + **Between** – Filters the audience based on a date range.
   + **Contains** – Use this to filter the audience based on a substring within a string. For example, if you have a city metric, you could pass the *ew* to return *New York City* or Newcastle. The passed value is case-sensitive, so *ew* returns different results than *EW*. 
   + **During** – Only used for the Activity attribute. Filters the audience by one of the following time frames: **the last day**, **the last 7 days**, **the last 14 days**, or **the last 30 days**. 
   + **Equals** – Used for the Metrics attributes only, this operator filters the results by a numerical value. For example, you might have a metric, *Visits*, that you can use to filter results by only those customers who visited a location *3* times. 
   + **Greater than** – Used for the Metrics attributes only, this operator filters results that are greater than the number passed. For example, you might have a metric, *Visits*, that you can use to filter results by only those customers who visited a location greater than *3* times. 
   + **Greater than or equal** – Used for the Metrics attributes only, this operator filters results that are greater than or equal to the number passed. For example, if you have a metric, *Visits*, you might use this operator to filter results by only those customers who visited a location *3* or more times.
   + **Is** – Use this option to filter by endpoint-specific attributes. When you select this option, you specify how recently the endpoint was active, or how long it's been inactive. After that, you can optionally specify additional attributes associated with that endpoint. 
   + **Is not **– Use this option if you want to filter out results that match the passed value. For example, you might have a *city* customer user endpoint that you can use to filter out results that include a specific city. Use this operator and *New York City* for the value to ignore any results that include this city. 
   + **Less than** – Used for the Metrics attributes only, this operator filters results that are less than the number passed. For example, you might have a metric, *Visits*, that you can use to filter results by only those customers who visited a location less than *3* times. 
   + **Less than or equal** – Used for the Metrics attributes only, this operator filters results that are less than or equal to the number passed. For example, you might have a metric, *Visits*, that you can use to filter results by only those customers who visited a location *3* times or less. 
   + **On** – Use this metric for filtering results. For example, you might have a metric, *OptOut*, that you can use to filter results by only those customers who opted out of a distribution list on *2020/11/09* .
**Note**  
The Amazon Pinpoint console uses a default time of 00:00:00 UTC for all time-based filters. You can filter on dates but times are recorded as the same value. If you enter a date of *2020-12-31*, the console passes the time as *2020-12-31T12:00:00Z*. Therefore, if you have multiple segments that pass the date, 2020-20-12 with different times, the Amazon Pinpoint console records the date and time for any of those segments as *2020-12-31T12:00:00Z*.

1. (Optional) To apply additional attributes to this criteria, choose **Add filter**. To create another group of segment criteria, choose **Add criteria**. To create a second segment group, choose **Add another segment group**. For information about adding a second segment group, see [Step 6: Add segment group 2](#addsegmentgroup).

1. If you're finished setting up this segment, choose **Create segment**.

### Step 5: Add a second criteria group
<a name="addsecondcriteria"></a>

Optionally add criteria groups to further refine your results. You will create a relationship between this group of criteria and the group before it. 

**To add a second criteria group**

1. Choose **Add criteria**. 

1. Create the relationship between this group and the group previous to it by choosing one of the following:
   + **AND** – The segment contains only that audiences who meet the criteria for both criteria groups.
   + **OR** – The segment contains audiences who meet the criteria in either one of the criteria groups.
   + **NOR** – The segment excludes the audiences that fits the criteria from the results.   
![\[Relationship connector used to set the relationship between two groups of criteria.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_and_or_nor.png)

1. (Optional) To add another group of criteria, choose **Add criteria** or, to add a second segment group, choose **Add another segment group**. For more information, see [Step 6: Add segment group 2](#addsegmentgroup).

1. If you're finished setting up the segment group, choose **Create segment**.

### Step 6: Add segment group 2
<a name="addsegmentgroup"></a>

You can optionally create a second segment group and create a relationship with segment group 1. When you create a segment by using the Amazon Pinpoint console, you can have a maximum of two segment groups per segment. If you add a second segment group to your segment, you can choose one of two ways to specify how the two segment groups are connected:
+ **By using AND logic** – If you use AND logic to connect two segment groups, your segment contains all endpoints who meet all of the criteria in both of the segment groups.
+ **By using OR logic** – If you use OR logic to connect two segment groups, your segment contains all endpoints who meet all of the criteria in either one of the segment groups.

**Note**  
If you use an imported segment as the base segment for your first segment group, you can't create a second segment group.

**To configure second segment group**

1. Choose **Add another segment group**.

1.  Create the relationship with the first segment group. If you choose **AND**, the segment contains only those customers who meet the criteria for both segment groups. If you choose **OR**, the segment contains those customers who meet the criteria in either one of the segment groups. Within segment group 2, you have a third option to **Exclude audiences**. Segments that are excluded will not be included in the results. You can only exclude audiences in segment group 2.  
![\[Segment group 2 showing the relationship connector to Exclude audiences.\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_groups_logic.png)

1. Choose the segments that you want to include in segment group 2. See [Step 3: Choose the segments to include in the group](#choosesegments).

1. (Optional) Choose the criteria by which you want to filter your segments. See [Step 4: Choose and configure the segment criteria](#choosecriteria).

1. (Optional) Add additional groups of criteria. See [Step 5: Add a second criteria group](#addsecondcriteria).

1. When you finish setting up the segment, choose **Create segment**.

# Managing segments
<a name="segments-managing"></a>

You can use the Amazon Pinpoint console to create, view, copy, and perform other management tasks for a project's segments. If you open a segment to view its settings, you can also quickly create a campaign that uses the segment. For more information on managing segments, see [Creating segments](https://docs.aws.amazon.com/pinpoint/latest/developerguide/segments.html) in the Amazon Pinpoint Developer Guide.

**To manage a segment**

1. Sign in to the AWS Management Console and open the Amazon Pinpoint console at [https://console.aws.amazon.com/pinpoint/](https://console.aws.amazon.com/pinpoint/).

1. On the **All projects** page, choose the project that contains the segment that you want to manage.

1. In the navigation pane, choose **Segments**.

1. In the list of segments, select the segment that you want to manage.

1.  On the **Actions** menu, choose one of the following options:
   + **View details** – Choose this option to show information about the segment, including the date and time when the segment was created, and the date and time when the segment was last updated.

     When you view the details of a dynamic segment, you also see the approximate number of endpoints that meet the segment criteria, and the segment groups and filters that define the segment. When you view the details of an imported segment, you also see the number of records that were imported for the segment. If you imported the segment from an Amazon S3 location, you also see details about that location and the name of the IAM role that was used to import the segment from that location.
   + **Edit** – Choose this option to change the settings for a dynamic segment.
**Note**  
You can't edit the properties of an imported segment.
   + **Copy to new** – Choose this option to create a new segment that's a copy of the selected segment. You can then modify any settings in the new segment, without changing the original segment.
   + **Export** – Choose this option to export the segment to a file on your computer. For more information, see [Exporting segments](segments-exporting.md).
   + **Delete** – Choose this option to delete the segment permanently. You can't recover a segment after you delete it.
**Important**  
If you delete a segment, any active campaigns that use the segment will fail and stop running. Similarly, any active journeys that use the segment might fail and stop running. If a journey does continue to run, any participants who were part of the segment might be removed from the journey prematurely. Before you delete a segment, it's a good idea to first verify that a segment isn't being used by any active campaigns or journeys. 

# Importing segments
<a name="segments-importing"></a>

With Amazon Pinpoint, you can define a user segment by importing a file that contains information about the users who belong to the segment. Importing segments is useful if you define user segments outside of Amazon Pinpoint but you want to engage your users with Amazon Pinpoint campaigns.

Unlike the dynamic segments that you create with the segment builder in the console, an imported segment is an unchanging set of *endpoints* or *user IDs*: 

**Endpoint**  
A destination that you can send messages to, such as an email address, mobile device identifier, or mobile phone number. An endpoint definition can include attributes that describe the user or device that you send messages to. It can also include a user ID.   
You can define a segment by importing a list of endpoint definitions. Amazon Pinpoint creates the segment, and it updates any endpoints that you previously added to Amazon Pinpoint with the new information.

**User ID**  
An ID that represents an individual user in your audience. This ID must be assigned to one or more endpoints. For example, if a person uses your app on more than one device, your app could assign that person's user ID to the endpoint for each device.  
You can define a segment by importing user IDs only if you've added the endpoints that are associated with the user IDs to Amazon Pinpoint.

An imported segment consists of endpoints, user IDs, or a combination of both. When you use Amazon Pinpoint to send a message to the segment, the potential destinations include:
+ Each endpoint that you list in the imported file.
+ Each endpoint that's associated with each user ID that you list in the imported file.

When you create a new segment, you can use an imported segment as the base segment. You can then apply filters to the base segment to refine it according to your needs.

## Imported segment considerations
<a name="segments-importing-considerations"></a>

Consider the following factors when you create imported segments:
+ When you create a campaign, you must choose a segment. When you choose a dynamic segment, Amazon Pinpoint provides an estimate of the size of that segment. However, when you choose an imported segment, Amazon Pinpoint can't provide an estimate.
+ If you create a campaign that sends messages when certain events happen, you can't use imported segments. Event-based campaigns can only use dynamic segments. For more information about creating dynamic segments, see [Building segments](segments-building.md).

## Segment files
<a name="segments-importing-examples-files"></a>

You define the endpoints or user IDs that belong to your segment in a comma-separated values (CSV) or JSON file. Then, you import the file into Amazon Pinpoint to create the segment.

When you import a segment, remember the following:
+ Amazon Pinpoint can't import compressed files.
+ The files that you import must use UTF-8 character encoding.
+ If you're importing new endpoints, the `Address` and `ChannelType` attributes are required.
+ If you're updating existing endpoints, the `Id` attribute is required for each endpoint that you want to update.
+ Your endpoint definitions can include only certain attributes. For a list, see [Supported attributes](#segments-importing-available-attributes). In addition, an attribute name must be 50 or fewer characters. An attribute value must be 100 or fewer characters.

### Example segment files
<a name="segments-importing-examples"></a>

The example files in this section are based on the following data:


**Example endpoint attribute values**  

| ChannelType | Address | Location.Country | Demographic.Platform | Demographic.Make | User.UserId | 
| --- | --- | --- | --- | --- | --- | 
| SMS | \$116045550182 | CA | Android | LG | example-user-id-1 | 
| APNS | 1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f | US | iOS | Apple | example-user-id-2 | 
| EMAIL | john.stiles@example.com | US | iOS | Apple | example-user-id-2 | 
| GCM | 4d5e6f1a2b3c4d5e6f7g8h9i0j1a2b3c | CN | Android | Google | example-user-id-3 | 
| EMAIL | wang.xiulan@example.com | CN | Android | OnePlus | example-user-id-3 | 

Each row in this table represents an individual endpoint. Note that the user IDs `example-user-id-2` and `example-user-id-3` are assigned to two endpoints each.

**Example File with endpoint definitions**  
You can import endpoints that are defined in a CSV file, as in the following example:  

```
ChannelType,Address,Location.Country,Demographic.Platform,Demographic.Make,User.UserId
SMS,+16045550182,CA,Android,LG,example-user-id-1
APNS,1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f,US,iOS,Apple,example-user-id-2
EMAIL,john.stiles@example.com,US,iOS,Apple,example-user-id-2
GCM,4d5e6f1a2b3c4d5e6f7g8h9i0j1a2b3c,CN,Android,Google,example-user-id-3
EMAIL,wang.xiulan@example.com,CN,Android,OnePlus,example-user-id-3
```
The first line is the header, which contains the endpoint attributes. For a complete list of possible attributes, see [Supported attributes](#segments-importing-available-attributes).  
The subsequent lines define the endpoints by providing values for each attribute in the header.  
To include a comma or double quote in a value, enclose the value in double quotes, as in `"aaa,bbb"`.   
The CSV file can't contain line breaks or tabs. If your file contains data with line breaks or tabs, the data in the file might not be imported, or the import process might fail.
You can import endpoints that are defined in a newline-delimited JSON file. In this format, each line is a complete JSON object that contains an individual endpoint definition, as in the following example:  

```
{"ChannelType":"SMS","Address":"+16045550182","Location":{"Country":"CA"},"Demographic":{"Platform":"Android","Make":"LG"},"User":{"UserId":"example-user-id-1"}}
{"ChannelType":"APNS","Address":"1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f","Location":{"Country":"US"},"Demographic":{"Platform":"iOS","Make":"Apple"},"User":{"UserId":"example-user-id-2"}}
{"ChannelType":"EMAIL","Address":"john.stiles@example.com","Location":{"Country":"US"},"Demographic":{"Platform":"iOS","Make":"Apple"},"User":{"UserId":"example-user-id-2"}}
{"ChannelType":"GCM","Address":"4d5e6f1a2b3c4d5e6f7g8h9i0j1a2b3c","Location":{"Country":"CN"},"Demographic":{"Platform":"Android","Make":"Google"},"User":{"UserId":"example-user-id-3"}}
{"ChannelType":"EMAIL","Address":"wang.xiulan@example.com","Location":{"Country":"CN"},"Demographic":{"Platform":"Android","Make":"OnePlus"},"User":{"UserId":"example-user-id-3"}}
```
For a complete list of possible attributes, see [Supported attributes](#segments-importing-available-attributes).

## Importing a segment
<a name="segments-importing-procedure"></a>

There are two ways to import segments into Amazon Pinpoint: you can upload files directly from your computer, or you can import files that are stored in an Amazon Simple Storage Service (Amazon S3) bucket.

We recommend that you upload files from your computer, especially if you already have the customer data on your computer. However, you can import only 10 files at a time, and you can only upload files that are smaller than 1 gigabyte (GB).

If you need to import more than 10 files at once, or if you need to upload files that are larger than 1 GB, then you should import files from Amazon S3. The Amazon S3 import option is also useful if you already have processes that send customer data files to Amazon S3 for storage.

This section includes procedures for importing segments by using both of these methods.

### Importing a segment by uploading a file from your computer
<a name="segments-importing-procedure-direct-import"></a>

You can create segments by uploading up to 10 files directly from your computer. The files that you upload can be in CSV or JSON format. You can upload files in any combination of formats. For example, you can upload one JSON file and three CSV files.

**To import a segment**

1. Open the Amazon Pinpoint console at [https://console.aws.amazon.com/pinpoint/](https://console.aws.amazon.com/pinpoint/).

1. On the **All projects** page, choose the project that you want to add the segment to.

1. In the navigation pane, choose **Segments**.

1. Choose **Create a segment**.

1. Under **Create a segment**, choose **Import a segment**.

1. Under **Import method**, choose **Upload files from your computer**.

1. Under **Files to import**, select **Choose files**. Select the file or files that you want to import.
**Note**  
You can also drag files from your computer's file explorer and drop them directly on the **Drop files here** area.

1. When you upload files to Amazon Pinpoint, you have to provide a segment name for each file that you import. Under **Segment names**, enter a segment name for each file that you want to import.

   By default, Amazon Pinpoint provides a segment name that is equal to the name of the imported file, but without the file name extension. You can change these default values to any name.  
![\[\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments-import-names.png)
**Note**  
You can use the same name for multiple segments. If you do, Amazon Pinpoint creates a distinct segment for each file, and assigns a unique ID to each file. The creation date is also slightly different for each file that you import. You can use these factors to distinguish between segments that have the same name.

1. When you finish, choose **Create segment**.

### Importing a segment from a file stored in Amazon S3
<a name="segments-importing-procedure-s3-import"></a>

Before you use this procedure to import a segment, you must first create an Amazon S3 bucket and upload your file to that bucket. You can organize the files for different segments into separate folders. When Amazon Pinpoint imports the endpoints or user IDs for a segment, it includes the files within all folders and subfolders that belong to the Amazon S3 location that you specify.

For an introduction to creating buckets and uploading objects, see the [What is Amazon S3?](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) in the Amazon Simple Storage Service User Guide.

Amazon Pinpoint can import only one file format (CSV or JSON) per segment, so the Amazon S3 path that you specify should only contain files of a single type.

**To import a segment**

1. Open the Amazon Pinpoint console at [https://console.aws.amazon.com/pinpoint/](https://console.aws.amazon.com/pinpoint/).

1. On the **All projects** page, choose the project that you want to add the segment to.

1. In the navigation pane, choose **Segments**.

1. Choose **Create a segment**.

1. Under **Create a segment**, choose **Import a segment**.

1. For **Segment name**, enter a name for your segment.

1. For **Amazon S3 URL**, enter the location of the Amazon S3 bucket that contains the file for your segment. The address of the bucket must be in the following format:

   ```
   s3://bucket-name/folder-name
   ```

   Amazon Pinpoint imports the files from the path that you specify, and from any subfolders in that path.

1. For **IAM role**, complete one of the following steps:
   + If you want to have Amazon Pinpoint create a role that allows it to read from an Amazon S3 bucket, choose **Automatically create a role**. Then, for **IAM role**, enter a name for the role that you're creating.
   + If you've already created an IAM role that allows Amazon Pinpoint to read from an Amazon S3 bucket, choose **Choose an existing role**. Then, for **IAM role**, choose a role that contains the appropriate permissions.

   If you want to create the IAM role yourself, see [IAM role for importing endpoints or segments](https://docs.aws.amazon.com/pinpoint/latest/developerguide/permissions-import-segment.html) in the *Amazon Pinpoint Developer Guide*. After you create the role, specify it in the Amazon Pinpoint console.

1. Under **What type of file are you importing**, choose either **JavaScript Object Notation (JSON)** or **Comma-Separated Values (CSV)**, depending on the format the file that you uploaded to Amazon S3.

1. Choose **Create segment**.

## Supported attributes
<a name="segments-importing-available-attributes"></a>

The table in this section lists and describes the attributes that you can specify, in endpoint definitions, that you import into Amazon Pinpoint. If you import segments by using CSV files, the headers in the file should match the names shown in the **Attribute** column.

For JSON files, a period in the attribute name indicates that the name following the period is an object that's nested in a parent object with a name that's equal to the value preceding the period. For example, a JSON file that contains the `Demographic.Make` and `Demographic.Model` attributes has the following structure:

```
{
...
"Demographic": {
  ...
  "Make":"Apple",
  "Model":"iPhone"
  ...
  }
...
}
```

The full JSON structure closely resembles the [example endpoint request](https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-endpoints-endpoint-id.html#apps-application-id-endpoints-endpoint-id-schemas) in the *Amazon Pinpoint API Reference*. However, not all attributes in the Endpoint request schema are supported when you import segments, including `EndpointStatus` and `EffectiveDate`.

For a custom field to have multiple values in CSV, you must replicate the header and keep one value per header. For example:

```
...,User.UserId, User.UserAttributes.new_multi_field,User.UserAttributes.new_multi_field
...,example-user-id-2,test10,test20
```

You can replace attribute names that are shown as `custom_attribute` with any value. For example, if you want to store users' first and last names in attributes named `FirstName` and `LastName`, you can create custom attributes named `User.UserAttributes.FirstName` and `User.UserAttributes.LastName`, respectively. An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. Attribute names are case sensitive.

In JSON, the custom attribute must be formatted at `"Attributes":{"Ride":["Bus"]}`.


| Attribute | Description | 
| --- | --- | 
| Time zone | Remapped time zone | 
| --- | --- | 
| Address | The unique destination address for messages or push notifications that you send to the endpoint—for example, an email address, phone number, or device token.  If the endpoint address is a phone number, you must specify it in E.164 format. For more information about the E.164 format, see [E.164](https://en.wikipedia.org/wiki/E.164) on Wikipedia.   | 
| Attributes.custom\$1attribute | A custom attribute that describes the endpoint. You can use this type of attribute as selection criteria when you create a segment. You can replace custom\$1attribute with any value. | 
| ChannelType | The channel to use when sending messages or push notifications to the endpoint. For example:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/segments-importing.html) | 
| Demographic.AppVersion | The version number of the application that's associated with the endpoint. | 
| Demographic.Locale | The locale of the endpoint, in the following format: the [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) code, followed by an underscore (\$1), followed by an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) value. For example, en\$1US is the English language locale for the United States. | 
| Demographic.Make | The manufacturer of the endpoint device, such as apple or samsung. | 
| Demographic.Model | The model name or number of the endpoint device, such as iPhone or SM-G900F. | 
| Demographic.ModelVersion | The model version of the endpoint device. | 
| Demographic.Platform | The operating system on the endpoint device, such as ios or android. | 
| Demographic.PlatformVersion | The version of the operating system on the endpoint device. | 
| Demographic.Timezone | The endpoint's time zone, as a [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) value. For example, America/Los\$1Angeles for Pacific Time (North America).The following time zones are no longer supported and are automatically remapped to supported time zones. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/segments-importing.html) | 
| EffectiveDate | The date and time when the endpoint was last updated, in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). For example, 2019-08-23T10:54:35.220Z for 10:54 AM UTC August 23, 2019. | 
| Id | A unique identifier for the endpoint. | 
| Location.City | The city where the endpoint is located. | 
| Location.Country | The two-character code, in [ISO 3166-1 alpha-2 format](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), for the country or region where the endpoint is located. For example, US for the United States. | 
| Location.Latitude | The latitude coordinate of the endpoint's location, rounded to one decimal place. | 
| Location.Longitude | The longitude coordinate of the endpoint's location, rounded to one decimal place. | 
| Location.PostalCode | The postal or ZIP code for the area where the endpoint is located. | 
| Location.Region | The name of the region, such as a state or province, where the endpoint is located. | 
| Metrics.custom\$1attribute | A custom numeric metric that your application reports to Amazon Pinpoint for the endpoint—for example, the number of sessions or number of items left in a cart—to use for segmentation purposes. You can replace custom\$1attribute with any value.These custom values can only be numeric. Because they're numeric, Amazon Pinpoint can perform arithmetic operations, such as average or sum, on them. | 
| OptOut | Indicates whether a user opted out of receiving messages and push notifications from you. Acceptable values are: ALL, the user opted out and doesn't want to receive any messages or push notifications, or NONE, the user hasn't opted out and wants to receive all messages and push notifications. | 
| RequestId | The unique identifier for the most recent request to update the endpoint. | 
| User.UserAttributes.custom\$1attribute | A custom attribute that describes the user. You can replace custom\$1attribute with any value, such as FirstName or Age. | 
| User.UserId | A unique identifier for the user. | 
| Canada/East-Saskatchewan  | America/Managua | 
| US/Pacific-New  | America/Los\$1Angeles | 

You can create as many as 250 custom attributes for endpoints and users in each project. For more information, see [Amazon Pinpoint quotas](https://docs.aws.amazon.com/pinpoint/latest/developerguide/quotas.html) in the *Amazon Pinpoint Developer Guide*.

# Exporting segments in the Amazon Pinpoint console
<a name="segments-exporting"></a>

From the **Segments** page in the Amazon Pinpoint console, you can export an existing segment to a file on your computer. When you do, Amazon Pinpoint exports all of the information that's associated with the endpoints in the segment to a file.

This feature is useful if you want to share a list of segment members with somebody else in your organization who doesn't use Amazon Pinpoint. It's also helpful in situations where you want to modify the segment by using a different application.

1. Open the Amazon Pinpoint console at [https://console.aws.amazon.com/pinpoint/](https://console.aws.amazon.com/pinpoint/).

1. On the **All projects** page, choose the project that contains the segment that you want to export.

1. In the navigation pane, choose **Segments**.

1. In the list of segments, choose the segment that you want to export.

1. At the top of the page, choose **Export**, as shown in the following image.  
![\[\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_export_button.png)

1. Amazon Pinpoint creates a new export job, and you see the **Recent exports** tab on the **Segments** page.

   Note the value in the **Export status** column for the segment that you exported. When you first create the export job, the status is **In progress**.

   Wait a few minutes, and then choose the **refresh** (![\[\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/refresh-button.png)) button. If the status is still **In progress**, wait another minute, and then repeat this step. Otherwise, if the status is **Complete**, proceed to the next step.
**Note**  
If a segment requires more than 10 minutes to complete, the export process times out. If you need to export very large segments, you should use the [CreateExportJob](https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-jobs-export.html#CreateExportJob) operation in the Amazon Pinpoint API.

1. Choose **Download** to save the segment to your computer, as shown in the following image.  
![\[\]](http://docs.aws.amazon.com/pinpoint/latest/userguide/images/segments_export_download_button.png)

# Troubleshooting segments
<a name="segments-troubleshooting"></a>

Verify that logging is turned on to assist in identifying the cause of failure. For more information, see [Monitoring and logging](troubleshooting.md#troubleshooting-logging). 

## Segment import failed
<a name="troubleshooting-segment-import"></a>

If a segment import fails, you might see the following error message or similar: 

**Import job**: Import failed for file SampleTemplate.csv with segment name SampleTemplate. Bad request: The data we received didn't match the format we expected for the createImportJob operation. Confirm that the information in your request is formatted properly, and then submit your request again.

****Issue and solution****
+ This error occurs when the imported template isn't formatted correctly.
+ Verify that the template is in valid JSON or CSV format. See [Segment files](segments-importing.md#segments-importing-examples-files) for an example of the correct format. A sample template can also be downloaded from the Console. Under your project, select **Segments**, **Create a segment**, **Import a segment**, and select **Download example CSV**.
+ Verify that all specified attributes are valid. **ChannelType** and **address** are required fields when importing segments. Attribute names are case-sensitive. For a complete list of possible attributes that can be added to a template, see [Supported attributes](segments-importing.md#segments-importing-available-attributes).

## Segment export failed
<a name="troubleshooting-segment-export"></a>

****Issue and solution****
+ Large export jobs may fail when performing this action from the console.
+ As a workaround for this limitation, the segment can be exported to an Amazon S3 bucket using the [CreateExportJob](https://docs.aws.amazon.com//pinpoint/latest/apireference/apps-application-id-jobs-export.html#apps-application-id-jobs-exportpost) API through the command line reference (CLI) or SDK.

## Endpoint count for a dynamic segment
<a name="troubleshooting-dynamic-segment"></a>

****Issues and solutions****
+ When using a dynamic segment to create a campaign, the number of endpoint count is an approximation and may not be accurate. This is because endpoint data in dynamic segments are subject to change over time based on the defined criteria. The segment can be exported to confirm the exact number of endpoints at a given point in time.

## BadRequestException: Exceeded maximum endpoint per user count: 15
<a name="troubleshooting-badrequestexception"></a>

This error occurs when attempting to add more than 15 endpoints associated with the same `UserId`.

**Note**  
If the new endpoint has a channel type of ADM, GCM, APNS, APNS\$1VOICE, APNS\$1VOIP\$1SANDBOX, or BAIDU, the request will succeed if there's already an endpoint with one of those channel types. For more information, see [Managing an audience members maximum number of endpoints](https://docs.aws.amazon.com/pinpoint/latest/developerguide/audience-define-auto-inactive.html) in the *Amazon Pinpoint Developer Guide*.

****Issue and solution****
+ You might see this error when creating new endpoints or editing existing ones using the [update-endpoint](https://docs.aws.amazon.com/cli/latest/reference/pinpoint/update-endpoint.html) API, and the specific endpoint exceeds the maximum number of 15 endpoint addresses.
+ This limit is currently a hard limit with the service. It can't be increased. For more information, see [Endpoint quotas](https://docs.aws.amazon.com//pinpoint/latest/developerguide/quotas.html#quotas-endpoint).

## BadRequestException when calling the UpdateEndpointsBatch or UpdateEndpoints operation: Too many custom attributes
<a name="troubleshooting-attributes"></a>

This error occurs when attempting to add more than 250 attributes. Custom attributes can be a maximum of 15 KB per endpoint.

****Issue and solution****
+ Export the segment and inspect it to confirm the number of custom attributes.
+ To help resolve the exception, see [How do I resolve a "too many attributes" error in Amazon Pinpoint?](https://repost.aws/knowledge-center/pinpoint-additional-attributes)