Skip to main content

List segments

GET /v2/marketing/segments

Returns the membership segments available to the authenticated client. Each segment in the response includes its segment_id, name, and description.

Results are paginated. Use the page and page_size query parameters to page through larger result sets. When you omit these parameters, Instacart returns the first page using the default page size.

Security​

NameInDescription
AuthorizationheaderThe Authorization header with the client bearer token acquired during authentication.

For more information, see Get a client access token.

Parameters​

NameInTypeRequiredDescription
pagequeryintegerOptional

1-based page number. Must be a positive integer when supplied.

page_sizequeryintegerOptional

Number of segments per page. Must be between 1 and 100 when supplied.

Request​

None.

Request examples​

curl --request GET \
--url 'https://connect.instacart.com/v2/marketing/segments?page=1&page_size=1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'

Response​

FieldTypeRequiredDescription
segmentsArray(Segment)Optional

The segments on this page.

paginationPaginationMetadataOptional

Pagination metadata for the current result set. Omitted when the downstream response carries no pagination.

Segment Object​

FieldTypeRequiredDescription
segment_idstringOptional

The unique ID of the segment.

namestringOptional

The display name of the segment.

descriptionstringOptional

A human-readable description of the segment.

PaginationMetadata Object​

FieldTypeRequiredDescription
total_countintegerOptional

The total number of segments across all pages.

pageintegerOptional

The 1-based page number of this result set.

page_sizeintegerOptional

The number of segments per page.

total_pagesintegerOptional

The total number of pages available.

Response examples​

200 Success

{
"segments": [
{
"segment_id": "f87414d7-1836-4b5c-84b5-6efeb2406a18",
"name": "Loyalists",
"description": "Top spenders"
},
{
"segment_id": "a2c9e0f4-3b71-4d28-9f6a-1c5d8e2b9047",
"name": "Lapsed",
"description": "No order in 90 days"
}
],
"pagination": {
"total_count": 42,
"page": 1,
"page_size": 20,
"total_pages": 3
}
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Invalid page"page must be a positive integer"1001Not applicable
400Invalid page size"page_size must be between 1 and 100"1001Not applicable
401Unauthorized"Unauthorized"nullNot applicable
403Forbidden"Forbidden"nullNot applicable