Skip to main content
POST
/
v1
/
connections
/
{connectionId}
/
dbt
/
environments
curl --request POST \ --url https://{instance}.omniapp.co/api/v1/connections/{connectionId}/dbt/environments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "name": "Production dbt", "targetSchema": "analytics" } '
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Production dbt",
  "isDefaultEnvironment": false,
  "ownerId": "550e8400-e29b-41d4-a716-446655440000",
  "targetDatabase": "analytics_db",
  "targetName": null,
  "targetRole": null,
  "targetSchema": "analytics",
  "variables": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "DBT_TARGET",
      "value": "production",
      "isSecret": false
    },
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "name": "DBT_API_KEY",
      "value": null,
      "isSecret": true
    }
  ]
}

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

connectionId
string<uuid>
required

The unique identifier of the connection

Body

application/json
name
string
required

The name of the dbt environment

Minimum string length: 1
Example:

"Production dbt"

targetSchema
string
required

The target schema for the environment

Minimum string length: 1
Example:

"analytics"

ownerId
string<uuid> | null

Only valid with Organization API keys. The user ID of the owner for the dbt environment. Personal Access Tokens (PATs) automatically use the authenticated user as the owner.

Example:

"550e8400-e29b-41d4-a716-446655440000"

targetDatabase
string | null

Target database override

Example:

"analytics_db"

targetName
string | null

Target name override

Example:

"my_project"

targetRole
string | null

Target role override

Example:

"transformer"

variables
object[]

Environment variables for the dbt environment. Note: While variables is not required, at least one variable object must be defined if variables is included in the request body.

Response

dbt environment created successfully

id
string<uuid>

Unique identifier of the dbt environment

name
string

The name of the dbt environment

isDefaultEnvironment
boolean

Whether this is the default environment

ownerId
string<uuid> | null

The user ID of the owner of the dbt environment, or null

targetDatabase
string | null

Target database override

targetName
string | null

Target name override

targetRole
string | null

Target role override

targetSchema
string

Target schema for the environment

variables
object[]

Environment variables