objects

Segment %alias records with a one-off group

Changed on

Runs the Group engine (the machinery behind saved segments) on ad-hoc filter rows — the registered POST counterpart of the internal getGroupByFilter flow. filters is a JSON array of legacy group rows {field, operation, value}: operation is one of the engine's op letters (e equals, n not equal, s starts with, z ends with, c contains/has, k does not contain/has not, l less than, g greater than, m at most, h at least, o is empty, x is not empty); a comma inside value is an OR across values. Rows are ANDed. Field must be a plain API-readable object field or a supported named complex field; caller-supplied starred, dotted, and nested saved-group expressions are rejected, and hidden fields cannot be used for filtering or sorting. Explicit tag, sequence, and campaign IDs are scoped to the requested object type. Answers an integer count when count=true; record mode returns API-readable fields with the same deprecated-field removal and PII masking as the standard object API.

post/objects/adHocGroup

Request

  • Base URL
    https://api.ontraport.com/1
  • Auth
    none declared

Request body application/x-www-form-urlencoded

objectIDinteger required

Object type id of the records being segmented (0 = Contact).

filtersstring

JSON array of legacy group filter rows {field, operation, value} (see the endpoint description for the operation letters). Required unless related is given.

relatedstring

JSON object restricting by related-record presence: {related_object_id, relationship_field, presence: any|none, direction: parent_by_child|child_by_parent, condition}. relationship_field must be a related-record (parent) field linking the two types; condition is a getList-style JSON condition on the related object.

countboolean

true for an exact count; omit or false for record rows.

rangeinteger

Record mode: max records per page.

startinteger

Record mode: records to skip (pagination).

sortstring

Record mode: column to sort by.

sortDirstring

Record mode: ASC or DESC.

Response

Successful segmentation: an integer count, or raw record rows

codeinteger required
dataobject required
account_idinteger required

Changes