---
title: "Get layer"
method: GET
path: "/v2/layers/{layer}"
tags: ["layers"]
---

# Get layer

`GET /v2/layers/{layer}`

Get a layer by ID or slug.

Slugs cannot contain underscores; IDs always do.

## Path parameters

- `layer` string, required

## Response `200`

OK

- Layer
  - `id` string, required — Unique layer identifier
  - `slug` string, required — Human-readable layer slug
  - `description` string — Optional description of the layer's purpose
  - `layers` LayerRef[], required — Base layers included by this layer, in priority order (later overrides earlier). The including layer's own env vars take precedence over all its bases
    - `id` string, required — Unique layer identifier
    - `slug` string, required — Human-readable layer slug
  - `env_vars` EnvVar[], required — Environment variables defined in this layer
    - `id` string, required — Unique identifier for the environment variable
    - `key` string, required — The environment variable name
    - `value` string — The value. Omitted when `secret` is true
    - `secret` boolean, required — Whether the value is masked in API responses
    - `contexts` union, required — Deployment contexts this variable applies to. `"all"` means every context.
      - 'all'
      - string[]
  - `app_count` integer, required — Number of apps that reference this layer
  - `created_at` string, required — ISO 8601 timestamp of creation
  - `updated_at` string, required — ISO 8601 timestamp of last modification

---

[API](https://skmtc.net/deno/apis/deploy.md) · [All operations](https://skmtc.net/deno/apis/deploy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deno/deploy/versions/5a56038d108e/schema)
