# Inspect a task


[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 /tasks/{id}`



## 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/tasks/<ID>'
```



## Parameters

### id

Location: path. Required: yes.

ID of the task

```json
{
  "description": "ID of the task",
  "in": "path",
  "name": "id",
  "pointer": "/paths/~1tasks~1{id}/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

no error


Schema:

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









Schema example:
```json
{
  "AssignedGenericResources": [
    {
      "DiscreteResourceSpec": {
        "Kind": "SSD",
        "Value": 3
      }
    },
    {
      "NamedResourceSpec": {
        "Kind": "GPU",
        "Value": "UUID1"
      }
    },
    {
      "NamedResourceSpec": {
        "Kind": "GPU",
        "Value": "UUID2"
      }
    }
  ],
  "CreatedAt": "2016-06-07T21:07:31.171892745Z",
  "DesiredState": "running",
  "ID": "0kzzo1i0y4jz6027t0k7aezc7",
  "NetworksAttachments": [
    {
      "Addresses": [
        "10.255.0.10/16"
      ],
      "Network": {
        "CreatedAt": "2016-06-07T20:31:11.912919752Z",
        "DriverState": {
          "Name": "overlay",
          "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "256"
          }
        },
        "ID": "4qvuz4ko70xaltuqbt8956gd1",
        "IPAMOptions": {
          "Configs": [
            {
              "Gateway": "10.255.0.1",
              "Subnet": "10.255.0.0/16"
            }
          ],
          "Driver": {
            "Name": "default"
          }
        },
        "Spec": {
          "DriverConfiguration": {},
          "IPAMOptions": {
            "Configs": [
              {
                "Gateway": "10.255.0.1",
                "Subnet": "10.255.0.0/16"
              }
            ],
            "Driver": {}
          },
          "Labels": {
            "com.docker.swarm.internal": "true"
          },
          "Name": "ingress"
        },
        "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
        "Version": {
          "Index": 18
        }
      }
    }
  ],
  "NodeID": "60gvrl6tm78dmak4yl7srz94v",
  "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
  "Slot": 1,
  "Spec": {
    "ContainerSpec": {
      "Image": "redis"
    },
    "Placement": {},
    "Resources": {
      "Limits": {},
      "Reservations": {}
    },
    "RestartPolicy": {
      "Condition": "any",
      "MaxAttempts": 0
    }
  },
  "Status": {
    "ContainerStatus": {
      "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
      "PID": 677
    },
    "Message": "started",
    "State": "running",
    "Timestamp": "2016-06-07T21:07:31.290032978Z"
  },
  "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
  "Version": {
    "Index": 71
  }
}
```


### Response 404 application/json

no such task


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": "TaskInspect",
  "parameters": [
    {
      "description": "ID of the task",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Task"
          }
        }
      },
      "description": "no error"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "no such task"
    },
    "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": "Inspect a task",
  "tags": [
    "Task"
  ]
}
```

## Referenced schemas

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

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




