NNotifyy CRM

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.

POST/api/segments/convert-segment

cURL

POST
bash
curl --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"}'

Authorization

Public API OAuth access token

crm.segments.write

Sample Request Body

json
{  "segmentId": 999,  "toSegmentType": "STATIC"}

Sample Response

json
{  "success": true,  "message": "Segment converted from ACTIVE to STATIC successfully",  "data": {    "segmentId": 999,    "fromType": "ACTIVE",    "toType": "STATIC",    "memberCount": 1245  }}

Status Codes

CodeDescription
200Segment was converted.
400Request body is invalid, the target type is invalid, the segment is already in that type, or STATIC to ACTIVE is attempted without current filters.
401Public API access token is missing, invalid, expired, or revoked.
404Segment was not found in the token-bound tenant and project.
408Segment member resolution timed out because the segment is too complex.

Headers

AuthorizationstringRequired

Public API OAuth bearer token.

Example: Bearer nfy_public_api_access_token

Content-TypestringRequired

Request body media type.

Example: application/json

AcceptstringRequired

Expected response media type.

Example: application/json

Request body

segmentIdintegerRequired

Segment to convert. It must belong to the token-bound tenant and project.

Example: 999

toSegmentTypestringRequired

Target 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.

Response fields

successboolean

Whether the request succeeded.

Example: true

messagestring

Human-readable result message.

Example: Segment converted from ACTIVE to STATIC successfully

data.segmentIdinteger

Converted segment identifier.

Example: 999

data.fromTypestring

Original segment type.

Example: ACTIVE

data.toTypestring

Target segment type after conversion.

Example: STATIC

data.memberCountinteger

Number of members frozen or released during conversion.

Example: 1245