Skip to main content

segments

Creates, updates, deletes, gets or lists a segments resource.

Overview

Namesegments
TypeResource
Idaws.pinpoint.segments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
application_idstringThe unique identifier for the application that the segment is associated with.
arnstringThe Amazon Resource Name (ARN) of the segment.
creation_datestringThe date and time when the segment was created.
dimensionsobjectSpecifies the dimension settings for a segment.
idstringThe unique identifier for the segment.
import_definitionobjectThe settings for the import job that's associated with the segment.
last_modified_datestringThe date and time when the segment was last modified.
namestringThe name of the segment.
segment_groupsobjectA list of one or more segment groups that apply to the segment. Each segment group consists of zero or more base segments and the dimensions that are applied to those base segments.
segment_typestringThe segment type. Valid values are: DIMENSIONAL - A dynamic segment, which is a segment that uses selection criteria that you specify and is based on endpoint data that's reported by your app. Dynamic segments can change over time. IMPORT - A static segment, which is a segment that uses selection criteria that you specify and is based on endpoint definitions that you import from a file. Imported segments are static; they don't change over time. (DIMENSIONAL, IMPORT)
versionintegerThe version number of the segment.
tagsobjectA string-to-string map of key-value pairs that identifies the tags that are associated with the segment. Each tag consists of a required tag key and an associated tag value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_segmentselectapplication-id, segment-id, regionRetrieves information about the configuration, dimension, and other settings for a specific segment that's associated with an application.
get_segmentsselectapplication-id, regionpage-size, tokenRetrieves information about the configuration, dimension, and other settings for all the segments that are associated with an application.
create_segmentinsertapplication-id, region, WriteSegmentRequestCreates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.
update_segmentupdateapplication-id, segment-id, region, WriteSegmentRequestCreates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.
delete_segmentdeleteapplication-id, segment-id, regionDeletes a segment from an application.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application-idstringThe unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.
regionstringAWS region (default: us-east-1)
segment-idstringThe unique identifier for the segment.
page-sizestringThe maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.
tokenstringThe NextToken string that specifies which page of results to return in a paginated response.

SELECT examples

Retrieves information about the configuration, dimension, and other settings for a specific segment that's associated with an application.

SELECT
application_id,
arn,
creation_date,
dimensions,
id,
import_definition,
last_modified_date,
name,
segment_groups,
segment_type,
version,
tags
FROM aws.pinpoint.segments
WHERE `application-id` = '{{ application-id }}' -- required
AND `segment-id` = '{{ segment-id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.

INSERT INTO aws.pinpoint.segments (
WriteSegmentRequest,
`application-id`,
region
)
SELECT
'{{ WriteSegmentRequest }}' /* required */,
'{{ application-id }}',
'{{ region }}'
RETURNING
segment_response
;

UPDATE examples

Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.

UPDATE aws.pinpoint.segments
SET
WriteSegmentRequest = '{{ WriteSegmentRequest }}'
WHERE
`application-id` = '{{ application-id }}' --required
AND `segment-id` = '{{ segment-id }}' --required
AND region = '{{ region }}' --required
AND WriteSegmentRequest = '{{ WriteSegmentRequest }}' --required
RETURNING
segment_response;

DELETE examples

Deletes a segment from an application.

DELETE FROM aws.pinpoint.segments
WHERE `application-id` = '{{ application-id }}' --required
AND `segment-id` = '{{ segment-id }}' --required
AND region = '{{ region }}' --required
;