---
title: "Cancel session"
method: DELETE
path: "/2/drive/{drive_id}/upload/session/{session_token}"
tags: ["Drive > Files > File/Directory > Upload > Session"]
deprecated: true
---

# Cancel session

`DELETE /2/drive/{drive_id}/upload/session/{session_token}`

> **Deprecated.**

Cancel an upload by its token. If you want to stop the upload and close the session to explicitly erase the file/upload.
<br/><br/><note>
When a session is started, it can be used for a maximum of 4 hours. It will be automatically canceled afterwards.
</note>

## Path parameters

- `drive_id` integer, required
- `session_token` integer, required

## Response `200`

OK

- object
  - `result` 'success' | 'error' | 'asynchronous', required — Result of the HTTP request
  - `data` boolean

## Other responses

- `400` — Destination not writable
- `403` — Forbidden
- `503` — Service Unavailable

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
