Segments

Retrieve a list of your segments. The list doesn't include archived segments.

get/v1/segments

Request

  • Base URL
    https://api.customer.io
  • URL
    https://api.customer.io/v1/segments
  • Auth
    HTTP bearer

Response

Returns an array of segments. Each object in the response represents an individual segment.

Example response

{
  "segments": [
    {
      "id": 7,
      "deduplicate_id": "15:1492548073",
      "name": "Manual Segment 1",
      "description": "My first manual segment",
      "state": "finished",
      "type": "manual",
      "conditions": {
        "and": [
          {
            "event": {
              "filters": {
                "and": [
                  {
                    "field": "to",
                    "inverse": false,
                    "operator": "eq",
                    "value": "premium"
                  },
                  {
                    "field": "from",
                    "inverse": true,
                    "operator": "eq",
                    "value": "premium"
                  }
                ]
              },
              "id": 12,
              "name": "plan",
              "type": "attribute_change"
            },
            "inverse": false,
            "times": 1,
            "within": 0
          },
          {
            "segment": {
              "id": 7,
              "inverse": false
            }
          }
        ]
      },
      "created_at": 1552341937,
      "updated_at": 1552341937
    }
  ]
}

Changes

    • warning

      added the new snapshot enum value to the // response property for the response status

    • breaking

      the // response's property type changed from integer null to number null for status

    • info

      added the optional property // to the response with the status

    • info

      removed the build_queued enum value from the // response property for the response status

    • info

      removed the events enum value from the // response property for the response status

    • info

      removed the events_queued enum value from the // response property for the response status