> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drime.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Abort Multipart Upload

> Cancel an in-progress multipart upload

## Overview

Cancels an in-progress multipart upload and cleans up any uploaded parts from storage. Use this when an upload fails or is cancelled by the user.

## Request Body

<ParamField body="key" type="string" required>
  S3 key from `createMultipartUpload`
</ParamField>

<ParamField body="uploadId" type="string" required>
  Upload ID from `createMultipartUpload`
</ParamField>

## Response

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://app.drime.cloud/api/v1/s3/multipart/abort \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "key": "uploads/1e4cbca8.../1e4cbca8...",
      "uploadId": "AFNhWKh6Cn6f..."
    }'
  ```

  ```javascript JavaScript theme={null}
  // Cancel the upload
  const response = await fetch('https://app.drime.cloud/api/v1/s3/multipart/abort', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      key,
      uploadId
    })
  });

  console.log('Upload cancelled');
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://app.drime.cloud/api/v1/s3/multipart/abort',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'key': key,
          'uploadId': upload_id
      }
  )

  print('Upload cancelled')
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success"
  }
  ```
</ResponseExample>

<Note>
  Always abort failed uploads to free up storage space and avoid orphaned parts.
</Note>
