Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Envs

post

Create a new environment or start run for existing environment

🔒 Requires the create:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
environmentSlugstringRequired

The environment slug for creating or targeting existing environment

blueprintstringOptional

The blueprint/package name, e.g. @bluebricks/postgres

versionstringOptional

The package version e.g. 1.2.3

Example: 1.2.3
deployTypestring · enumOptional

Controls how the deployment is executed. autoApply automatically applies changes without manual approval; autoApprove skips approval and pending; validateOnly validates the deployment without executing; planOnly generates a plan without executing; driftDetection runs only configuration-drift detection; draft creates the deployment record without starting any activity. autoRemediation automatically remediates detected drifts; deployType can't be used together with deprecated flags.

Example: autoApprovePossible values:
forcebooleanOptionalDeprecated

Deprecated. Use deployType='autoApprove' instead

validateOnlybooleanOptionalDeprecated

Deprecated. Use deployType='validateOnly' instead

Default: false
planOnlybooleanOptionalDeprecated

Deprecated. Use deployType='planOnly' instead

Default: false
incrementalbooleanOptional

Enable incremental mode to skip deployments with no changes

Default: false
noActivitybooleanOptionalDeprecated

Deprecated. Use deployType='draft' instead

Default: false
driftDetectionbooleanOptionalDeprecated

Deprecated. Use deployType='driftDetection' instead

Default: false
isDriftDetectionEnabledbooleanOptional

Enable drift detection for the environment

Default: false
collectionstringOptional

Target collection for environment

Responses
200

Created environment and task details or validation result

application/json

Created environment and task details or validation result

or
post/api/v1/env/create
POST /api/v1/env/create HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "environmentSlug": "text",
  "blueprint": "text",
  "version": "1.2.3",
  "deployType": "autoApprove",
  "incremental": false,
  "isDriftDetectionEnabled": false,
  "collection": "text",
  "props": {
    "password": "$postgres.prodPass"
  }
}
{
  "environment": "text",
  "activity_id": "123e4567-e89b-12d3-a456-426614174000",
  "task": "123e4567-e89b-12d3-a456-426614174000"
}
get

Get an existing environment from a git repository

🔒 Requires the read:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
environmentIdOrSlugstringRequired

Environment ID or slug

Responses
200

Environment retrieved successfully

application/json

Environment retrieved successfully

environmentstringOptional

The environment's slug e.g. my-environment

auto_triggerbooleanOptional

Indicates whether the environment is set to automatically trigger deployments on git events

Example: true
git_remote_urlstringOptional

Git repository URL

Example: https://github.com/org/repo
git_subdir_pathstringOptional

Path to the subdirectory within the repository

Example: /infra/prod/vpc
git_base_branchstringOptional

Base git branch name that the environment listens to for events

Example: main
package_namestringOptional

Name of the package

Example: @bluebricks/vpc
collection_slugstringOptional

Slug of the collection

Example: production
iac_typestring · enumOptional

Infrastructure as Code tool type

Example: terraformPossible values:
get/api/v1/env/{environmentIdOrSlug}/git
GET /api/v1/env/{environmentIdOrSlug}/git HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "environment": "text",
  "auto_trigger": true,
  "git_remote_url": "https://github.com/org/repo",
  "git_subdir_path": "/infra/prod/vpc",
  "git_base_branch": "main",
  "package_name": "@bluebricks/vpc",
  "collection_slug": "production",
  "iac_type": "terraform"
}
post

Create a new environment from a git repository with automatic deployment triggers on git events. This endpoint creates an environment that listens to push and pull request events where the base branch matches git_base_branch. Push events trigger install deployments. Pull request events always trigger plan-only tasks.

🔒 Requires the create:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
git_remote_urlstringRequired

Git repository URL

Example: https://github.com/org/repo
git_base_branchstringRequired

Base git branch name. Environment will trigger deployments on push events and pull requests targeting this branch.

Example: main
git_subdir_pathstringOptional

Path to the subdirectory within the repository

Example: /infra/prod/vpc
environment_slugstringRequired

The environment's slug e.g. my-environment

collectionstringRequired

The collection's slug or ID e.g. prod | f27d96be-c486-4075-a926-0ee96775119d

Example: production-europe
iac_typestring · enumRequired

Infrastructure as Code tool type

Example: terraformPossible values:
package_namestringRequired

Name of the package

Example: @bluebricks/vpc
package_descriptionstringOptional

Optional description for the package

Responses
200

Environment creation started successfully

application/json

Environment creation started successfully

event_idstringOptional

Event ID tracking the async publisher job. Only present when a new package needs to be hydrated.

environment_slugstringRequired

Environment slug

post/api/v1/env/git
POST /api/v1/env/git HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 253

