v1

latestOpenAPI 3.1.12026-08-063445179.6 KB
layers

Update layer

Update a layer. This is the key operation for bulk environment variable updates.

All fields are optional. env_vars performs a deep merge with existing variables: update by ID, update by key+contexts match, or create new. Set delete: true to remove a variable.

Running isolates will restart to pick up the new configuration.

patch/v2/layers/{layer}

Path parameters

layerstring required

Layer ID or slug. Slugs cannot contain underscores; IDs always do.

Request body

slugstring

New layer slug

descriptionstring

New description

Example request

{
  "env_vars": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "value": "postgres://prod-host/db"
    }
  ]
}

Response

OK

idstring required

Unique layer identifier

slugstring required

Human-readable layer slug

descriptionstring

Optional description of the layer's purpose

app_countinteger required

Number of apps that reference this layer

created_atstring required

ISO 8601 timestamp of creation

updated_atstring required

ISO 8601 timestamp of last modification

Example response

{
  "id": "lyr_abc123",
  "slug": "shared-secrets",
  "description": "Common API keys and secrets for all customer apps",
  "layers": [
    {
      "id": "lyr_base123",
      "slug": "base-config"
    }
  ],
  "env_vars": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "key": "DATABASE_URL",
      "value": "postgres://host/db",
      "secret": false,
      "contexts": "all"
    },
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "key": "API_SECRET",
      "secret": true,
      "contexts": "all"
    }
  ],
  "app_count": 42,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}