Skip to main content
You may Import data into a User Profiles or a Company with the model_kind property. When using a CSV to create new records that are not yet in Chameleon, you must provide a mapping to the uid property, this is the same value you pass to chmln.identify via the JS API. Using a tagging kind (tag_csv or tag_filters) will either create a new User Tag or a new Company Tag and add all of the matching models to the new Tag.

Schema


Limitations

  • Imports must be less than 50MB (200MB on the Growth plan) [1]
  • Imports must be less 20 columns (100 on the Growth plan) [1]
  • Only 20 Imports total can be created (50 on the Growth plan) [1]
  • Imports “Tags” can be reused with tag_import_id, reused imports do not count against this limit.
  • Once an Import is marked as triggered (when import_at has a timestamp value) the Import can no longer be updated.
  • Only one Import will be run concurrently (though many can be triggered at the same time)
[1] Import limits can be increased on an Growth / Enterprise plan. Contact us to talk about your use case.

List all Imports

HTTP Request

GET

Create an Import

HTTP Request

POST
For CSV-based import kind, both valid properties and file are required before import_at can be set.
Errors (for both create and update)
  • When the Import has already been started (when import_at has a value).
  • When the on_model_missing is create and the uid property is not mapped in properties.
  • When any of the supplied properties are not found as Headers in the uploaded file.
  • When the tag_import_id refers to an import that has not been finished
Errors during Import
  • When an error occurs during the Import, the stats.last_import_state will change to retrying or error and stats.last_import_error will have a value.
Using kind=tag_csv to tag User Profiles via a User ID
This will be the same User ID you send to Chameleon when calling chmln.identify => Identifying Users.
With a CSV file like this, specify the header of User ID as mapping to the Chameleon User Profile field of uid.
Request:
Response:
Using kind=tag_csv to tag User Profiles with Email
With a CSV file like this, specify the header of Email address as mapping to the Chameleon User Profile field of email.
You must set on_model_missing to ignore because no field maps to the uid Property.
Request:
Response:
Using kind=tag_csv to tag Companies via a Company ID
This will be the same Company ID you send to Chameleon when calling chmln.identify => Identifying Company.
With a CSV file like this, specify the header of Company ID as mapping to the Chameleon Company field of uid.
Request:
Response:
Using kind=update_csv to update User Profile data
With a CSV file like this, use properties to specify the headers as mapped to the prop field of Chameleon Property.
Request:
Response:
Using kind=delete_csv to delete User Profiles via a User ID
This will be the same User ID you send to Chameleon when calling chmln.identify => Identifying Users.
With a CSV file like this, specify the header of User ID as mapping to the Chameleon User Profile field of uid.
Request:
Response:
Using kind=delete_csv to delete User Profiles with Email
With a CSV file like this, specify the header of Email address as mapping to the Chameleon User Profile field of email.
Request:
Response:

HTTP Response

Show an Import

Get information about the this Import which is typically used to track the Import’s progress and to know when it finishes. Use stats.rows_count and stats.last_row to give a percentage complete. The Import is finished when stats.last_import_state is completed, at that point all other stats keys will have a relevant values. (i.e. stats.last_import_at and stats.last_import_elapsed).

HTTP Request

GET

HTTP Response

Update an Import

The main reason to update an import is to “capture a workflow” or to separately upload the CSV file for convenience via cURL. A workflow is typical of an Import UI but not typical of an API

HTTP Request

PATCH
See options for Creating an Import

Download the uploaded data

Same endpoint as show, but adds a .csv on the end. The response body is the CSV data. the Content-Disposition will be in this format => attachment; filename="your original upload.csv"

HTTP Request

GET

cURL Examples

To Authenticate, replace ACCOUNT_SECRET below with your secret token. This can be generated on your dashboard.