Secrets

get

List available environment secrets for the user's organization

🔒 Requires the read:environment permission

Authorizations
Query parameters
sortstring · enumOptional

Specifies the attribute by which the returned list should be sorted ' + 'e.g. name

Default: created_atPossible values:
orderstringOptional

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

offsetnumberOptional

Results offset to allow pagination e.g. 10

Default: 0Example: 10
limitnumberOptional

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 Secret Keys that match a particular query e.g. api_key

Responses
200

List of available environment secrets

application/json
get
/api/v1/environment/settings/secrets
GET /api/v1/environment/settings/secrets HTTP/1.1
Host: api.bricks-dev.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "total": 1,
  "list": [
    {
      "name": "API_TOKEN",
      "environment": {
        "id": "f27d96be-c486-4075-a926-0ee96775119e",
        "slug": "production-europe",
        "name": "Production Europe",
        "color": "#0000ff",
        "is_default": true,
        "is_active": true,
        "created": "2025-11-11T06:41:08.610Z",
        "cloud_account": null
      },
      "created_at": "2025-11-11T06:41:08.610Z",
      "updated_at": null,
      "created_by": {
        "id": "prov0|1234567890",
        "name": "John Doe",
        "nickname": "JD",
        "picture": "https://example.com/profile.jpg"
      }
    }
  ],
  "filters": {
    "environments": [
      {
        "id": "f27d96be-c486-4075-a926-0ee96775119e",
        "name": "Production Europe",
        "slug": "production-europe",
        "color": "#0000ff"
      }
    ],
    "users": [
      {
        "id": "prov0|1234567890",
        "name": "John Doe",
        "nickname": "JD",
        "picture": "https://example.com/profile.jpg"
      }
    ]
  }
}
get

List environment secrets

🔒 Requires the read:secret permission

Authorizations
Path parameters
idOrSlugstringRequired

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

Example: production-europe
Responses
200

List of environment secrets

application/json
get
/api/v1/environment/{idOrSlug}/settings/secrets
GET /api/v1/environment/{idOrSlug}/settings/secrets HTTP/1.1
Host: api.bricks-dev.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "environment": {
    "guid": "f27d96be-c486-4075-a926-0ee96775119e",
    "slug": "production-europe"
  },
  "secrets": [
    {
      "key": "API_TOKEN",
      "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
    }
  ]
}
post

Create environment secrets

🔒 Requires the create:secret permission

Authorizations
Path parameters
idOrSlugstringRequired

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

Example: production-europe
Bodyobject · Key-ValueSecretpair[]

List of new environment-scoped secrets

keystringRequired

The secret key e.g. API_TOKEN

Example: API_TOKEN
valuestringRequired

The secret encrypted value e.g. ERJZ7ZOJcNpQEAvrb6wPOA==

Example: ERJZ7ZOJcNpQEAvrb6wPOA==
Responses
200

Updated environment secrets

application/json
post
/api/v1/environment/{idOrSlug}/settings/secrets
POST /api/v1/environment/{idOrSlug}/settings/secrets HTTP/1.1
Host: api.bricks-dev.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 56

[
  {
    "key": "API_TOKEN",
    "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
  }
]
{
  "environment": {
    "guid": "f27d96be-c486-4075-a926-0ee96775119e",
    "slug": "production-europe"
  },
  "secrets": [
    {
      "key": "API_TOKEN",
      "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
    }
  ]
}
put

Update environment secrets

🔒 Requires the update:secret permission

Authorizations
Path parameters
idOrSlugstringRequired

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

Example: production-europe
Bodyobject · Key-ValueSecretpair[]

List of updated environment-scoped secrets

keystringRequired

The secret key e.g. API_TOKEN

Example: API_TOKEN
valuestringRequired

The secret encrypted value e.g. ERJZ7ZOJcNpQEAvrb6wPOA==

Example: ERJZ7ZOJcNpQEAvrb6wPOA==
Responses
200

Updated environment secrets

application/json
put
/api/v1/environment/{idOrSlug}/settings/secrets
PUT /api/v1/environment/{idOrSlug}/settings/secrets HTTP/1.1
Host: api.bricks-dev.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 56

[
  {
    "key": "API_TOKEN",
    "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
  }
]
{
  "environment": {
    "guid": "f27d96be-c486-4075-a926-0ee96775119e",
    "slug": "production-europe"
  },
  "secrets": [
    {
      "key": "API_TOKEN",
      "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
    }
  ]
}
delete

Delete environment secrets

🔒 Requires the delete:secret permission

Authorizations
Path parameters
idOrSlugstringRequired

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

Example: production-europe
Bodystring[]
string[]Optional

List of secret keys to delete within the environment

Responses
200

Updated environment secrets

application/json
delete
/api/v1/environment/{idOrSlug}/settings/secrets
DELETE /api/v1/environment/{idOrSlug}/settings/secrets HTTP/1.1
Host: api.bricks-dev.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "environment": {
    "guid": "f27d96be-c486-4075-a926-0ee96775119e",
    "slug": "production-europe"
  },
  "secrets": [
    {
      "key": "API_TOKEN",
      "value": "ERJZ7ZOJcNpQEAvrb6wPOA=="
    }
  ]
}

Last updated

Was this helpful?