# List secrets


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





`GET /secrets`



## Connection and access

[API connection and authentication guidance](/reference/api/engine/version/v1.57/#connection)


Server: `/v1.57`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
null
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/json' \
  'http://localhost/v1.57/secrets'
```



## Parameters

### filters

Location: query. Required: no.

A JSON encoded value of the filters (a `map[string][]string`) to
process on the secrets list.

Available filters:

- `id=<secret id>`
- `label=<key> or label=<key>=value`
- `name=<secret name>` matches all or part of a secret name (prefix match)
- `names=<secret name>` matches a secret name (exact match)


```json
{
  "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=\u003csecret id\u003e`\n- `label=\u003ckey\u003e or label=\u003ckey\u003e=value`\n- `name=\u003csecret name\u003e` matches all or part of a secret name (prefix match)\n- `names=\u003csecret name\u003e` matches a secret name (exact match)\n",
  "in": "query",
  "name": "filters",
  "pointer": "/paths/~1secrets/get/parameters/0",
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

no error


Schema:

```json
{
  "example": [
    {
      "CreatedAt": "2017-07-20T13:55:28.678958722Z",
      "ID": "blt1owaxmitz71s9v5zh81zun",
      "Spec": {
        "Driver": {
          "Name": "secret-bucket",
          "Options": {
            "OptionA": "value for driver option A",
            "OptionB": "value for driver option B"
          }
        },
        "Labels": {
          "some.label": "some.value"
        },
        "Name": "mysql-passwd"
      },
      "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
      "Version": {
        "Index": 85
      }
    },
    {
      "CreatedAt": "2016-11-05T01:20:17.327670065Z",
      "ID": "ktnbjxoalbkvbvedmg1urrz8h",
      "Spec": {
        "Labels": {
          "foo": "bar"
        },
        "Name": "app-dev.crt"
      },
      "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
      "Version": {
        "Index": 11
      }
    }
  ],
  "items": {
    "$ref": "#/components/schemas/Secret"
  },
  "type": "array"
}
```









Schema example:
```json
[
  {
    "CreatedAt": "2017-07-20T13:55:28.678958722Z",
    "ID": "blt1owaxmitz71s9v5zh81zun",
    "Spec": {
      "Driver": {
        "Name": "secret-bucket",
        "Options": {
          "OptionA": "value for driver option A",
          "OptionB": "value for driver option B"
        }
      },
      "Labels": {
        "some.label": "some.value"
      },
      "Name": "mysql-passwd"
    },
    "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
    "Version": {
      "Index": 85
    }
  },
  {
    "CreatedAt": "2016-11-05T01:20:17.327670065Z",
    "ID": "ktnbjxoalbkvbvedmg1urrz8h",
    "Spec": {
      "Labels": {
        "foo": "bar"
      },
      "Name": "app-dev.crt"
    },
    "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
    "Version": {
      "Index": 11
    }
  }
]
```


### Response 500 application/json

server error


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


### Response 503 application/json

node is not part of a swarm


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


## Complete operation contract

```json
{
  "operationId": "SecretList",
  "parameters": [
    {
      "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=\u003csecret id\u003e`\n- `label=\u003ckey\u003e or label=\u003ckey\u003e=value`\n- `name=\u003csecret name\u003e` matches all or part of a secret name (prefix match)\n- `names=\u003csecret name\u003e` matches a secret name (exact match)\n",
      "in": "query",
      "name": "filters",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "example": [
              {
                "CreatedAt": "2017-07-20T13:55:28.678958722Z",
                "ID": "blt1owaxmitz71s9v5zh81zun",
                "Spec": {
                  "Driver": {
                    "Name": "secret-bucket",
                    "Options": {
                      "OptionA": "value for driver option A",
                      "OptionB": "value for driver option B"
                    }
                  },
                  "Labels": {
                    "some.label": "some.value"
                  },
                  "Name": "mysql-passwd"
                },
                "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
                "Version": {
                  "Index": 85
                }
              },
              {
                "CreatedAt": "2016-11-05T01:20:17.327670065Z",
                "ID": "ktnbjxoalbkvbvedmg1urrz8h",
                "Spec": {
                  "Labels": {
                    "foo": "bar"
                  },
                  "Name": "app-dev.crt"
                },
                "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
                "Version": {
                  "Index": 11
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/Secret"
            },
            "type": "array"
          }
        }
      },
      "description": "no error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "node is not part of a swarm"
    }
  },
  "summary": "List secrets",
  "tags": [
    "Secret"
  ]
}
```

## Referenced schemas

- [#/components/schemas/ErrorResponse](/reference/api/engine/version/v1.57/schemas/ErrorResponse/)

- [#/components/schemas/Secret](/reference/api/engine/version/v1.57/schemas/Secret/)




