Skip to main content

With the Chameleon API for Segments, you can:
  • Retrieve a list of segments according to the specified parameters.
  • Retrieve a single segment based on the id.
  • List all the Chameleon Experiences (Tours, Microsurveys, Launchers) that are connected to a defined segment.

Schema

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
updated_attimestampThe last time any property was updated
namestringThe name given by an administrator of Chameleon
itemsarray<SegmentFilter>An array of items that each define a Segmentation Filter expression
items_openumIf each filter item is joined with logical AND or OR. One of and or or
For a full list of your User / Company Properties see the Properties API

Listing Segments

Retrieve a list of segments according to the specified parameters.

HTTP Request

GET https://api.chameleon.io/v3/edit/segments
param-description
limitoptionalDefaults to 50 with a maximum of 500
beforeoptionalUsed when paginating, use directly from the cursor object from the previous response
beforeoptionalRead as “created before” and can be given as a timestamp to get only limit items that were created before this time
afteroptionalRead as “created after” and can be given as a timestamp or ID to get only limit items that were created after this time
With a timestamp
{
  "limit": 100,
  "before": "2029-04-07T12:18:00Z"
}
From the previous response cursor.before
{
  "limit": 500,
  "before": "5f3c4232c712de665632a6d7"
}

HTTP Response

{
  "segments": [
    {
      "id": "5f3c4232c712de665632a6d9",
      "name": "Admins who invited > 3",
      "items": [
        {
          "id": "5f3c4232c712de665632a6d8",
          "kind": "property",
          "prop": "role",
          "op": "eq",
          "value": "admin"
        },
        {
          "id": "5f3c4232c712de665632a6d7",
          "kind": "property",
          "prop": "invited_users_count",
          "op": "gte",
          "value": 3
        }
      ]
    },
    {
      "id": "5f3c4232c712de665632a6e2",
      "name": "Grown Plan Upsell",
       ...
    },
    ...
  ],
  "cursor": {
    "limit": 50,
    "before": "5f3c4232c712de665632a6d7"
  }
}

Showing a Segment

Retrieve a single Segment.

HTTP Request

GET https://api.chameleon.io/v3/edit/segments/:id
param-description
idrequiredA Segment ID to lookup

HTTP Response

{
  "segment": {
    "id": "5f3c4232c712de665632a6d7",
    "name": "Admins who invited > 3",
    "items": [
      {
        "id": "5f3c4232c712de665632a6d8",
        "kind": "property",
        "prop": "role",
        "op": "eq",
        "value": "admin"
      },
      {
        "id": "5f3c4232c712de665632a6d9",
        "kind": "property",
        "prop": "invited_users_count",
        "op": "gte",
        "value": 3
      }
    ]
  }
}

A Segment can be configured to be attached to many Chameleon Experiences, including Microsurveys, Tours and Launchers and Rate Limit Groups. This endpoint allows you to list any of these items that are currently attached to the Segment given with the ID

HTTP Request

GET https://api.chameleon.io/v3/edit/segments/:id/:kind
param-description
idrequiredA Segment ID to lookup
kindrequiredOne of tour, survey or launcher

HTTP Response

{
  "segment": {
    "id": "5f3c4232c712de665632a6d7",
    "name": "Admins",
    ...
  },
  "tours": [
    {
      "id": "5f3c4232c712de665632a6d5",
      "name": "Revamped Dashboard Launch",
      "style": "auto",
      "position": 4,
      "published_at": "2029-04-07T12:18:00Z",
       ...
    },
  ],
  "cursor": {
    "limit": 50,
    "before": "5f3c4232c712de665632a2a1"
  }
}