# Update a node


[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





`POST /nodes/{id}/update`



## 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 POST \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "Availability": "active",
  "Labels": {
    "foo": "bar"
  },
  "Name": "node-name",
  "Role": "manager"
}' \
  'http://localhost/v1.57/nodes/<ID>/update?version=%3CVERSION%3E'
```



## Parameters

### id

Location: path. Required: yes.

The ID of the node

```json
{
  "description": "The ID of the node",
  "in": "path",
  "name": "id",
  "pointer": "/paths/~1nodes~1{id}~1update/post/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### version

Location: query. Required: yes.

The version number of the node object being updated. This is required
to avoid conflicting writes.


```json
{
  "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n",
  "in": "query",
  "name": "version",
  "pointer": "/paths/~1nodes~1{id}~1update/post/parameters/1",
  "required": true,
  "schema": {
    "format": "int64",
    "type": "integer"
  }
}
```

## Request and responses

### Request  application/json




Schema:

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









Schema example:
```json
{
  "Availability": "active",
  "Labels": {
    "foo": "bar"
  },
  "Name": "node-name",
  "Role": "manager"
}
```


### Request  text/plain




Schema:

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









Schema example:
```json
{
  "Availability": "active",
  "Labels": {
    "foo": "bar"
  },
  "Name": "node-name",
  "Role": "manager"
}
```


### Response 200 application/json

no error











### Response 200 text/plain

no error











### Response 400 application/json

bad parameter


Schema:

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









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


### Response 404 application/json

no such node


Schema:

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









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


### 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": "NodeUpdate",
  "parameters": [
    {
      "description": "The ID of the node",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n",
      "in": "query",
      "name": "version",
      "required": true,
      "schema": {
        "format": "int64",
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/NodeSpec"
        }
      },
      "text/plain": {
        "schema": {
          "$ref": "#/components/schemas/NodeSpec"
        }
      }
    },
    "x-codegen-request-body-name": "body"
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {},
        "text/plain": {}
      },
      "description": "no error"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "bad parameter"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "no such node"
    },
    "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": "Update a node",
  "tags": [
    "Node"
  ]
}
```

## Referenced schemas

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

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




