curl --request POST \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branchName": "<string>",
"manifest": {},
"namePrefix": "<string>",
"outputPath": "<string>",
"ref": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync"
payload = {
"branchName": "<string>",
"manifest": {},
"namePrefix": "<string>",
"outputPath": "<string>",
"ref": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branchName: '<string>',
manifest: {},
namePrefix: '<string>',
outputPath: '<string>',
ref: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync",
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([
'branchName' => '<string>',
'manifest' => [
],
'namePrefix' => '<string>',
'outputPath' => '<string>',
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync"
payload := strings.NewReader("{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"branchName": "<string>",
"syncJobId": "<string>",
"workflowId": "<string>"
}Start a dbt sync for a deployment
curl --request POST \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branchName": "<string>",
"manifest": {},
"namePrefix": "<string>",
"outputPath": "<string>",
"ref": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync"
payload = {
"branchName": "<string>",
"manifest": {},
"namePrefix": "<string>",
"outputPath": "<string>",
"ref": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branchName: '<string>',
manifest: {},
namePrefix: '<string>',
outputPath: '<string>',
ref: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync",
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([
'branchName' => '<string>',
'manifest' => [
],
'namePrefix' => '<string>',
'outputPath' => '<string>',
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync"
payload := strings.NewReader("{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/dbt-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branchName\": \"<string>\",\n \"manifest\": {},\n \"namePrefix\": \"<string>\",\n \"outputPath\": \"<string>\",\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"branchName": "<string>",
"syncJobId": "<string>",
"workflowId": "<string>"
}Authorizations
Body
StartDbtSyncInput
The contents of your dbt target/manifest.json, as JSON. Required when source is manifest and ignored otherwise. Produced by dbt parse, dbt compile or dbt build, so a CI job can POST the manifest it just validated and be sure Cube converts exactly that — no re-parse of a branch tip that may already have moved.
Prefix for this sync’s cube names and file names, e.g. sales_. Overrides the Name prefix saved in the deployment’s dbt settings for this sync only; an empty string means no prefix. Cube names must be unique across the data model, so give each dbt project its own prefix when two projects can share a model name.
What to do with the generated cubes. branch (the default) commits them to a new Cube branch for review. files commits nothing and creates no branch — the files are returned from GET /dbt-sync/{syncJobId}/generated-files instead, so your own CI can commit them to your repository through its normal review. Independent of source.
branch, files Repository folder for this sync’s generated cube files, e.g. model/cubes/dbt/sales (a leading / is optional). Overrides the Output path saved in the deployment’s dbt settings for this sync only. A sync replaces the files directly inside this folder and leaves its subfolders alone, so syncing several dbt projects into one deployment works when each gets its own folder and its own namePrefix.
Git ref in the dbt repository to sync from — a branch or a tag, NOT a commit SHA. Overrides the branch saved on the deployment’s dbt git integration for this sync only, so CI can sync the ref under review (e.g. a pull request’s head branch) instead of the tracked branch. The generated Cube branch is named after it.
Where the dbt metadata comes from. git (the default) clones the deployment’s dbt repository and runs dbt to produce a manifest. manifest converts a manifest you supply in manifest below, so Cube never needs access to the dbt repository — and the sync takes seconds rather than minutes, because no sandbox is provisioned and no dbt command runs.
git, manifest