v1

latestOpenAPI 3.1.02026-07-241630614.2 KB

Create a file upload session

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.

post/v1.0/sessions

Headers

Content-Typestring

Request headers

Request body

file_namestring required

Name of the uploaded file

file_sizeinteger required

Size of the uploaded file (in bytes)

file_uuidstring

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_typestring

MIME type of file

with_previewboolean

When this flag is set, a preview will be generated for the file.

Response

200

max_file_sizeinteger
max_part_sizeinteger
session_idinteger
upload_urlstring

Example response

{
  "max_file_size": 314572800,
  "max_part_size": 524288,
  "session_id": 26136001,
  "upload_url": "https://drive-c.kommo.com/v1.0/sessions/upload/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjc0MTg3MzYwMCwiaWF0Ijo3NDE4NzM2MDAsIm5iZiI6NzQxODczNjAwLCJhY2NvdW50X2lkIjo3Nzc3Nzc3Nywic2Vzc2lvbl9pZCI6Nzc3Nzc3NzcsInVzZXJfaWQiOjc3Nzc3NzcsInVzZXJfdHlwZSI6ImludGVybmFsIiwicGFydF9udW0iOjF9.8sdJVTZJ_MjuHhMGDkU7_eSi2q1u1EG-au_TZhmmXK8"
}