---
title: "List dbt environments"
method: GET
path: "/api/v1/connections/{connectionId}/dbt/environments"
tags: ["Connections"]
---

# List dbt environments

`GET /api/v1/connections/{connectionId}/dbt/environments`

List all dbt environments for a connection.

## Path parameters

- `connectionId` string, uuid, required — Connection ID

## Query parameters

- `cursor` string — Cursor for pagination (from previous response nextCursor)
- `pageSize` integer — Number of results per page (1-100, integer)
- `sortDirection` 'asc' | 'desc' — Sort direction for results
- `sortField` 'name' — Field to sort results by

## Response `200`

List of dbt environments

- DbtEnvironmentListResponse
  - `pageInfo` PageInfo, required
    - `hasNextPage` boolean, required — Whether more results are available
    - `nextCursor` string, nullable, required — Cursor for fetching the next page
    - `pageSize` number, required — Number of results per page
    - `totalRecords` number, required — Total number of records matching the query
  - `records` DbtEnvironmentItem[], required
    - `id` string, uuid, required — Unique environment identifier
    - `isDefaultEnvironment` boolean, required — Whether this is the default environment
    - `isDeferralEnabled` boolean, required — Whether dbt deferral is enabled for this environment. Always false for the default (production) environment — the backend rejects enabling it there.
    - `name` string, required — Environment name
    - `ownerId` string, nullable, required — User ID of the environment owner, or null if not a personal environment
    - `targetDatabase` string, nullable, required — Target database override
    - `targetName` string, nullable, required — Target name override
    - `targetRole` string, nullable, required — Target role override
    - `targetSchema` string, required — Target schema
    - `variables` DbtEnvironmentResponseVariable[], required — Environment variables
      - `id` string, uuid, required — Variable ID
      - `isSecret` boolean, required — Whether the variable value is secret
      - `name` string, required — Variable name
      - `value` string, nullable, required — Variable value (null for secret variables)

## Other responses

- `401` — Authentication required
- `403` — Permission denied or connection does not support dbt
- `404` — Connection not found

---

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