Create Lookup Table Import
Create a new warehouse import for lookup table data.
Lookup tables allow you to enrich event and user properties with additional attributes from your warehouse.
curl --request POST \
--url https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"import_type": "lookup_table",
"warehouse_source_id": 123,
"table_params": {},
"mixpanel_property": {
"value": "<string>",
"customPropertyId": 123
},
"property_key_column_name": "<string>",
"databricks_params": {
"export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": true,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [
{}
]
}
}
}
'import requests
url = "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table"
payload = {
"import_type": "lookup_table",
"warehouse_source_id": 123,
"table_params": {},
"mixpanel_property": {
"value": "<string>",
"customPropertyId": 123
},
"property_key_column_name": "<string>",
"databricks_params": { "export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": True,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [{}]
} }
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
import_type: 'lookup_table',
warehouse_source_id: 123,
table_params: {},
mixpanel_property: {value: '<string>', customPropertyId: 123},
property_key_column_name: '<string>',
databricks_params: {
export_cluster_config: {
spark_version: '<string>',
node_type_id: '<string>',
driver_node_type_id: '<string>',
num_workers: 1,
autoscale: {min_workers: 1, max_workers: 2},
spark_conf: {},
spark_env_vars: {},
single_user_name: '<string>',
custom_tags: {},
policy_id: '<string>',
instance_pool_id: '<string>',
driver_instance_pool_id: '<string>',
enable_elastic_disk: true,
aws_attributes: {},
azure_attributes: {},
gcp_attributes: {},
init_scripts: [{}]
}
}
})
};
fetch('https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'import_type' => 'lookup_table',
'warehouse_source_id' => 123,
'table_params' => [
],
'mixpanel_property' => [
'value' => '<string>',
'customPropertyId' => 123
],
'property_key_column_name' => '<string>',
'databricks_params' => [
'export_cluster_config' => [
'spark_version' => '<string>',
'node_type_id' => '<string>',
'driver_node_type_id' => '<string>',
'num_workers' => 1,
'autoscale' => [
'min_workers' => 1,
'max_workers' => 2
],
'spark_conf' => [
],
'spark_env_vars' => [
],
'single_user_name' => '<string>',
'custom_tags' => [
],
'policy_id' => '<string>',
'instance_pool_id' => '<string>',
'driver_instance_pool_id' => '<string>',
'enable_elastic_disk' => true,
'aws_attributes' => [
],
'azure_attributes' => [
],
'gcp_attributes' => [
],
'init_scripts' => [
[
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table"
payload := strings.NewReader("{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"results": {
"id": 123,
"created": "2023-11-07T05:31:56Z",
"creator_id": 123,
"creator_name": "<string>",
"creator_email": "<string>",
"warehouse_source_id": 123,
"table_params": {},
"paused": true,
"last_dispatch": 123,
"is_deleted": true,
"event_name": "<string>",
"event_column_name": "<string>",
"time_column_name": "<string>",
"user_column_name": "<string>",
"insert_time_column_name": "<string>",
"property_mappings": {},
"group_key": "<string>",
"group_id_column": "<string>",
"databricks_params": {
"export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": true,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [
{}
]
}
}
}
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}Authorizations
Service Account
Path Parameters
Your project id (eg: 12345)
Body
lookup_table Table location parameters (structure depends on warehouse type)
The Mixpanel property that this lookup table will be joined on. This defines
the "Join Key" — the Mixpanel event or user property whose values will be
matched against the property_key_column_name column in your warehouse table.
For example, if your events have a property called product_id and your warehouse
lookup table has a column product_id containing matching values along with
enrichment columns like product_name and category, you would set:
mixpanel_property.value="product_id"(the Mixpanel property name)property_key_column_name="product_id"(the warehouse column name)
Show child attributes
Show child attributes
The name of the column in your warehouse table that contains the join key values.
This column's values will be matched against the Mixpanel property specified in
mixpanel_property.value to look up the corresponding row.
full_sync, one_time Sync frequency in nanoseconds. Only these values are accepted:
0- API-triggered only (use the manual-sync endpoint to trigger)3600000000000- Hourly86400000000000- Daily604800000000000- Weekly
0, 3600000000000, 86400000000000, 604800000000000 Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"import_type": "lookup_table",
"warehouse_source_id": 123,
"table_params": {},
"mixpanel_property": {
"value": "<string>",
"customPropertyId": 123
},
"property_key_column_name": "<string>",
"databricks_params": {
"export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": true,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [
{}
]
}
}
}
'import requests
url = "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table"
payload = {
"import_type": "lookup_table",
"warehouse_source_id": 123,
"table_params": {},
"mixpanel_property": {
"value": "<string>",
"customPropertyId": 123
},
"property_key_column_name": "<string>",
"databricks_params": { "export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": True,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [{}]
} }
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
import_type: 'lookup_table',
warehouse_source_id: 123,
table_params: {},
mixpanel_property: {value: '<string>', customPropertyId: 123},
property_key_column_name: '<string>',
databricks_params: {
export_cluster_config: {
spark_version: '<string>',
node_type_id: '<string>',
driver_node_type_id: '<string>',
num_workers: 1,
autoscale: {min_workers: 1, max_workers: 2},
spark_conf: {},
spark_env_vars: {},
single_user_name: '<string>',
custom_tags: {},
policy_id: '<string>',
instance_pool_id: '<string>',
driver_instance_pool_id: '<string>',
enable_elastic_disk: true,
aws_attributes: {},
azure_attributes: {},
gcp_attributes: {},
init_scripts: [{}]
}
}
})
};
fetch('https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'import_type' => 'lookup_table',
'warehouse_source_id' => 123,
'table_params' => [
],
'mixpanel_property' => [
'value' => '<string>',
'customPropertyId' => 123
],
'property_key_column_name' => '<string>',
'databricks_params' => [
'export_cluster_config' => [
'spark_version' => '<string>',
'node_type_id' => '<string>',
'driver_node_type_id' => '<string>',
'num_workers' => 1,
'autoscale' => [
'min_workers' => 1,
'max_workers' => 2
],
'spark_conf' => [
],
'spark_env_vars' => [
],
'single_user_name' => '<string>',
'custom_tags' => [
],
'policy_id' => '<string>',
'instance_pool_id' => '<string>',
'driver_instance_pool_id' => '<string>',
'enable_elastic_disk' => true,
'aws_attributes' => [
],
'azure_attributes' => [
],
'gcp_attributes' => [
],
'init_scripts' => [
[
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table"
payload := strings.NewReader("{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/app/projects/{projectId}/warehouse-sources/imports/lookup-table")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"import_type\": \"lookup_table\",\n \"warehouse_source_id\": 123,\n \"table_params\": {},\n \"mixpanel_property\": {\n \"value\": \"<string>\",\n \"customPropertyId\": 123\n },\n \"property_key_column_name\": \"<string>\",\n \"databricks_params\": {\n \"export_cluster_config\": {\n \"spark_version\": \"<string>\",\n \"node_type_id\": \"<string>\",\n \"driver_node_type_id\": \"<string>\",\n \"num_workers\": 1,\n \"autoscale\": {\n \"min_workers\": 1,\n \"max_workers\": 2\n },\n \"spark_conf\": {},\n \"spark_env_vars\": {},\n \"single_user_name\": \"<string>\",\n \"custom_tags\": {},\n \"policy_id\": \"<string>\",\n \"instance_pool_id\": \"<string>\",\n \"driver_instance_pool_id\": \"<string>\",\n \"enable_elastic_disk\": true,\n \"aws_attributes\": {},\n \"azure_attributes\": {},\n \"gcp_attributes\": {},\n \"init_scripts\": [\n {}\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"results": {
"id": 123,
"created": "2023-11-07T05:31:56Z",
"creator_id": 123,
"creator_name": "<string>",
"creator_email": "<string>",
"warehouse_source_id": 123,
"table_params": {},
"paused": true,
"last_dispatch": 123,
"is_deleted": true,
"event_name": "<string>",
"event_column_name": "<string>",
"time_column_name": "<string>",
"user_column_name": "<string>",
"insert_time_column_name": "<string>",
"property_mappings": {},
"group_key": "<string>",
"group_id_column": "<string>",
"databricks_params": {
"export_cluster_config": {
"spark_version": "<string>",
"node_type_id": "<string>",
"driver_node_type_id": "<string>",
"num_workers": 1,
"autoscale": {
"min_workers": 1,
"max_workers": 2
},
"spark_conf": {},
"spark_env_vars": {},
"single_user_name": "<string>",
"custom_tags": {},
"policy_id": "<string>",
"instance_pool_id": "<string>",
"driver_instance_pool_id": "<string>",
"enable_elastic_disk": true,
"aws_attributes": {},
"azure_attributes": {},
"gcp_attributes": {},
"init_scripts": [
{}
]
}
}
}
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}