# Cancel blob upload


[API catalog](/reference/api/) · [Registry overview](/reference/api/registry/latest/) · [Product manual](https://docs.docker.com/docker-hub/repos/) · [OpenAPI specification](/reference/api/registry/latest.yaml)

API version: 2



`DELETE /v2/{name}/blobs/uploads/{uuid}`

Cancel an in-progress blob upload session.

This operation discards any data that has been uploaded and invalidates the upload session.

Use this when:
- An upload fails or is aborted mid-process
- The client wants to clean up unused upload sessions

After cancellation, the UUID is no longer valid and a new `POST` must be issued to restart the upload.


## Connection and access

[API connection and authentication guidance](/reference/api/registry/latest/#authentication)


Server: `https://registry-1.docker.io`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "registryToken": []
  }
]
```
## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request DELETE \
  --header "Authorization: Bearer ${REGISTRY_TOKEN}" \
  'https://registry-1.docker.io/v2/library%2Fubuntu/blobs/uploads/abc123'
```

## Parameters

### name

Location: path. Required: yes.

Name of the repository

```json
{
  "description": "Name of the repository",
  "example": "library/ubuntu",
  "in": "path",
  "name": "name",
  "pointer": "/paths/~1v2~1{name}~1blobs~1uploads~1{uuid}/delete/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### uuid

Location: path. Required: yes.

Upload session UUID

```json
{
  "description": "Upload session UUID",
  "example": "abc123",
  "in": "path",
  "name": "uuid",
  "pointer": "/paths/~1v2~1{name}~1blobs~1uploads~1{uuid}/delete/parameters/1",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 204 

Upload session cancelled successfully. No body is returned.

No response content is declared.




Headers:

```json
{
  "Content-Length": {
    "description": "Always zero",
    "example": 0,
    "schema": {
      "type": "integer"
    }
  }
}
```



### Response 401 

Authentication required

No response content is declared.






### Response 403 

Access denied

No response content is declared.






### Response 404 

Upload session not found

No response content is declared.






### Response 429 

Too many requests

No response content is declared.






## Complete operation contract

```json
{
  "description": "Cancel an in-progress blob upload session.\n\nThis operation discards any data that has been uploaded and invalidates the upload session.\n\nUse this when:\n- An upload fails or is aborted mid-process\n- The client wants to clean up unused upload sessions\n\nAfter cancellation, the UUID is no longer valid and a new `POST` must be issued to restart the upload.\n",
  "operationId": "CancelBlobUpload",
  "parameters": [
    {
      "description": "Name of the repository",
      "example": "library/ubuntu",
      "in": "path",
      "name": "name",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Upload session UUID",
      "example": "abc123",
      "in": "path",
      "name": "uuid",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": "Upload session cancelled successfully. No body is returned.",
      "headers": {
        "Content-Length": {
          "description": "Always zero",
          "example": 0,
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "401": {
      "description": "Authentication required"
    },
    "403": {
      "description": "Access denied"
    },
    "404": {
      "description": "Upload session not found"
    },
    "429": {
      "description": "Too many requests"
    }
  },
  "summary": "Cancel blob upload",
  "tags": [
    "Blobs"
  ],
  "x-codeSamples": [
    {
      "label": "cURL",
      "lang": "Bash",
      "source": "# DELETE – cancel an upload session\ncurl -X DELETE \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  https://registry-1.docker.io/v2/library/ubuntu/blobs/uploads/abc123`\n"
    }
  ]
}
```

## Referenced schemas




