Create Pipeline
Create an export pipeline with the Data Pipelines API, with type, data source, and destination-specific parameters
curl --request POST \
--url https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data type=gcs-raw \
--data from_date=2023-12-25 \
--data 'gcs_bucket=<string>' \
--data project_id=123 \
--data trial=false \
--data data_source=events \
--data to_date=2023-12-25 \
--data frequency=daily \
--data 'events=<string>' \
--data 'where=<string>' \
--data data_format=json \
--data 'gcs_prefix=<string>'import requests
url = "https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create"
payload = {
"type": "gcs-raw",
"from_date": "2023-12-25",
"gcs_bucket": "<string>",
"project_id": "123",
"trial": "false",
"data_source": "events",
"to_date": "2023-12-25",
"frequency": "daily",
"events": "<string>",
"where": "<string>",
"data_format": "json",
"gcs_prefix": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
type: 'gcs-raw',
from_date: '2023-12-25',
gcs_bucket: '<string>',
project_id: '123',
trial: 'false',
data_source: 'events',
to_date: '2023-12-25',
frequency: 'daily',
events: '<string>',
where: '<string>',
data_format: 'json',
gcs_prefix: '<string>'
})
};
fetch('https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create', 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://{server}.mixpanel.com/api/2.0/nessie/pipeline/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{server}.mixpanel.com/api/2.0/nessie/pipeline/create"
payload := strings.NewReader("type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create")
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/x-www-form-urlencoded'
request.body = "type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"pipeline_names": [
"trial-events-daily-bigquery-monoschema",
"trial-people-daily-bigquery-monoschema"
],
"bigquery_dataset_name": "https://bigquery.cloud.google.com/dataset/mixpanel-prod-1:sample_dataset_name"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}type parameter defines the kind of pipeline that is initiated. Note that only 2 recurring and 1 non-recurring events pipelines (data_source: events) are allowed per project.
Create API returns the name of the pipeline created. Use the name of the pipeline to check the status of or cancel the pipeline.
Important: For BigQuery pipelines,gcp_projectandbq_dataset_nameare required fields. Mixpanel-hosted BigQuery is not supported.
Important: For Snowflake pipelines, customer-hosted credentials (snowflake_account_name,snowflake_warehouse,snowflake_storage_integration,snowflake_user,snowflake_password,snowflake_role,snowflake_database,snowflake_schema) are required. Only password-based authentication is supported. Mixpanel-hosted Snowflake is not supported.
Body
- Raw GCS Pipeline
- Raw Amazon S3 Pipeline
- Raw Azure Pipeline
- Schematized BigQuery Pipeline
- Schematized Snowflake Pipeline
- Schematized AWS Pipeline
- Schematized Azure Pipeline
- Schematized GCS Pipeline
The GCS region for the bucket.
northamerica-northeast1, us-central1, us-east1, us-east4, us-west1, us-west2, southamerica-east1, europe-north1, europe-west1, europe-west2, europe-west3, europe-west4, europe-west6, asia-east1, asia-east2, asia-northeast1, asia-northeast2, asia-northeast3, asia-south1, asia-southeast1, australia-southeast1 Default: false
A trial pipeline will be created if value is true.
The trial exports all of your events and user data for thirty calendar days, starting from one day before the API call was made. A trial pipeline has default values for the following parameters:
data_source: events
from_date: <defaults to previous day>
to_date: <no value>
frequency: daily
events: <no value>
A selector expression used to filter by events data, such as event properties. Learn more about how to construct event selector expressions here.
Response
Returns the name of the pipeline created. Use the name of the pipeline to check the status of or cancel the pipeline.
Was this page helpful?
curl --request POST \
--url https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data type=gcs-raw \
--data from_date=2023-12-25 \
--data 'gcs_bucket=<string>' \
--data project_id=123 \
--data trial=false \
--data data_source=events \
--data to_date=2023-12-25 \
--data frequency=daily \
--data 'events=<string>' \
--data 'where=<string>' \
--data data_format=json \
--data 'gcs_prefix=<string>'import requests
url = "https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create"
payload = {
"type": "gcs-raw",
"from_date": "2023-12-25",
"gcs_bucket": "<string>",
"project_id": "123",
"trial": "false",
"data_source": "events",
"to_date": "2023-12-25",
"frequency": "daily",
"events": "<string>",
"where": "<string>",
"data_format": "json",
"gcs_prefix": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
type: 'gcs-raw',
from_date: '2023-12-25',
gcs_bucket: '<string>',
project_id: '123',
trial: 'false',
data_source: 'events',
to_date: '2023-12-25',
frequency: 'daily',
events: '<string>',
where: '<string>',
data_format: 'json',
gcs_prefix: '<string>'
})
};
fetch('https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create', 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://{server}.mixpanel.com/api/2.0/nessie/pipeline/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{server}.mixpanel.com/api/2.0/nessie/pipeline/create"
payload := strings.NewReader("type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://{server}.mixpanel.com/api/2.0/nessie/pipeline/create")
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/x-www-form-urlencoded'
request.body = "type=gcs-raw&from_date=2023-12-25&gcs_bucket=%3Cstring%3E&project_id=123&trial=false&data_source=events&to_date=2023-12-25&frequency=daily&events=%3Cstring%3E&where=%3Cstring%3E&data_format=json&gcs_prefix=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"pipeline_names": [
"trial-events-daily-bigquery-monoschema",
"trial-people-daily-bigquery-monoschema"
],
"bigquery_dataset_name": "https://bigquery.cloud.google.com/dataset/mixpanel-prod-1:sample_dataset_name"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}