---
title: "Create a file upload session"
method: POST
path: "/v1.0/sessions"
---

# Create a file upload session

`POST /v1.0/sessions`

## Request

- Base URL: `https://your-drive.kommo.com`
- URL: `https://your-drive.kommo.com/v1.0/sessions`
- Auth: OAuth 2

The method allows you to create a session to upload a file or version of a file. If the method is used to upload a new version of a file, then the uploaded version will automatically become the active version of the file. The request must be sent to the file service host.

## Headers

- `Content-Type` string

## Request body

- object
  - `file_name` string, required: Name of the uploaded file
  - `file_size` integer, required: Size of the uploaded file (in bytes)
  - `file_uuid` string: The UUID of the file the new version of the file is being uploaded for. If UUID is not specified, a new file will be created.
  - `content_type` string: MIME type of file
  - `with_preview` boolean: When this flag is set, a preview will be generated for the file.

## Response `200`

200

- object
  - `max_file_size` integer
  - `max_part_size` integer
  - `session_id` integer
  - `upload_url` string

## Other responses

- `400`: 400
- `401`: 401
- `403`: 403

---

[API](https://skmtc.dev/kommo/apis/files-api.md) - [All operations](https://skmtc.dev/kommo/apis/files-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kommo/apis/files-api/revisions/61d4a8f2d8c9?raw)