{
  "git_remote_url": "https://github.com/org/repo",
  "git_base_branch": "main",
  "git_subdir_path": "/infra/prod/vpc",
  "environment_slug": "text",
  "collection": "production-europe",
  "iac_type": "terraform",
  "package_name": "@bluebricks/vpc",
  "package_description": "text"
}
{
  "event_id": "text",
  "environment_slug": "text"
}
get

Retrieve all deployment states for an environment

🔒 Requires the read:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
environmentIdOrSlugstringRequired

Environment ID or slug

Responses
200

List of environment states with metadata

application/json

List of environment states with metadata

state_idstringRequired

The unique identifier of the state

Example: 123e4567-e89b-12d3-a456-426614174000
package_idstringRequired

The unique identifier of the package

Example: terraform_aws_secretsmanager
hierarchical_pathstring · nullableOptional

The hierarchical path of the package in the deployment

Example: root.terraform_aws_secretsmanager
statusstring · enumRequired

The current status of the deployment state. Returns "n/a" when metadata is not available

Example: livePossible values:
run_idstring · nullableRequired

ID of the latest run that created/updated the state. Returns "n/a" when metadata is not available

Example: run-abc123
lockedbooleanRequired

Whether the state is currently locked

Example: false
created_atstring · nullableRequired

When the state was first created. Returns "n/a" when metadata is not available

Example: 2025-10-10T12:34:56.123Z
updated_atstring · nullableRequired

When the state was last updated

Example: 2025-10-12T08:20:00.456Z
iac_typestring · enumRequired

The IaC type for this package

Example: terraformPossible values:
versionstringRequired

The package version associated with this state

Example: 1.0.0
get/api/v1/env/{environmentIdOrSlug}/states
GET /api/v1/env/{environmentIdOrSlug}/states HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "state_id": "123e4567-e89b-12d3-a456-426614174000",
    "package_id": "terraform_aws_secretsmanager",
    "hierarchical_path": "root.terraform_aws_secretsmanager",
    "status": "live",
    "run_id": "run-abc123",
    "locked": false,
    "created_at": "2025-10-10T12:34:56.123Z",
    "updated_at": "2025-10-12T08:20:00.456Z",
    "iac_type": "terraform",
    "version": "1.0.0",
    "updated_by": {
      "id": "prov0|1234567890",
      "name": "John Doe",
      "email": "johndoe@mail.com",
      "picture": "https://example.com/profile.jpg"
    }
  }
]
get

Return environments information by collection

🔒 Requires the read:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
collectionIdstring · uuidOptional

The collection's ID e.g. f27d96be-c486-4075-a926-0ee96775119e

Example: f27d96be-c486-4075-a926-0ee96775119e
sortstring · enumOptional

Specifies the attribute by which the returned list should be sorted

Default: timestampPossible values:
offsetnumberOptional

Results offset to allow pagination e.g. 10

Default: 0Example: 10
orderstringOptional

Specifies the order - ascending or descending - by which the returned list should be sorted e.g. ASC

limitnumber · min: 3 · max: 1000Optional

Results limit to allow pagination, e.g. 50

Default: 20Example: 10
filterstringOptional

Structure: [key1=value1,key2=value2&value3]

searchstringOptional

Enables searching within the list for environment names that match a particular query

archivedbooleanOptional

Also includes archived environments

outdatedbooleanOptional

If true, return only environments with outdated package versions

Responses
200

Paginated information of filtered environments for a collection

application/json

Paginated information of filtered environments for a collection

totalnumberRequired
has_outdatedbooleanOptional

Indicates if any outdated environments exist

