Skip to main content
  • The Live Experiences will not display and the Chameleon JavaScript will not be loaded onto the page.
  • HTTP requests to our Internal APIs (to edit any Experiences or content) will fail.
If you want to know more about managing domains and subdomains in Chameleon, please visit our product documentation. Jump to Environments

Domains (Urls)

Enabling Domains on your Chameleon account via API can be helpful for:
  • Enabling new domains on a top-level-domain.
  • Enabling Chameleon on a white-label application.
With the Chameleon API for Domains, you can:
  • Enable new domains jump ↓.
  • Assign domains to different Environments jump ↓ (production,staging,test,etc.).
  • Enable or disable an existing domain.
  • Retrieve all domains that correspond to the specified parameters (search by tld).
  • Retrieve a specific domain based on its id.

Domain Schema (Url)

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
updated_attimestampThe last time any property was updated
url_group_idIDThe Environment (Url Group) this Url is a part of. null to be part of all Environments.
hoststringThe fully qualified domain of this Url (i.e. app.example.com)
domainstringThe top-level domain (i.e. example.com)
enabledstringThe authorization state of this Url. subdomain means that new urls are on vs safely defaulting to off: One of off, on, or subdomain
installed_attimestampWhen the JavaScript snippet was installed on this domain
first_seen_attimestampWhen this domain had its first User Profile identified
last_seen_attimestampThe most recent time a User Profile as identified
unlistedboolean[deprecated; replaced by archived_at] If this Url is hidden from the list of domains
archived_attimestampThe time when this was archived

Create a Url (enable a new domain)

HTTP Request

POST https://api.chameleon.io/v3/edit/urls
param-description
hostrequiredThe fully qualified domain of this Url (i.e. app.example.com)
enabledrequiredThe authorization state to create with. Default is on. Values are one of on, off, or subdomain
unlistedoptional[deprecated; replaced by archived_at] Whether or not the Url is displayed on the Domains page in the dashboard
archived_atoptionalTo archive set to a timestamp, to unarchive set to null

HTTP Response

{
  "url": {
     "id": "5c4950c34733cc0004d5bfd7",
     "host": "app.example.com",
     "domain": "example.com",
     "enabled": "on",
     ...
  }
}

Update a Url

HTTP Request

PUT|PATCH https://api.chameleon.io/v3/edit/urls/:id
param-description
idrequiredThe Chameleon ID of the Url to update
enabledoptionalThe authorization state to create with. Default is on. Values are one of on, off, or subdomain
unlistedoptional[deprecated; replaced by archived_at] Whether or not the Url is displayed on the Domains page in the dashboard
archived_atoptionalTo archive set to a timestamp, to unarchive set to null
url_group_idoptionalThe Environment (Url Group) to assign this Url to

HTTP Response

{
  "url": {
     "id": "5c4950c34733cc0004d5bfd7",
     "host": "app.example.com",
     "domain": "example.com",
     "enabled": "on",
     ...
  }
}

Bulk a Url

HTTP Request

POST https://api.chameleon.io/v3/edit/urls/batch
param-description
idsrequiredAn array of Chameleon IDs of the Urls to update
enabledoptionalThe authorization state to change to.
archived_atoptionalTo archive set to a timestamp, to unarchive set to null
url_group_idoptionalThe Environment (Url Group) to assign these Urls to

HTTP Response

All of the Urls given in the request ids are updated with the value given by enabled, archived_at, or url_group_id. They are sent back even if they were already in the resulting bulk-update state.
{
  "urls": [
    {
      "id": "5c4950c34733cc0004d5bfd7",
      "host": "test2.example.com",
      "domain": "example.com",
      "enabled": "on",
      ...
    },
    {
      "id": "5c4950c34733cc0004d5bfd8",
      "host": "test4.example.com",
      "domain": "example.com",
      "enabled": "on",
      ...
    }
  ]
}

Listing all Urls

HTTP Request

GET https://api.chameleon.io/v3/edit/urls
param-description
domainoptionalFilter to urls only on this domain (i.e. ex.io will return app.ex.io, dashboard.ex.io but not app.example.com)
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

HTTP Response

{
  "urls": [
     {
       "id": "5c4950c34733cc0004d5bfd7",
       "host": "app.example.com",
       "domain": "example.com",
       "enabled": "on",
       ...
    },
     {
       "id": "5c4950c34733cc0004d5bfd4",
       "host": "example.com",
       "domain": "example.com",
       "enabled": "subdomain",
       ...
    },
     {
       "id": "5c4950c34733cc0004d5bfd2",
       "host": "internal.example.com",
       "domain": "example.com",
       "enabled": "off",
       ...
    },
    ...
  ],
  "cursor": {
    "limit": 50,
    "before": "5c4950c34733cc0004d5bfd2"
  }
}

