Skip to content

Remove users from segment

Open in ChatGPT Open in Claude
POST
/v1/segment/membership/remove-users
curl --request POST \
--url https://api.foldspace.ai/v1/segment/membership/remove-users \
--header 'Content-Type: application/json' \
--header 'X-FOLDSPACE-API-KEY: <X-FOLDSPACE-API-KEY>' \
--data '{ "segmentId": "123456", "segmentName": "Users last seen in the last 7 days", "segmentDescription": "Users who have been active in the last 7 days", "executionId": "123456", "pageInfo": { "pageNumber": 1, "totalPages": 10 }, "userMemberships": { "userId": "123456", "firstName": "John", "lastName": "Doe", "email": "user@company.com", "phoneNumber": "+1234567890" } }'

Remove users from a segment. If a segment does not exist, it will be created. If a user does not exist, it will be created.

Media type application/json

Segment membership details

object
segmentId
required

Segment ID

string
Example
123456
segmentName
required

Segment name

string
Example
Users last seen in the last 7 days
segmentDescription

Segment description

string
Example
Users who have been active in the last 7 days
executionId
required

Execution ID

string
Example
123456
pageInfo

Page information. Pages of same operation should be grouped with the same execution ID

object
pageNumber

Number of current page starting from 1

integer format: int32
>= 1
Example
1
totalPages

Number of total pages

integer format: int32
>= 1
Example
10
userMemberships

User details for membership

object
userId
required

User ID

string
Example
123456
firstName

First name

string
0 <= 50 characters
Example
John
lastName

Last name

string
0 <= 50 characters
Example
Doe
email

Email

string
Example
user@company.com
phoneNumber

Phone number

string
0 <= 50 characters
Example
+1234567890

Users removed from segment

Media type application/json
string
Example
{
"message": "Users removed from segment"
}

Unauthorized

Media type application/json
string
Example
{
"error": "Unauthorized"
}

Rate limit exceeded for subscription

Media type application/json
string
Example
{
"error": "Rate limit exceeded for subscription"
}

Internal server error

Media type application/json
string
Example
{
"error": "Internal server error"
}