segments

Embed
Preview of the card
<a href="https://hermeticor.com/docs/ref-segments"><img src="https://hermeticor.com/docs/_api/public/orgs/5fcd8b3c-a27c-4688-972f-de710125592f/spaces/caf5dc05-15f7-4e0c-bdb8-ab29ede6211e/pages/a1bf95e7-ade8-4fcf-b9dd-0119dc7aeef8/social-card.svg?v=3e7ae33eec8b" alt="segments" width="600" height="315"></a>
POSThttps://hermeticor.com/v1/segments/preview

Request body

application/json
definitionobjectrequired
Show child parameters
typestringrequired
group
opstringrequired
and | or
negateboolean
childrenschema0[]required
subjectstring
{
  "definition": {
    "type": "group",
    "op": "and",
    "negate": true,
    "children": [
      {}
    ]
  },
  "subject": "string"
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/preview" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"definition":{"type":"group","op":"and","negate":true,"children":[{}]},"subject":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "count": 0,
  "sample": [
    {
      "id": "string",
      "emailPrimary": "string",
      "phonePrimary": "string",
      "firstName": "string",
      "lastName": "string",
      "timezone": "string",
      "locale": "string",
      "country": "string",
      "city": "string",
      "region": "string",
      "source": "string",
      "lifecycleStage": "string",
      "ownerUserId": "string",
      "attributes": {},
      "tags": [
        "string"
      ],
      "mergedIntoId": "string",
      "archivedAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z",
      "consentIgnored": [
        "email"
      ]
    }
  ],
  "explanation": [
    "string"
  ],
  "evaluatedAt": "2024-01-01T00:00:00Z"
}
Schema
countintegerrequired
sampleItemsItem2[]required
Show child parameters
idstringrequired
emailPrimarystringrequired
phonePrimarystringrequired
firstNamestringrequired
lastNamestringrequired
timezonestringrequired
localestringrequired
countrystringrequired
citystringrequired
regionstringrequired
sourcestringrequired
lifecycleStagestringrequired
ownerUserIdstringrequired
attributesobjectrequired
tagsstring[]required
mergedIntoIdstringrequired
archivedAtstring
createdAtstringrequired
updatedAtstringrequired
consentIgnoredstring[]
explanationstring[]required
evaluatedAtstringrequired
4XX Default Response
Example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
Schema
errorobjectrequired
Show child parameters
codestringrequired
messagestringrequired
detailsobject
5XX Default Response

Same as 4XX · POST /v1/segments/preview

POSThttps://hermeticor.com/v1/segments/explain-match

Why a profile matches or does not match a draft definition: the verdict of each condition and group

Request body

application/json
definitionobjectrequired
Show child parameters
typestringrequired
group
opstringrequired
and | or
negateboolean
childrenschema0[]required
profileIdstringrequired
{
  "definition": {
    "type": "group",
    "op": "and",
    "negate": true,
    "children": [
      {}
    ]
  },
  "profileId": "string"
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/explain-match" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"definition":{"type":"group","op":"and","negate":true,"children":[{}]},"profileId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "segmentId": "string",
  "profileId": "string",
  "matched": true,
  "member": true,
  "tree": {},
  "evaluatedAt": "2024-01-01T00:00:00Z"
}
Schema
segmentIdstringrequired
profileIdstringrequired
matchedbooleanrequired
memberbooleanrequired
treerequired
evaluatedAtstringrequired
4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

GEThttps://hermeticor.com/v1/segments/{id}/explain-match/{profileId}

Why a profile is or is not in this segment, condition by condition, next to its stored membership

Parameters

idstringpathrequired
profileIdstringpathrequired

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/segments/{id}/explain-match/{profileId}" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · POST /v1/segments/explain-match

4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

GEThttps://hermeticor.com/v1/segments/settings

Spend-tier boundaries and the geocoding provider

Code samples

cURL
curl -X GET "https://hermeticor.com/v1/segments/settings" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "spendTiers": {
    "mid": 0,
    "high": 0,
    "top": 0
  },
  "geocoder": "none",
  "geocoderKeySet": true
}
Schema
spendTiersobjectrequired
Show child parameters
midnumberrequired
highnumberrequired
topnumberrequired
geocoderstringrequired
none | opencage
geocoderKeySetbooleanrequired
4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

PUThttps://hermeticor.com/v1/segments/settings

Change spend tiers or the geocoding provider; segments that use them recalculate

Request body

application/json
spendTiersobject
Show child parameters
midnumberrequired
highnumberrequired
topnumberrequired
geocoderstring
none | opencage
geocoderKeystring
{
  "spendTiers": {
    "mid": 0,
    "high": 0,
    "top": 0
  },
  "geocoder": "none",
  "geocoderKey": "string"
}

Code samples

cURL
curl -X PUT "https://hermeticor.com/v1/segments/settings" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spendTiers":{"mid":0,"high":0,"top":0},"geocoder":"none","geocoderKey":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · GET /v1/segments/settings

4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

POSThttps://hermeticor.com/v1/segments/places/check

Is a postal code placed on the map, and how many profiles can be located

Request body

application/json
countrystringrequired
postalCodestringrequired
{
  "country": "string",
  "postalCode": "string"
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/places/check" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"string","postalCode":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "placed": true,
  "lat": 0,
  "lng": 0,
  "source": "string",
  "profilesPositioned": 0,
  "profilesTotal": 0,
  "geocoder": "none"
}
Schema
placedbooleanrequired
latnumberrequired
lngnumberrequired
sourcestringrequired
profilesPositionedintegerrequired
profilesTotalintegerrequired
geocoderstringrequired
none | opencage
4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

POSThttps://hermeticor.com/v1/segments/places

Set the position of a postal code by hand

Request body

application/json
countrystringrequired
postalCodestringrequired
latnumberrequired
lngnumberrequired
{
  "country": "string",
  "postalCode": "string",
  "lat": 0,
  "lng": 0
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/places" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"string","postalCode":"string","lat":0,"lng":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Default Response
Example
{
  "ok": true
}
Schema
okbooleanrequired
true
4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

POSThttps://hermeticor.com/v1/segments/places/lookup

Place a postal code with the configured geocoding provider

Request body

application/json
countrystringrequired
postalCodestringrequired
{
  "country": "string",
  "postalCode": "string"
}

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/places/lookup" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"string","postalCode":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · POST /v1/segments/places/check

4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

POSThttps://hermeticor.com/v1/segments/places/geocode-missing

Place up to 25 postal codes that profiles carry but nobody has located

Code samples

cURL
curl -X POST "https://hermeticor.com/v1/segments/places/geocode-missing" \
  -H "Authorization: Bearer $HERMETICOR_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "placed": 0,
  "failed": 0,
  "remaining": 0
}
Schema
placedintegerrequired
failedintegerrequired
remainingintegerrequired
4XX Default Response

Same as 4XX · POST /v1/segments/preview

5XX Default Response

Same as 4XX · POST /v1/segments/preview

Updated