POST
/
api
/
segments
/
text-to-segment
Text to Segment Builder
curl --request POST \
  --url https://api.embedreach.com/api/segments/text-to-segment \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "<string>",
  "userCustomVerb": "user"
}'
{
  "success": true,
  "failureReason": "<string>",
  "conditions": [
    {
      "field": "userId",
      "value": [
        "<string>"
      ],
      "operator": "equals"
    }
  ],
  "title": "<string>",
  "description": "<string>"
}

Headers

reach-tenant-id
string

If using a platform scoped JWT, you can pass in a header to impersonate a specific tenant to impersonate the request as.

Body

application/json
text
string
required

The text to build a segment from

userCustomVerb
string
default:user

The custom verb used to describe users (e.g. if you use "patrons" instead of "users"). Defaults to "user"

Response

Status 200 response

success
boolean
required

Whether the text to segment was successful

failureReason
string

The reason the text to segment was not successful.

conditions
object[]

The conditions to include in the segment. If the text to segment was not successful, this will be null

title
string

A suggested title for the segment generated by AI

description
string

A suggested description for the segment generated by AI