---
updatedAt: 2026-08-14T00:04:41.000Z
---

# Navigate segment tree

Returns the hierarchical segment tree including segment categories and segments. Includes both locally owned and shared segments for the active account.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Reference Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/ref/segment-tree": {
      "get": {
        "operationId": "ref_segment_tree_list",
        "description": "Returns the hierarchical segment tree including segment categories and segments. Includes both locally owned and shared segments for the active account.",
        "summary": "Navigate segment tree",
        "parameters": [
          {
            "in": "query",
            "name": "advertiser_id",
            "schema": {
              "type": "number"
            },
            "description": "Only return segments owned by a specific advertiser."
          },
          {
            "in": "query",
            "name": "advertiser_id__equals_or_null",
            "schema": {
              "type": "number"
            },
            "description": "Only return segments with no owner or owned by a specific advertiser."
          },
          {
            "in": "query",
            "name": "key",
            "schema": {
              "type": "string"
            },
            "description": "Only return segment tree nodes whose key exactly matches this value."
          },
          {
            "in": "query",
            "name": "key__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Only return segment tree nodes whose key matches one of these values. Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "key__isempty",
            "schema": {
              "type": "boolean"
            },
            "description": "When true, only return segment tree nodes with an empty or missing key. When false, exclude them."
          },
          {
            "in": "query",
            "name": "key__not",
            "schema": {
              "type": "string"
            },
            "description": "Exclude segment tree nodes whose key exactly matches this value."
          },
          {
            "in": "query",
            "name": "key__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Exclude segment tree nodes whose key matches one of these values. Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "description": "Only return segment tree nodes whose name exactly matches this value."
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "parent_key",
            "schema": {
              "type": "string"
            },
            "description": "Only return segment tree nodes whose parent key exactly matches this value."
          },
          {
            "in": "query",
            "name": "parent_key__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Only return segment tree nodes whose parent key matches one of these values. Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "parent_key__isempty",
            "schema": {
              "type": "boolean"
            },
            "description": "When true, only return segment tree nodes with an empty or missing parent key. When false, exclude them."
          },
          {
            "in": "query",
            "name": "parent_key__not",
            "schema": {
              "type": "string"
            },
            "description": "Exclude segment tree nodes whose parent key exactly matches this value."
          },
          {
            "in": "query",
            "name": "parent_key__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Exclude segment tree nodes whose parent key matches one of these values. Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            },
            "description": "Only return segment tree nodes whose type matches this value ('segment' or 'category')."
          },
          {
            "in": "query",
            "name": "type__isempty",
            "schema": {
              "type": "boolean"
            },
            "description": "When true, only return segment tree nodes with an empty or missing type. When false, exclude them."
          },
          {
            "in": "query",
            "name": "type__not",
            "schema": {
              "type": "string"
            },
            "description": "Exclude segment tree nodes whose type matches this value ('segment' or 'category')."
          }
        ],
        "tags": [
          "Reference"
        ],
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSegmentTreeNodeList"
                }
              }
            },
            "description": "Segment tree retrieved successfully."
          },
          "400": {
            "description": "Invalid filter or query parameters."
          },
          "401": {
            "description": "Authentication credentials were not provided."
          },
          "403": {
            "description": "Permission denied."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PaginatedSegmentTreeNodeList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentTreeNode"
            }
          }
        }
      },
      "SegmentTreeNode": {
        "type": "object",
        "properties": {
          "cpm": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,3}(?:\\.\\d{0,2})?$",
            "description": "The CPM price to target this segment."
          },
          "children_count": {
            "type": "integer",
            "readOnly": true,
            "description": "The number of direct child segments and categories. This will always be null for segments."
          },
          "children_url": {
            "type": "string",
            "readOnly": true,
            "description": "The URI to fetch a list of child segments and categories. This will always be null for segments."
          },
          "user_count_by_region": {
            "type": "object",
            "additionalProperties": {},
            "readOnly": true,
            "description": "Object of number of users contained in the segment keyed by global region (e.g. APAC, NAM, EMEA). This will always be null for categories."
          },
          "advertiser_id": {
            "type": "integer",
            "description": "The advertiser ID for the segment or segment category."
          },
          "type": {
            "type": "string",
            "description": "Either segment or category."
          },
          "key": {
            "type": "string",
            "description": "Alphanumeric key for the segment or category, in the format {Data Provider}-{Segment / Category ID}."
          },
          "name": {
            "type": "string",
            "description": "Name of the segment or category."
          },
          "data_provider_id": {
            "type": "integer",
            "description": "Unique ID of the data provider. This value will always be null for custom segments."
          },
          "parent_key": {
            "type": "string",
            "description": "Alphanumeric key for the parent node in the tree."
          },
          "alternative_id": {
            "type": "string",
            "description": "An ID that may be used for any reporting or administrative purpose. Limited to 191 characters."
          },
          "verb_usage": {
            "type": "string",
            "description": "Restricted way segment can be applied to a targeting expression."
          }
        },
        "required": [
          "advertiser_id",
          "alternative_id",
          "children_count",
          "children_url",
          "cpm",
          "data_provider_id",
          "key",
          "name",
          "parent_key",
          "type",
          "user_count_by_region",
          "verb_usage"
        ]
      }
    },
    "securitySchemes": {
      "nestBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      },
      "nestSessionAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      }
    }
  },
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python",
    "php",
    "java"
  ],
  "servers": [
    {
      "url": "https://{buzz_key}.api.beeswax.com/rest/v2",
      "variables": {
        "buzz_key": {
          "default": "stingersbx",
          "description": "Unique customer ID assigned by the Beeswax"
        }
      }
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true,
    "apply-tag-changes": true
  }
}
```