---
title: "POST /containers/{id}/exec"
method: POST
path: "/containers/{id}/exec"
---

# POST /containers/{id}/exec

`POST /containers/{id}/exec`

Create an exec instance

## Path parameters

- `id` string, required

## Request body

- object
  - `AttachStdin` boolean
  - `AttachStdout` boolean
  - `AttachStderr` boolean
  - `ConsoleSize` integer[], nullable
  - `DetachKeys` string
  - `Tty` boolean
  - `Env` string[]
  - `Cmd` string[]
  - `Privileged` boolean
  - `User` string
  - `WorkingDir` string

## Response `200`

The request has succeeded.

- IDResponse — Response to an API call that returns just an Id
  - `Id` string, required — The id of the newly created object.

## Changes

- **2026-02-14** `31f80d10d31a` — 2 breaking, 6 info
  - the `ConsoleSize/items/` request property type/format changed from `integer`/`` to `integer`/`int32`
  - removed the success response with the status `201`
  - api tag `Exec` removed
  - the `Privileged` request property default value `false` was removed
  - …4 more

[Change history](https://skmtc.dev/hexlet/apis/docker-engine-api/changes/containers/:id/exec/post.md)

---

[API](https://skmtc.dev/hexlet/apis/docker-engine-api.md) · [All operations](https://skmtc.dev/hexlet/apis/docker-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hexlet/docker-engine-api/revisions/7dbd508c79cf/schema)
