# Get the unlock key


[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 /swarm/unlockkey`



## 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/swarm/unlockkey'
```



## Parameters

## Request and responses

### Response 200 application/json

no error


Schema:

```json
{
  "example": {
    "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
  },
  "properties": {
    "UnlockKey": {
      "description": "The swarm's unlock key.",
      "type": "string"
    }
  },
  "title": "UnlockKeyResponse",
  "type": "object"
}
```









Schema example:
```json
{
  "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
}
```


### Response 200 text/plain

no error


Schema:

```json
{
  "example": {
    "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
  },
  "properties": {
    "UnlockKey": {
      "description": "The swarm's unlock key.",
      "type": "string"
    }
  },
  "title": "UnlockKeyResponse",
  "type": "object"
}
```









Schema example:
```json
{
  "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
}
```


### 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": "SwarmUnlockkey",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "example": {
              "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
            },
            "properties": {
              "UnlockKey": {
                "description": "The swarm's unlock key.",
                "type": "string"
              }
            },
            "title": "UnlockKeyResponse",
            "type": "object"
          }
        },
        "text/plain": {
          "schema": {
            "example": {
              "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
            },
            "properties": {
              "UnlockKey": {
                "description": "The swarm's unlock key.",
                "type": "string"
              }
            },
            "title": "UnlockKeyResponse",
            "type": "object"
          }
        }
      },
      "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": "Get the unlock key",
  "tags": [
    "Swarm"
  ],
  "x-consumes": [
    "application/json"
  ]
}
```

## Referenced schemas

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




