---
title: "Close session"
method: POST
path: "/3/drive/{drive_id}/upload/session/{session_token}/finish"
tags: ["Drive > Files > File/Directory > Upload > Session"]
---

# Close session

`POST /3/drive/{drive_id}/upload/session/{session_token}/finish`

Finish an upload session, verify and save the uploaded data to the kDrive.<br/>

## Path parameters

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

## Query parameters

- `with` string

## Request body

- object
  - `created_at` integer — Override the creation date metadata of the new file.<note>The value of this field will be capped at 24h from the current time.</note>
  - `last_modified_at` integer — Override the update date metadata of the new file.<note>The value of this field will be capped at 24h from the current time.</note>
  - `total_chunk_hash` string — The hash of the content of the file. If provided and the uploaded content does not match this hash, an error will be returned. For a multi-chunk upload use the hash of the concatenation of the chunk's hashes.<note>Supported hashing algorithm: md5, sha1, sha256, sha512, xxh3, xxh32, xxh64, xxh128</note>

## Response `200`

OK

- object
  - `result` 'success' | 'error' | 'asynchronous', required — Result of the HTTP request
  - `data` 91ac10ffClosinguploadsession — unresolved $ref

## Other responses

- `400` — Bad Request
- `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)
