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

# Blob 分块上传中止

> 本文档全面介绍 SquareCloud Blob API 的 DELETE /v1/objects/chunked 端点。

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  你账户的 API 密钥。你可以在[账户设置](https://squarecloud.app/zh/account/security)中找到它。
</ParamField>

Chunked Abort 用于取消通过[分块初始化](/zh/blob-reference/endpoint/chunked-init)开启的上传，并丢弃已存储的分块。它是**幂等的**：中止一个已经完成或已被中止的上传仍会报告成功。

每当用户放弃上传时都应调用它。在此之前，已存储的分块会一直计入账户 8 个未完成上传的限制，只有服务的回收作业才能释放它们，大约在最后一次活动的 24 小时后。丢失令牌的客户端无法取消上传，因此如果上传会跨越页面刷新，请持久化保存令牌。

这是分块流程中限流刻意最宽松的路由（每 10 秒 10 次请求）：批量取消上传绝不应因限流而导致这些上传保持开启状态。

<ParamField body="upload" type="string" placeholder="Upload token" required>
  由分块初始化返回的不透明 `upload` 令牌。

  ```json theme={null}
  { "upload": "UPLOAD_TOKEN" }
  ```
</ParamField>

### 响应

<ResponseField name="status" type="string">
  指示调用是否成功。成功为 "success"，否则为 "error"。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url 'https://blob.squarecloud.app/v1/objects/chunked' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "upload": "UPLOAD_TOKEN" }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://blob.squarecloud.app/v1/objects/chunked', {
    method: 'DELETE',
    headers: {
      Authorization: 'YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ upload: uploadToken }),
  });
  ```

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

  response = requests.delete(
      'https://blob.squarecloud.app/v1/objects/chunked',
      headers={'Authorization': 'YOUR_API_KEY'},
      json={'upload': upload_token},
  )
  ```
</RequestExample>

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

### 故障排查

<Tabs>
  <Tab title="400 状态码">
    ### 上传相关

    <CodeGroup>
      ```json INVALID_UPLOAD_TOKEN theme={null}
      // The upload token is missing, malformed, or does not belong to your account.
      {
          "status": "error",
          "code": "INVALID_UPLOAD_TOKEN"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="401 状态码">
    ### 未授权

    <CodeGroup>
      ```json ACCESS_DENIED theme={null}
      // The API key is missing or invalid. Set a valid key in the Authorization header.
      {
          "status": "error",
          "code": "ACCESS_DENIED"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="429 状态码">
    ### 速率受限

    <CodeGroup>
      ```json RATE_LIMITED theme={null}
      // Abort rate limit reached (10 requests per 10s window, blocked for 10s).
      {
          "status": "error",
          "code": "RATE_LIMITED"
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>
