Search or ask Docker

Delete a node

DELETE /nodes/{id} — Docker Engine API 1.57.

View Markdown
DELETE/nodes/{id}

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

id path Required

The ID or name of the node

Type: string

All schema constraints and annotations
{
  "type": "string"
}

force query

Force remove a node from the swarm

Type: boolean

All schema constraints and annotations
{
  "default": false,
  "type": "boolean"
}

Request and responses

Response 200

no error

application/json

Response 200

no error

text/plain

Response 404

no such node

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 503

node is not part of a swarm

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

Complete operation contract
{
  "operationId": "NodeDelete",
  "parameters": [
    {
      "description": "The ID or name of the node",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Force remove a node from the swarm",
      "in": "query",
      "name": "force",
      "schema": {
        "default": false,
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {},
        "text/plain": {}
      },
      "description": "no error"
    },
    "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": "Delete a node",
  "tags": [
    "Node"
  ]
}