Skip to main content
POST
/
v1
/
models
/
{modelId}
/
branch
/
{branchName}
/
dbt
Set dbt environment on model branch
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dbt_environment_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "dbt_git_branch": "feature/branch"
}
'
import requests

url = "https://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt"

payload = {
"dbt_environment_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"dbt_git_branch": "feature/branch"
}
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({
dbt_environment_id: 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
dbt_git_branch: 'feature/branch'
})
};

fetch('https://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt', 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://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt",
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([
'dbt_environment_id' => 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
'dbt_git_branch' => 'feature/branch'
]),
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://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt"

payload := strings.NewReader("{\n \"dbt_environment_id\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n \"dbt_git_branch\": \"feature/branch\"\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://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dbt_environment_id\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n \"dbt_git_branch\": \"feature/branch\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{instance}.omniapp.co/api/v1/models/{modelId}/branch/{branchName}/dbt")

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 \"dbt_environment_id\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n \"dbt_git_branch\": \"feature/branch\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true
}
{
"error": "<response_code>",
"message": "<error_reason>"
}
{
"error": "<response_code>",
"message": "<error_reason>"
}
{
"error": "<response_code>",
"message": "<error_reason>"
}
{
"error": "<response_code>",
"message": "<error_reason>"
}
{
"error": "<response_code>",
"message": "<error_reason>"
}

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Path Parameters

modelId
string<uuid>
required

The unique identifier of the model

branchName
string
required

The name of the branch to configure

Body

application/json
dbt_environment_id
string<uuid>
required

The ID of the dbt environment to set as active for the branch

Example:

"b2c3d4e5-f6a7-8901-bcde-f12345678901"

dbt_git_branch
string

Optional git branch name to associate with the dbt environment

Example:

"feature/branch"

Response

dbt environment configuration updated successfully

success
boolean
Example:

true