Skip to main content

Clear a segment's membership

POST /v2/marketing/segments/clear_membership_segment

Clears all members from a membership segment. This is an asynchronous operation. To check its progress, poll get clear status.

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
segment_idstringRequired

The ID of the segment to clear. Required.

Request examples​

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

Response​

FieldTypeRequiredDescription
successbooleanOptional

Whether the clear request was accepted.

Response examples​

200 Success

{
"success": true
}

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 field"can't be blank"1001{"key":"segment_id"}
401Unauthorized"Unauthorized"nullNot applicable
403Forbidden"Forbidden"nullNot applicable