# Create a volume


[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 /volumes/create`



## 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' \
  --header 'Content-Type: application/json' \
  --data-binary @request-body \
  'http://localhost/v1.57/volumes/create'
```


Prepare request-body using the selected media type and schema.


## Parameters

## Request and responses

### Request  application/json

Volume configuration


Schema:

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










### Response 201 application/json

The volume was created successfully


Schema:

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










### Response 500 application/json

Server error


Schema:

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









Schema example:
```json
{
  "message": "Something went wrong."
}
```


## Complete operation contract

```json
{
  "operationId": "VolumeCreate",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VolumeCreateRequest"
        }
      }
    },
    "description": "Volume configuration",
    "required": true,
    "x-codegen-request-body-name": "volumeConfig"
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Volume"
          }
        }
      },
      "description": "The volume was created successfully"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    }
  },
  "summary": "Create a volume",
  "tags": [
    "Volume"
  ]
}
```

## Referenced schemas

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

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

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