statsone ofRequired
or
get/api/v1/envs
GET /api/v1/envs HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "total": 1,
  "has_outdated": true,
  "stats": {
    "live": 1,
    "drafts": 1,
    "creating": 1,
    "creation_failed": 1
  },
  "list": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "slug": "text",
      "package": "@bluebricks/aws-vpc",
      "package_type": "blueprint",
      "deployed_version": "1.2.3",
      "outdated_package": true,
      "state_status": "installed",
      "is_archived": true,
      "is_drifted": true,
      "is_drift_detection_enabled": true,
      "drift_detection_interval_seconds": null,
      "collection": {
        "id": "f27d96be-c486-4075-a926-0ee96775119e",
        "slug": "production-europe",
        "name": "Production Europe",
        "color": "#0000ff",
        "allow_pre_release": false,
        "is_default": true,
        "enabled_policies": [
          "require_owner_approval"
        ],
        "is_active": true,
        "is_deleted": true,
        "created": "2026-01-01T00:00:00.000Z",
        "users": [
          {
            "id": "prov0|1234567890",
            "name": "John Doe",
            "email": "johndoe@mail.com",
            "nickname": "JD",
            "picture": "https://example.com/profile.jpg",
            "roles": [
              {
                "id": "rol_abCdeFghIjklMnmP",
                "name": "Admin",
                "description": "Role for managing Admin permissions"
              }
            ],
            "membership_role": "member"
          }
        ],
        "cloud_account": {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "Production Europe",
          "provider": "aws",
          "type": "execution",
          "slug": "production-europe",
          "is_active": true,
          "is_deleted": false,
          "created": "2026-01-01T00:00:00.000Z",
          "cloud_account": "123456789012",
          "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
          "external_id": "abcdef-ghijklm",
          "cloud_config": {
            "execution": {
              "service_account_email": "sa@project_id.iam.gserviceaccount.com",
              "scopes": "https://www.googleapis.com/auth/cloud-platform",
              "tenant_id": "text",
              "subscription_id": "text",
              "federated_app_client_id": "text",
              "oidc_issuer_url": "https://example.com",
              "oidc_audience": "text",
              "cluster_name": "text",
              "service_account_namespace": "text",
              "service_account_name": "text",
              "cluster_oidc_url": "https://example.com",
              "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
              "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123"
            },
            "discovery": {
              "service_account_email": "sa@project_id.iam.gserviceaccount.com",
              "scopes": "https://www.googleapis.com/auth/cloud-platform",
              "tenant_id": "text",
              "subscription_id": "text",
              "federated_app_client_id": "text",
              "oidc_issuer_url": "https://example.com",
              "oidc_audience": "text",
              "cluster_name": "text",
              "service_account_namespace": "text",
              "service_account_name": "text",
              "cluster_oidc_url": "https://example.com",
              "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
              "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123"
            },
            "service_account_email": "sa@project_id.iam.gserviceaccount.com",
            "scopes": "https://www.googleapis.com/auth/cloud-platform",
            "tenant_id": "text",
            "subscription_id": "text",
            "federated_app_client_id": "text",
            "oidc_issuer_url": "https://example.com",
            "oidc_audience": "text",
            "cluster_name": "text",
            "service_account_namespace": "text",
            "service_account_name": "text",
            "cluster_oidc_url": "https://example.com",
            "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
            "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "types": [
            "execution"
          ],
          "is_primary": true,
          "profile": "secrets-manager"
        },
        "discovery_cloud_account": {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "Production Europe",
          "provider": "aws",
          "type": "execution",
          "slug": "production-europe",
          "is_active": true,
          "is_deleted": false,
          "created": "2026-01-01T00:00:00.000Z",
          "cloud_account": "123456789012",
          "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
          "external_id": "abcdef-ghijklm",
          "cloud_config": {
            "execution": {
              "service_account_email": "sa@project_id.iam.gserviceaccount.com",
              "scopes": "https://www.googleapis.com/auth/cloud-platform",
              "tenant_id": "text",
              "subscription_id": "text",
              "federated_app_client_id": "text",
              "oidc_issuer_url": "https://example.com",
              "oidc_audience": "text",
              "cluster_name": "text",
              "service_account_namespace": "text",
              "service_account_name": "text",
              "cluster_oidc_url": "https://example.com",
              "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
              "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123"
            },
            "discovery": {
              "service_account_email": "sa@project_id.iam.gserviceaccount.com",
              "scopes": "https://www.googleapis.com/auth/cloud-platform",
              "tenant_id": "text",
              "subscription_id": "text",
              "federated_app_client_id": "text",
              "oidc_issuer_url": "https://example.com",
              "oidc_audience": "text",
              "cluster_name": "text",
              "service_account_namespace": "text",
              "service_account_name": "text",
              "cluster_oidc_url": "https://example.com",
              "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
              "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123"
            },
            "service_account_email": "sa@project_id.iam.gserviceaccount.com",
            "scopes": "https://www.googleapis.com/auth/cloud-platform",
            "tenant_id": "text",
            "subscription_id": "text",
            "federated_app_client_id": "text",
            "oidc_issuer_url": "https://example.com",
            "oidc_audience": "text",
            "cluster_name": "text",
            "service_account_namespace": "text",
            "service_account_name": "text",
            "cluster_oidc_url": "https://example.com",
            "assume_role_arn": "arn:aws:iam::123456789012:role/Bluebricks-Setup-BluebricksReadOnlyRole-123abc456DEF",
            "cloud_formation_stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/bluebricks-setup/abcde12345-6789-0123-4567-89abcdef0123",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "types": [
            "execution"
          ]
        }
      },
      "git_info": {
        "provider": "text",
        "base_branch": "text",
        "repository": "text",
        "head_branch": "text",
        "git_user_name": "text",
        "git_org": "text",
        "commit_link": "text",
        "pr_link": null
      },
      "status_message": null,
      "latest_activity": {
        "deployment": "123e4567-e89b-12d3-a456-426614174000",
        "task": "123e4567-e89b-12d3-a456-426614174000",
        "package_version": "1.2.3",
        "stage": "pending",
        "timestamp": "2026-01-01T00:00:00.000Z",
        "is_uninstall": true,
        "is_plan_only": true,
        "drift_detection": true,
        "user": {
          "id": "prov0|1234567890",
          "name": "John Doe",
          "nickname": "JD",
          "picture": "https://example.com/profile.jpg",
          "email": "johndoe@mail.com"
        }
      }
    }
  ]
}
post

