---
title: "GET /secrets/{id}"
method: GET
path: "/secrets/{id}"
---

# GET /secrets/{id}

`GET /secrets/{id}`

Inspect a secret

## Path parameters

- `id` string, required

## Response `200`

The request has succeeded.

- Secret
  - `ID` string
  - `Version` ObjectVersion — The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects. This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other.
    - `Index` integer
  - `CreatedAt` string, date-time
  - `UpdatedAt` string, date-time
  - `Spec` SecretSpec
    - `Name` string — User-defined name of the secret.
    - `Labels` object — User-defined key/value metadata.
    - `Data` string — Data is the data to store as a secret, formatted as a standard base64-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2
    - `Driver` Driver — Driver represents a driver (network, logging, secrets).
      - `Name` string, required — Name of the driver.
      - `Options` object — Key/value map of driver-specific options.
    - `Templating` Driver — Driver represents a driver (network, logging, secrets).
      - `Name` string, required — Name of the driver.
      - `Options` object — Key/value map of driver-specific options.

---

[API](https://skmtc.net/hexlet/apis/docker-engine-api.md) · [All operations](https://skmtc.net/hexlet/apis/docker-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hexlet/docker-engine-api/versions/7dbd508c79cf/schema)
