Skip to content

Retrieve number of profiles based on set of segment rules

Request

Retrieve the number of profiles produced by a set of segment rules.

Security
TdApikeyAuth
Path
audienceIdinteger, (int64)required

Master Segment id of the segment

Bodyapplication/json
columnsArray of strings
kindinteger

0: batch, 1: realtime, 2: funnel_stage

rulepartial_v5_rule.yaml-v5IonRule-ionRule (object) or (object or null)(partial_v5_rule.yaml-v5IonRule)
One of:
funnel_stageobject

required if creating segment as a rule of funnel_stage

pageSizeinteger
maxPageinteger
enableMvstring

"true", "false"

filterStringstring
Example:"Alex"
realtimebooleanDeprecated

use kind instead

curl -i -X POST \
  'https://api-cdp.treasuredata.com/audiences/{audienceId}/segments/queries' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "columns": [
      "string"
    ],
    "realtime": true,
    "kind": 0,
    "rule": {
      "conditions": [
        {
          "conditions": [
            {
              "exclude": true,
              "id": "string",
              "type": "FunnelStageReference"
            }
          ],
          "description": "string",
          "expr": "string",
          "type": "Or"
        }
      ],
      "expr": "string",
      "limit": {
        "number": 0,
        "orderColumns": [
          {
            "column": "string",
            "order": "ascending",
            "type": "Column"
          }
        ],
        "type": "Count"
      },
      "type": "Or"
    },
    "funnel_stage": {
      "funnel_id": 0,
      "stage_id": 0
    },
    "pageSize": 0,
    "maxPage": 0,
    "enableMv": "string",
    "filterString": "Alex"
  }'

Responses

success

Bodyapplication/json
idstring

Query identifier (may be UUID or platform-specific ID like job ID or statement handle)

queryIdstring

Same value as id.

statusstring
Enum:"success""killed""error""running"
countinteger or null

Number of profiles produced by the given segment rules

maxPageinteger or null
errorstring or null
jobidstring, (integer)
countJobidstring or null, (integer)
customerGroupCountinteger or null

Number of customer groups related by the given segment rules

Response
{ "id": "string", "queryId": "string", "status": "success", "count": 0, "maxPage": 0, "error": "string", "jobid": "string", "countJobid": "string", "customerGroupCount": 0 }