Skip to main content

Create a membership segment

POST /v2/marketing/segments/create_membership_segment

Creates a new membership segment.

Your request must include the segment's name and can optionally include a description to help identify the segment later. The response contains name, description, and the Instacart-generated segment_id.

Security​

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

For more information, see Get a client access token.

Parameters​

None.

Request​

FieldTypeRequiredDescription
namestringRequired

The display name for the new segment. Required.

descriptionstringOptional

An optional human-readable description of the segment.

Request examples​

curl --request POST \
--url https://connect.instacart.com/v2/marketing/segments/create_membership_segment \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"description": "string"
}'

Response​

FieldTypeRequiredDescription
segment_idstringOptional

The unique ID of the segment.

namestringOptional

The display name of the segment.

descriptionstringOptional

A human-readable description of the segment.

Response examples​

200 Success

{
"segment_id": "f87414d7-1836-4b5c-84b5-6efeb2406a18",
"name": "My Segment",
"description": "desc"
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Invalid body"Invalid request body"1001Not applicable
400Missing name"can't be blank"1001{"key":"name"}
400Segment already exists"segment with name "My Segment" already exists: f87414d7-1836-4b5c-84b5-6efeb2406a18"1001{"key":"name"}
401Unauthorized"Unauthorized"nullNot applicable
403Forbidden"Forbidden"nullNot applicable