Get or Create Customer
/api/create_customer/
curl --request POST \
--url https://api.explo.co/api/create_customer/ \
--header 'Explo-Authorization: <explo-authorization>'
This endpoint gets or creates a new customer. If a customer with the given provided_id does not exist, a new customer will be created. The response contains the created or already-existing customer and a flag denoting whether a new customer was created.
Body
The display name of your customer in Explo.
The ID you use to identify this customer in your database. This is also the ID you will use to reference your customer in Explo queries or access your customer via the API. For more information on example usage, check out this section.
A set of key-values pairs that map a schema id to the data source that this customer loads data from. For more information on schemas and data sources, check out this section.
A boolean representing whether this customer is a “demo customer.” Setting this to true will make data panels include a demo watermark for the customer. Demo customers do not count towards paid customers. Default value is false.
An array of email addresses to add to the customer.
An identifier for a parent customer matching the parent’s provided_id
. If
provided, the customer will be set as a child of the parent customer, and will
have its computed_properties
and computed_parent_schema_datasource_mapping
fields inherit values from the parent customer.
A set of key-value pairs assigned to this customer. These will be accessible through variables in the dashboards and SQL editor. More information on properties can be found in this section.
Response
Indicates whether the call was successful. 1 if successful, 0 if not.
Indicates whether a new customer was created.
The contents of the customer
curl --location --request POST 'https://api.explo.co/api/create_customer/' \
--header 'Content-Type: application/json' \
--header 'Explo-Authorization: Token <token>' \
--data-raw '{
"provided_id": "example_1",
"name": "Example 1",
"mapping": {"40": "213", "134": "386"},
"properties": {"filterValue": "value"},
"emails": ["example@example.com"]
}'
{
"success": 1,
"new_customer": true,
"customer": {
"token": "<customer_token_to_auth_dashboard>",
"name": "Example 1",
"provided_id": "example_1",
"is_demo_group": false,
"emails": ["example@example.com"],
"properties": { "filterValue": "value" },
"computed_properties": { "filterValue": "value" },
"parent_schema_datasource_mapping": {"40": "213": "134": 386"},
"computed_parent_schema_datasource_mapping": {"40": "213": "134": 386"}
}
}
curl --location --request POST 'https://api.explo.co/api/create_customer/' \
--header 'Content-Type: application/json' \
--header 'Explo-Authorization: Token <token>' \
--data-raw '{
"provided_id": "example_1",
"name": "Example 1",
"mapping": {"40": "213", "134": "386"},
"properties": {"filterValue": "value"},
"emails": ["example@example.com"]
}'
{
"success": 1,
"new_customer": true,
"customer": {
"token": "<customer_token_to_auth_dashboard>",
"name": "Example 1",
"provided_id": "example_1",
"is_demo_group": false,
"emails": ["example@example.com"],
"properties": { "filterValue": "value" },
"computed_properties": { "filterValue": "value" },
"parent_schema_datasource_mapping": {"40": "213": "134": 386"},
"computed_parent_schema_datasource_mapping": {"40": "213": "134": 386"}
}
}