Archive multiple environments

🔒 Requires the update:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Bodystring[]
string[]Optional

List of environment slugs, e.g. ["test-environment", "my-environment"]

Example: ["test-environment","my-environment"]
Responses
200

Environment archived / unarchived successfully

application/json

Environment archived / unarchived successfully

environmentstringRequired

The environment's slug e.g. my-environment

archivedbooleanRequired

Updated archived status

post/api/v1/envs/archive
POST /api/v1/envs/archive HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 37

[
  "test-environment",
  "my-environment"
]
[
  {
    "environment": "text",
    "archived": true
  }
]
post

Unarchive multiple environments

🔒 Requires the update:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Bodystring[]
string[]Optional

List of environment slugs, e.g. ["test-environment", "my-environment"]

Example: ["test-environment","my-environment"]
Responses
200

Environment archived / unarchived successfully

application/json

Environment archived / unarchived successfully

environmentstringRequired

The environment's slug e.g. my-environment

archivedbooleanRequired

Updated archived status

post/api/v1/envs/unarchive
POST /api/v1/envs/unarchive HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 37

[
  "test-environment",
  "my-environment"
]
[
  {
    "environment": "text",
    "archived": true
  }
]
post

Enable drift detection for multiple environments

🔒 Requires the update:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Bodystring[]
string[]Optional

List of environment slugs, e.g. ["test-environment", "my-environment"]

Example: ["test-environment","my-environment"]
Responses
200

Environment drift detection status updated successfully

application/json

Environment drift detection status updated successfully

environmentstringRequired

The environment's slug e.g. my-environment

is_drift_detection_enabledbooleanRequired

Updated drift detection status

post/api/v1/envs/enable-drift-detection
POST /api/v1/envs/enable-drift-detection HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 37

[
  "test-environment",
  "my-environment"
]
[
  {
    "environment": "text",
    "is_drift_detection_enabled": true
  }
]
post

Disable drift detection for multiple environments

🔒 Requires the update:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Bodystring[]
string[]Optional

List of environment slugs, e.g. ["test-environment", "my-environment"]

Example: ["test-environment","my-environment"]
Responses
200

Environment drift detection status updated successfully

application/json

Environment drift detection status updated successfully

environmentstringRequired

The environment's slug e.g. my-environment

is_drift_detection_enabledbooleanRequired

Updated drift detection status

post/api/v1/envs/disable-drift-detection
POST /api/v1/envs/disable-drift-detection HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 37

[
  "test-environment",
  "my-environment"
]
[
  {
    "environment": "text",
    "is_drift_detection_enabled": true
  }
]
post

Upload state files to environment

🔒 Requires the create:environment permission

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
environmentIdOrSlugstringRequired

Environment ID or slug

Body
statesstringRequired

JSON string containing array of state metadata with file references. Each item must have either package_id (for unique packages) or hierarchical_path (for packages that appear at multiple positions in the blueprint tree, e.g., bpA.bpB.mypackageid).

Example: [{"package_id":"terraform_aws_secretsmanager","state_file":"state_1"},{"hierarchical_path":"sub_blueprint.terraform_aws_eks_auto","state_file":"state_2"}]
versionstringOptional

Optional blueprint version to use for resolving the package tree. If not provided, the latest published version is used.

Example: 1.0.0
Other propertiesanyOptional
Responses
200

State upload results

application/json

State upload results

package_idstringRequired

Package identifier

Example: terraform_aws_secretsmanager
hierarchical_pathstringOptional

Full hierarchical path of the package in the blueprint tree (e.g., root.bpA.bpB.mypackageid)

Example: root.terraform_aws_secretsmanager
statusstring · enumRequired

Upload status

Example: successPossible values:
reasonstringOptional

Reason for failure (only present when status is failed)

post/api/v1/envs/{environmentIdOrSlug}/states
POST /api/v1/envs/{environmentIdOrSlug}/states HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 238

{
  "states": "[{\"package_id\":\"terraform_aws_secretsmanager\",\"state_file\":\"state_1\"},{\"hierarchical_path\":\"sub_blueprint.terraform_aws_eks_auto\",\"state_file\":\"state_2\"}]",
  "version": "1.0.0",
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
[
  {
    "package_id": "terraform_aws_secretsmanager",
    "hierarchical_path": "root.terraform_aws_secretsmanager",
    "status": "success",
    "reason": "text"
  }
]

Last updated