Skip to main content
For a full list of your User / Company Properties see the Properties API

Schema

Fully-expanded Company when listed directly or embedded with expand param specified properly

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
uidstringThe external ID that came from your backend system
*any optionsmixedAny other options you have sent as Custom Properties will show up here too

Non-expanded Company when embedded in another (i.e. Microsurvey response)

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
uidstringThe external ID that came from your backend system

Create or Update a Company

See the Companies Webhook for sending User data to Chameleon

Retrieve a Company

Retrieve a single Company.

HTTP Request

GET https://api.trychameleon.com/v3/analyze/companies/:id
# OR
GET https://api.trychameleon.com/v3/analyze/company?uid=:uid
param-description
idoptionalThe Chameleon ID of the Company
uidoptionalThe Company identifier (typically the Database ID from your backend)
{
  "company": {
    "id": "5f3c4232c712de665632a2a1",
    "created_at": "2029-04-07T12:38:00Z",
    "uid": "1868",
    "domain": "example.com",
    "plan": "custom-92",
    "clv": 231902.42,
    ...
  }
}

List Companies

List all Companies.

HTTP Request

GET|POST https://api.chameleon.io/v3/analyze/companies
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
expandoptionalObject that specifies relationships to include/exclude. Supported keys are company
expand.companyoptionaluse values of all, min to control the properties present in the company. Defaults to all

Using the expand parameter

# As a URL parameter
expand[profile]=min&expand[company]=skip

# In the Reqeust body
{"expand":{"profile":"min","company":"skip"}}

HTTP Response

{
  "companies": [
    {
      "id": "5f3c4232c712de665632a6d5",
      "created_at": "2029-04-07T12:38:00Z",
      "uid": "1868",
      "domain": "example.com",
      "plan": "custom-92",
      "clv": 231902.42,
      ...
    },
    {
      "id": "5f3c4232c712de665632a2a1",
      "created_at": "2029-04-07T12:38:00Z",
      "uid": "2015",
      "domain": "chameleon.io",
      "plan": "custom-12",
      "clv": 39102.17,
      ...
    },
    ...
  ],
  "cursor": {
    "limit": 50,
    "before": "5f3c4232c712de665632a2a1"
  }
}

Search Companies

Searching Companies through the Chameleon API allows you to:
  • Search for a company by id and uid
Note: Rate Limiting applies according to the table below.
endpointMaximum concurrent requests
/companies2

Examples

All of these examples are based directly on the full schema of Segmentation Filter Expressions. Each example below is showing the value for the filters key in the JSON request body:
{
  "filters": [
    ...
  ]
}
Companies that have a specific uid
Find the company with the uid of 123:
{
  "filters": [
    {
      "kind": "property",
      "prop": "uid",
      "op": "eq",
      "value": "123"
    }
  ]
}
curl -H "X-Account-Secret: ACCOUNT_SECRET" \
     -H "Content-Type: application/json" \
     -X POST \
     -d '{"filters":[{"kind":"property","prop":"uid","op":"eq","value":"123"}]}' \
     https://api.trychameleon.com/v3/analyze/companies

Delete a Company

When deleting a company, the company record itself is deleted and company is removed from all profiles associated with it. The associated profiles can also be removed by passing cascade=profiles with the request.
param.-description
idoptionalThe Chameleon ID of the Company
uidoptionalThe Company identifier (typically the Database ID from your backend)

HTTP Request

Either id or uid is required.
DELETE https://api.trychameleon.com/v3/edit/companies/:id
# OR
DELETE https://api.trychameleon.com/v3/edit/company?uid=:uid

HTTP Response

The endpoint returns id of the Deletion record. The Deletion is an internal Chameleon record that can be referenced as proof of initiating this request.
{
  "deletion": {
    "id": "5f3c4232c712de665632a6d5"
  }
}

Deleting a company and all profiles associated with it

Deleting a company and all profiles associated with it can be done by passing cascade=profiles:
DELETE https://api.trychameleon.com/v3/edit/companies/:id?cascade=profiles
# OR
DELETE https://api.trychameleon.com/v3/edit/company?uid=:uid&cascade=profiles

HTTP Response

When cascade deletion is requested, the endpoint also returns deletion ids of all the profiles associated with the company under deletions key.
{
  "deletion": {
    "id": "5f3c4232c712de665632a6d5"
  },
  "deletions": [
    { "id":  "5f3c4232c712de665632a6d6" },
    { "id":  "5f3c4232c712de665632a6d7" },
    { "id":  "5f3c4232c712de665632a6d8" }
  ]
}