v1

latestOpenAPI 3.1.12026-08-063445179.6 KB
layers

Create layer

Create a new layer.

post/v2/layers

Request body

slugstring required

Human-readable layer slug

descriptionstring

Optional description of the layer's purpose

Example request

{
  "env_vars": [
    {
      "key": "DATABASE_URL",
      "value": "postgres://localhost/dev"
    }
  ]
}

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"
}