Segments
Convert a segment
Convert a segment between ACTIVE and STATIC in the tenant and project derived from the access token.
Overview
Use this endpoint to convert an existing segment between ACTIVE and STATIC. Notifyy derives cin and the acting user or system actor from the token, and derives the object from the stored segment record instead of trusting the client request. ACTIVE to STATIC resolves current members and freezes them into static membership. STATIC to ACTIVE requires filter history for the current version. It requires public api oauth access token authentication and the crm.segments.write scope.
/api/segments/convert-segmentcURL
POSTcurl --request POST \ --url 'https://crm.notifyy.io/api/segments/convert-segment' \ --header 'Authorization: Bearer nfy_public_api_access_token' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "segmentId": 999, "toSegmentType": "STATIC"}'Sample Request Body
{ "segmentId": 999, "toSegmentType": "STATIC"}Sample Response
{ "success": true, "message": "Segment converted from ACTIVE to STATIC successfully", "data": { "segmentId": 999, "fromType": "ACTIVE", "toType": "STATIC", "memberCount": 1245 }}Status Codes
| Code | Description |
|---|---|
| 200 | Segment was converted. |
| 400 | Request body is invalid, the target type is invalid, the segment is already in that type, or STATIC to ACTIVE is attempted without current filters. |
| 401 | Public API access token is missing, invalid, expired, or revoked. |
| 404 | Segment was not found in the token-bound tenant and project. |
| 408 | Segment member resolution timed out because the segment is too complex. |
Headers
Public API OAuth bearer token.
Example: Bearer nfy_public_api_access_token
Request body media type.
Example: application/json
Expected response media type.
Example: application/json
| Object | Description |
|---|---|
Authorization string | RequiredPublic API OAuth bearer token. Example: Bearer nfy_public_api_access_token |
Content-Type string | RequiredRequest body media type. Example: application/json |
Accept string | RequiredExpected response media type. Example: application/json |
Request body
Segment to convert. It must belong to the token-bound tenant and project.
Example: 999
Target segment type. Allowed values are ACTIVE and STATIC.
Example: STATIC
| Object | Description |
|---|---|
segmentId integer | RequiredSegment to convert. It must belong to the token-bound tenant and project. Example: 999 |
toSegmentType string | RequiredTarget segment type. Allowed values are ACTIVE and STATIC. Example: STATIC |
Convert Response Fields
Field
segmentId
Type
integer
Description
Converted segment identifier.
Field
fromType
Type
string
Description
Original segment type.
Field
toType
Type
string
Description
Target segment type after conversion.
Field
memberCount
Type
integer
Description
Number of members frozen or released during conversion.
| Field | Type | Description |
|---|---|---|
| segmentId | integer | Converted segment identifier. |
| fromType | string | Original segment type. |
| toType | string | Target segment type after conversion. |
| memberCount | integer | Number of members frozen or released during conversion. |
Response fields
Whether the request succeeded.
Example: true
Human-readable result message.
Example: Segment converted from ACTIVE to STATIC successfully
Converted segment identifier.
Example: 999
Original segment type.
Example: ACTIVE
Target segment type after conversion.
Example: STATIC
Number of members frozen or released during conversion.
Example: 1245
| Object | Description |
|---|---|
success boolean | Whether the request succeeded. Example: true |
message string | Human-readable result message. Example: Segment converted from ACTIVE to STATIC successfully |
data.segmentId integer | Converted segment identifier. Example: 999 |
data.fromType string | Original segment type. Example: ACTIVE |
data.toType string | Target segment type after conversion. Example: STATIC |
data.memberCount integer | Number of members frozen or released during conversion. Example: 1245 |