# Resize 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





`POST /exec/{id}/resize`

Resize the TTY session used by an exec instance. This endpoint only works
if `tty` was specified as part of creating and starting the 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 POST \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/json' \
  'http://localhost/v1.57/exec/<ID>/resize?h=%3CH%3E&w=%3CW%3E'
```



## Parameters

### id

Location: path. Required: yes.

Exec instance ID

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

### h

Location: query. Required: yes.

Height of the TTY session in characters

```json
{
  "description": "Height of the TTY session in characters",
  "in": "query",
  "name": "h",
  "pointer": "/paths/~1exec~1{id}~1resize/post/parameters/1",
  "required": true,
  "schema": {
    "type": "integer"
  }
}
```

### w

Location: query. Required: yes.

Width of the TTY session in characters

```json
{
  "description": "Width of the TTY session in characters",
  "in": "query",
  "name": "w",
  "pointer": "/paths/~1exec~1{id}~1resize/post/parameters/2",
  "required": true,
  "schema": {
    "type": "integer"
  }
}
```

## Request and responses

### 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 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": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n",
  "operationId": "ExecResize",
  "parameters": [
    {
      "description": "Exec instance ID",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Height of the TTY session in characters",
      "in": "query",
      "name": "h",
      "required": true,
      "schema": {
        "type": "integer"
      }
    },
    {
      "description": "Width of the TTY session in characters",
      "in": "query",
      "name": "w",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "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 exec instance"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    }
  },
  "summary": "Resize an exec instance",
  "tags": [
    "Exec"
  ]
}
```

## Referenced schemas

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




