---
title: "Set dbt environment on model branch"
method: POST
path: "/v1/models/{modelId}/branch/{branchName}/dbt"
tags: ["dbt"]
---

# Set dbt environment on model branch

`POST /v1/models/{modelId}/branch/{branchName}/dbt`

Sets the active dbt environment on a model branch. This endpoint allows you to programmatically configure which dbt environment a branch should use, enabling CI/CD pipelines to automate dbt environment configuration before triggering schema refreshes.

## Path parameters

- `modelId` string, uuid, required
- `branchName` string, required

## Request body

- object
  - `dbt_environment_id` string, uuid, required — The ID of the dbt environment to set as active for the branch
  - `dbt_git_branch` string — Optional git branch name to associate with the dbt environment

## Response `200`

dbt environment configuration updated successfully

- SuccessResponse
  - `success` boolean

## Other responses

- `400` — Bad Request Possible error messages: - `Bad Request: Invalid modelId format` - `Bad Request: Invalid dbt_environment_id format` - `dbt_environment_id is required`
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found Possible error messages: - `Shared model or branch model does not exist` - `Branch model with id <branch-id> does not exist` - `dbt environment not found`
- `405` — Method Not Allowed - Invalid HTTP method for this endpoint
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