Retrieve a Url

HTTP Request

GET https://api.chameleon.io/v3/edit/urls/:id
param-description
idrequiredThe Chameleon ID of the Url to show

HTTP Response

{
  "url": {
     "id": "5c4950c34733cc0004d5bfd7",
     "host": "app.example.com",
     "domain": "example.com",
     "enabled": "on",
     ...
  }
}

Environments (Url Groups)

An Environment is a group of Domains. The purpose of an Environment is to:
  1. Split data out into groups; the groups are used in the Chameleon Dashboard to display your Experience data by environment.
  2. Allow Chameleon Admins a simple way to publish Experiences first to Staging/QA then to Production without needing to change the Url Rules.
  3. Have greater visibility into what your end-users will be eligible for.
All Urls and all Experiences are part of the Default Environment by default Assigning a url_group_id to a TLD means that all future subdomains of that TLD are

Environment Schema (Url Group)

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
updated_attimestampThe last time any property was updated
archived_attimestampThe time when this was archived
namestringThe name given by an administrator of Chameleon
descriptionstringThe display description
short_namestringUp to 3 characters abbreviating the name (i.e. PR for Production)
style_short_name_colorstringA easily recognizable color; an uppercase 6 char hex code excluding the #.

Create a Url Group

HTTP Request

POST https://api.chameleon.io/v3/edit/url_groups
param-description
namerequiredThe name of this Environment
descriptionoptionalA description to display along with the Environment name
short_nameoptional1-3 character ‘short code’ that should be the short version of the name (PR for Production etc.)
style_short_name_coloroptionalA 6 character hex code color to identify the Environment

HTTP Response

{
  "url_group": {
     "id": "6c4950c34733cc0004d5bff1",
     "name": "Test QA #1",
     "description": "Pre-production for our QA team",
     "short_name": "Q1",
     "style_short_name_color": "E7AD5A",
     ...
  }
}

Update a Url Group

HTTP Request

PUT|PATCH https://api.chameleon.io/v3/edit/url_groups/:id
param-description
idrequiredThe Url Group ID.
nameoptionalThe name of this Environment
descriptionoptionalA description to display along with the Environment name
short_nameoptional1-3 character ‘short code’ that should be the short version of the name (PR for Production etc.)
style_short_name_coloroptionalA 6 character hex code color to identify the Environment
archived_atoptionalTo archive set to a timestamp, to unarchive set to null
urls_action_on_archiveoptionalUse values of ignore or archive. When archiving with archived_at, the Domains of this environment will either be archived as well or left as-is.

HTTP Response

{
  "url_group": {
    "name": "QA #1",
    ...
  }
}

Add Domains to an Environment

Updating a Url with a url_group_id of an Environment (Url Group) will assign it to that Environment

Removing Domains from an Environment

Updating a Url with a url_group_id equal to null will assign it to the Default Environment

Listing all Url Groups

HTTP Request

GET https://api.chameleon.io/v3/edit/url_groups
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

HTTP Response

{
  "urls": [
    {
      "id": "6c4950c34733cc0004d5bff1",
      "name": "Test QA #1",
      "description": "Pre-production for our QA team",
      "short_name": "Q1",
      "style_short_name_color": "E7AD5A",
      ...
    },
    {
      "id": "6c4950c34733cc0004d5bff2",
      "name": "Staging",
      "description": null,
      "short_name": "ST",
      "style_short_name_color": "6D95C0",
      ...
    },
     {
       "id": "6c4950c34733cc0004d5bff2",
       "name": "Production",
       "description": "Live for customers",
       "short_name": "PR",
       "style_short_name_color": "8FC06D",
       ...
    },
    ...
  ],
  "cursor": {
    "limit": 50,
    "before": "5c4950c34733cc0004d5bfd2"
  }
}

Retrieve a Url Group

HTTP Request

GET https://api.chameleon.io/v3/edit/url_groups/:id
param-description
idrequiredThe Chameleon ID of the Environment (Url Group) to show

HTTP Response

{
  "url": {
    "id": "6c4950c34733cc0004d5bff2",
    "name": "Staging",
    "description": null,
    "short_name": "ST",
    "style_short_name_color": "6D95C0",
    ...
  }
}