# Inspect an exec instance


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

Return low-level information about an exec instance.

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



## Parameters

### id

Location: path. Required: yes.

Exec instance ID

```json
{
  "description": "Exec instance ID",
  "in": "path",
  "name": "id",
  "pointer": "/paths/~1exec~1{id}~1json/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

No error


Schema:

```json
{
  "properties": {
    "CanRemove": {
      "type": "boolean"
    },
    "ContainerID": {
      "type": "string"
    },
    "DetachKeys": {
      "type": "string"
    },
    "ExitCode": {
      "type": "integer"
    },
    "ID": {
      "type": "string"
    },
    "OpenStderr": {
      "type": "boolean"
    },
    "OpenStdin": {
      "type": "boolean"
    },
    "OpenStdout": {
      "type": "boolean"
    },
    "Pid": {
      "description": "The system process ID for the exec process.",
      "type": "integer"
    },
    "ProcessConfig": {
      "$ref": "#/components/schemas/ProcessConfig"
    },
    "Running": {
      "type": "boolean"
    }
  },
  "title": "ExecInspectResponse",
  "type": "object"
}
```









Example:
```json
{
  "CanRemove": false,
  "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
  "DetachKeys": "",
  "ExitCode": 2,
  "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
  "OpenStderr": true,
  "OpenStdin": true,
  "OpenStdout": true,
  "Pid": 42000,
  "ProcessConfig": {
    "arguments": [
      "-c",
      "exit 2"
    ],
    "entrypoint": "sh",
    "privileged": false,
    "tty": true,
    "user": "1000"
  },
  "Running": false
}
```


### Response 404 application/json

No such exec instance


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."
}
```


## Complete operation contract

```json
{
  "description": "Return low-level information about an exec instance.",
  "operationId": "ExecInspect",
  "parameters": [
    {
      "description": "Exec instance ID",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "example": {
            "CanRemove": false,
            "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
            "DetachKeys": "",
            "ExitCode": 2,
            "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
            "OpenStderr": true,
            "OpenStdin": true,
            "OpenStdout": true,
            "Pid": 42000,
            "ProcessConfig": {
              "arguments": [
                "-c",
                "exit 2"
              ],
              "entrypoint": "sh",
              "privileged": false,
              "tty": true,
              "user": "1000"
            },
            "Running": false
          },
          "schema": {
            "properties": {
              "CanRemove": {
                "type": "boolean"
              },
              "ContainerID": {
                "type": "string"
              },
              "DetachKeys": {
                "type": "string"
              },
              "ExitCode": {
                "type": "integer"
              },
              "ID": {
                "type": "string"
              },
              "OpenStderr": {
                "type": "boolean"
              },
              "OpenStdin": {
                "type": "boolean"
              },
              "OpenStdout": {
                "type": "boolean"
              },
              "Pid": {
                "description": "The system process ID for the exec process.",
                "type": "integer"
              },
              "ProcessConfig": {
                "$ref": "#/components/schemas/ProcessConfig"
              },
              "Running": {
                "type": "boolean"
              }
            },
            "title": "ExecInspectResponse",
            "type": "object"
          }
        }
      },
      "description": "No error"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "No such exec instance"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    }
  },
  "summary": "Inspect an exec instance",
  "tags": [
    "Exec"
  ]
}
```

## Referenced schemas

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

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




