---
title: "POST /api/v3/accounts/{account_id}/projects/{project_id}/environments/"
method: POST
path: "/api/v3/accounts/{account_id}/projects/{project_id}/environments/"
tags: ["Environments"]
---

# POST /api/v3/accounts/{account_id}/projects/{project_id}/environments/

`POST /api/v3/accounts/{account_id}/projects/{project_id}/environments/`

## Request

- Base URL: `https://cloud.getdbt.com`
- URL: `https://cloud.getdbt.com/api/v3/accounts/{account_id}/projects/{project_id}/environments/`
- Auth: HTTP bearer

Create a new Environment

## Path parameters

- `account_id` integer, required
- `project_id` integer, required

## Request body

- EnvironmentV3Request
  - `account_id` integer, required: The account the environment is associated with
  - `project_id` integer, required: The project the environment is associated with
  - `credentials_id` integer: The id of the associated credentials. Null for development environments. Must be included when updating a deployment environment or the value will be reset to null.
  - `connection_id` integer: The id of the associated connection. Must be included when updating an environment or the value will be reset to null.
  - `extended_attributes_id` integer
  - `name` string, required: The name of the environment
  - `dbt_version` string, required: The default dbt Version to use for this environment
  - `type` 'development' | 'deployment', required: * `development` - DEVELOPMENT * `deployment` - DEPLOYMENT
  - `use_custom_branch` boolean, required
  - `custom_branch` string
  - `supports_docs` boolean, required
  - `deployment_type` 'production' | 'staging': * `production` - production * `staging` - staging
  - `enable_model_query_history` boolean
  - `enable_dbt_state` boolean
  - `enable_dbt_state_model_lock` boolean, required
  - `state` integer, required: A value of 1 means this entity is active and a value of 2 means this entity is deleted
  - `primary_profile_id` integer: The id of the primary profile for this environment

## Response `200`

- EnvironmentV3Enveloped
  - `data` EnvironmentV3Response, required
    - `id` integer, required
    - `account_id` integer: The account the environment is associated with
    - `project_id` integer: The project the environment is associated with
    - `credentials_id` integer: The id of the associated credentials. Null for development environments. Must be included when updating a deployment environment or the value will be reset to null.
    - `connection_id` integer: The id of the associated connection. Must be included when updating an environment or the value will be reset to null.
    - `extended_attributes_id` integer
    - `name` string: The name of the environment
    - `dbt_version` string: The default dbt Version to use for this environment
    - `raw_dbt_version` string, required
    - `type` 'development' | 'deployment': * `development` - DEVELOPMENT * `deployment` - DEPLOYMENT
    - `use_custom_branch` boolean
    - `custom_branch` string
    - `supports_docs` boolean
    - `deployment_type` 'production' | 'staging': * `production` - production * `staging` - staging
    - `is_deferrable` boolean, required
    - `enable_model_query_history` boolean
    - `enable_dbt_state` boolean
    - `enable_dbt_state_model_lock` boolean
    - `state` integer: A value of 1 means this entity is active and a value of 2 means this entity is deleted
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `project` Project, required
      - `name` string, required: The name of the project
      - `account_id` integer, required: The account the project is associated with
      - `description` string: The description of the project
      - `connection_id` integer: The active connection
      - `repository_id` integer: The active repository
      - `semantic_layer_config_id` integer: The active semantic layer configuration
      - `state` integer, required: A value of 1 means this entity is active and a value of 2 means this entity is deleted
      - `dbt_project_subdirectory` string: The path in the associated repository where a dbt project can be found
      - `docs_job_id` integer: The job used for docs generation
      - `freshness_job_id` integer: The job used for source freshness generation
      - `type` 0 | 1, required: * `0` - DEFAULT * `1` - HYBRID
    - `primary_profile_id` integer: The id of the primary profile for this environment
    - `credentials` PostgresCredentials, required
      - `account_id` integer, required
      - `project_id` integer
      - `type` 'postgres' | 'redshift' | 'snowflake' | 'bigquery' | 'adapter', required: * `postgres` - postgres * `redshift` - redshift * `snowflake` - snowflake * `bigquery` - bigquery * `adapter` - adapter
      - `state` integer, required: A value of 1 means this entity is active and a value of 2 means this entity is deleted
      - `threads` integer, required
      - `username` string, required
      - `default_schema` string, required
      - `target_name` string, required
      - `adapter_version` 'apache_spark_v0' | 'databricks_spark_v0' | 'databricks_v0' | 'trino_v0' | 'snowflake_v0' | 'bigquery_v0' | 'bigquery_v1' | 'postgres_v0' | 'redshift_v0' | 'salesforce_v0' | 'synapse_v0' | 'fabric_v0' | 'athena_v0' | 'teradata_v0' | 'clickhouse_v0': * `apache_spark_v0` - apache_spark_v0 * `databricks_spark_v0` - databricks_spark_v0 * `databricks_v0` - databricks_v0 * `trino_v0` - trino_v0 * `snowflake_v0` - snowflake_v0 * `bigquery_v0` - bigquery_v0 * `bigquery_v1` - bigquery_v1 * `postgres_v0` - postgres_v0 * `redshift_v0` - redshift_v0 * `salesforce_v0` - salesforce_v0 * `synapse_v0` - synapse_v0 * `fabric_v0` - fabric_v0 * `athena_v0` - athena_v0 * `teradata_v0` - teradata_v0 * `clickhouse_v0` - clickhouse_v0
    - `fusion_readiness` unknown, required
  - `status` ResponseStatus, required
    - `code` integer: HTTP status code
    - `is_success` boolean, required: Whether the request was successful or not
    - `user_message` string, required: End-user friendly success or error message
    - `developer_message` string, required: Developer friendly success or error message

## Changes

- **2026-10-28** (v3) `e32fbfcdc9ec`: 3 breaking, 1 info
  - added the new required request property `enable_dbt_state_model_lock` (media type: application/json)
  - added the new required request property `enable_dbt_state_model_lock` (media type: application/x-www-form-urlencoded)
  - added the new required request property `enable_dbt_state_model_lock` (media type: multipart/form-data)
  - added the optional property `data/enable_dbt_state_model_lock` to the response with the `200` status
- **2026-10-06** (v3) `7d5c1b4c8d8a`: 2 breaking
  - for the `path` request parameter `account_id`, the format changed from no format to `int64`
  - for the `path` request parameter `project_id`, the format changed from no format to `int64`
- **2026-09-29** (v3) `6b5199f1f0c8`: 1 warning
  - added the new `clickhouse_v0` enum value to the `data/credentials/allOf[#/components/schemas/PostgresCredentials]/adapter_version/allOf[#/components/schemas/AdapterVersionEnum]/` response property for the response status `200`
- **2026-06-12** (v3) `35ed07b14344`: 4 info
  - added the new optional request property `enable_dbt_state` (media type: application/json)
  - added the new optional request property `enable_dbt_state` (media type: application/x-www-form-urlencoded)
  - added the new optional request property `enable_dbt_state` (media type: multipart/form-data)
  - added the optional property `data/enable_dbt_state` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/changes/api/v3/accounts/:account_id/projects/:project_id/environments/post.md)

---

[API](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2.md) - [All operations](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/revisions/2448b375ac2f?raw)
