GET /profiles/{collection-id}/{profile-id}/segments

Use the GET /profiles/{collection-id}/{profile-id}/segments endpoint to return a paginated list of the real-time segments that a profile is a member of.

Note

This endpoint is part of the Real-time API, an unstable API that may change without advance notice of breaking changes.

Prerequisites

  1. Add an API key.

  2. Generate an access token.

  3. A profile collection and a real-time segment must be configured for your tenant. Before creating a profile collection or a real-time segment, you must contact your Amperity representative to enable real-time product features.

Note

The access token must be granted the real-time-segments:read and pii:read permissions.

Request URL

Direct all requests to the GET /profiles/{collection-id}/{profile-id}/segments endpoint to the request URL. The request URL uses the base URL with the endpoint path appended.

Amazon AWS

https://app.amperity.com/prof/profiles/{collection-id}/{profile-id}/segments

Microsoft Azure

https://{tenant-id}.amperity.com/prof/profiles/{collection-id}/{profile-id}/segments

You can find the tenant ID from the Amperity user interface. From the Settings page and select the Security tab. Under API keys, in the row for an API key, open the menu and select Copy tenant ID.

Rate limit

A rate limit is the number of requests that may be made to the Amperity API in a given time period.

Requests

A request to the GET /profiles/{collection-id}/{profile-id}/segments endpoint is similar to:

curl --request GET \
       'https://app.amperity.com/prof/profiles/{collection-id}/{profile-id}/segments?limit=100' \
     --header 'amperity-tenant: {tenant-id}' \
     --header 'Authorization: Bearer {token}'

This example is formatted for readability in a narrow page layout.

Request parameters

The following table describes the parameters that may be used with the GET /profiles/{collection-id}/{profile-id}/segments endpoint.

Parameter

Description

collection-id

String. Required.

The ID of the profile collection that contains the profile.

profile-id

String. Required.

The ID of the profile whose segment membership is returned.

limit

Integer. Optional.

The maximum number of records to include in a single page of results.

next_token

String. Optional.

An opaque token that is used to paginate results. Omit the next_token property to return the first page. Use the cursor value for next_token that was returned in a response to view the next page of results.

Responses

A response from the GET /profiles/{collection-id}/{profile-id}/segments endpoint will match an HTTP status code. A 200 response returns a page of the real-time segments the profile is a member of.

200 OK

The 200 response returns a page of segment memberships.

 1{
 2  "data": [
 3    {
 4      "segment_id": "{segment-id}",
 5      "segment_name": "{segment-name}"
 6    }
 7  ],
 8  "next_token": "{next-token}",
 9  "total": 0
10}

Response parameters

A 200 OK response contains the following parameters.

Parameter

Description

data

A JSON array of segment memberships. Each item contains the segment_id and segment_name of a real-time segment that the profile is a member of.

next_token

A pagination cursor returned with the results. Pass this value as the next_token request parameter to view the next page of results.

total

The total number of real-time segments that the profile is a member of.