---
title: "Update External Segment membership"
method: POST
path: "/v1/external_segment/update_membership"
tags: ["ExternalSegments"]
---

# Update External Segment membership

`POST /v1/external_segment/update_membership`

## Request

- Base URL: `https://app.aptrinsic.com`
- URL: `https://app.aptrinsic.com/v1/external_segment/update_membership`
- Auth: none declared
- TypeScript: <https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/docs/v1/external_segment/update_membership/post.ts> (a function with typed inputs; its response is checked against the schema)

Updates External Segment membership

## Request body

- SegmentPayload: Payload for adding or removing segment identities
  - `add` SegmentAction[], required: List of segments to add
    - `identities` string[], required: List of user identity IDs
    - `lastQualificationTime` string, required: Last qualification time in ISO 8601 format
    - `segmentId` string, required: Segment ID
  - `identityType` 'IDENTIFY_ID' | 'GLOBAL_ID': Identity type for all identities
  - `remove` SegmentAction[], required: List of segments to remove
    - `identities` string[], required: List of user identity IDs
    - `lastQualificationTime` string, required: Last qualification time in ISO 8601 format
    - `segmentId` string, required: Segment ID

## Response `200`

Success

## Other responses

- `400`: Bad request, possible duplicate
- `401`: Unauthorized or bad API Key
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api.md) - [All operations](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/revisions/e7b197b373d8?raw)
