Insert a file to the "My documents" section

POST /api/2.0/files/@my/insert

Request

Inserts a file specified in the request to the "My documents" section by single file uploading.

Authorization

An API key is a token that you provide when making API calls. Include the token in a cookie parameter called asc_auth_key.

Example: asc_auth_key=864FE52C-1C1C-469F-9308-51DAFEFE7436.

Headers

Acceptenum of string

Can be one of: application/json, text/json, text/plain.

Content-Typeenum of string

Can be one of: multipart/form-data.

Body

Filestringformat: binary

File

Titlestring

File name

CreateNewIfExistboolean

Specifies whether to create a new file if it already exists or not

KeepConvertStatusboolean

Specifies whether to keep the file converting status or not

Stream.CanReadboolean
Stream.CanWriteboolean
Stream.CanSeekboolean
Stream.CanTimeoutboolean
Stream.Lengthintegerformat: int64
Stream.Positionintegerformat: int64
Stream.ReadTimeoutintegerformat: int32
Stream.WriteTimeoutintegerformat: int32

Examples

POST /api/2.0/files/@my/insert HTTP/1.1
Accept: application/json
Content-Length: 1083
Content-Type: multipart/form-data; boundary=---011000010111000001101001
Host: example.com

-----011000010111000001101001
Content-Disposition: form-data; name="Title"
curl --request POST \
  --url https://example.com/api/2.0/files/@my/insert \
  --header 'Accept: application/json' \
  --header 'Content-Type: multipart/form-data' \
  --form Title=right_sized \
  --form CreateNewIfExist=true \
  --form KeepConvertStatus=true \
  --form Stream.CanRead=true \
  --form Stream.CanWrite=true \
  --form Stream.CanSeek=true \
  --form Stream.CanTimeout=true \
  --form Stream.Length=1234 \
  --form Stream.Position=1234 \
  --form Stream.ReadTimeout=1234 \
  --form Stream.WriteTimeout=1234

Responses

200

Inserted file

titlestring

Title

accessone of
.enum of string

[None - None, ReadWrite - Read and write, Read - Read, Restrict - Restrict, Varies - Varies, Review - Review, Comment - Comment, FillForms - Fill forms, CustomFilter - Custom filter, RoomManager - Room manager, Editing - Editing, ContentCreator - Content creator]

Can be one of: None, ReadWrite, Read, Restrict, Varies, Review, Comment, FillForms, CustomFilter, RoomManager, Editing, ContentCreator.

.enum of integer

[0 - None, 1 - Read and write, 2 - Read, 3 - Restrict, 4 - Varies, 5 - Review, 6 - Comment, 7 - Fill forms, 8 - Custom filter, 9 - Room manager, 10 - Editing, 11 - Content creator]

Can be one of: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.

sharedboolean

Specifies if the file is shared or not

createdobject
utcTimestringformat: date-time

UtcTime

timeZoneOffsetstringformat: date-span

TimeZoneOffset

createdByobject
idstringformat: uuid

ID

displayNamestring

Display name

titlestring

Title

avatarstring

Avatar

avatarOriginalstring

Original size avatar

avatarMaxstring

Maximum size avatar

avatarMediumstring

Medium size avatar

avatarSmallstring

Small avatar

profileUrlstring

Profile URL

hasAvatarboolean

Specifies if the user has an avatar or not

isAnonimboolean

Specifies if the user is an anonim or not

updatedobject
utcTimestringformat: date-time

UtcTime

timeZoneOffsetstringformat: date-span

TimeZoneOffset

autoDeleteobject
utcTimestringformat: date-time

UtcTime

timeZoneOffsetstringformat: date-span

TimeZoneOffset

rootFolderTypeone of
.enum of string

[DEFAULT - Default, COMMON - Coomon, BUNCH - Bunch, TRASH - Trash, USER - User, SHARE - Share, Projects - Projects, Favorites - Favourites, Recent - Recent, Templates - Templates, Privacy - Privacy, VirtualRooms - Virtual rooms, FillingFormsRoom - Filling forms room, EditingRoom - Editing room, CustomRoom - Custom room, Archive - Archive, ThirdpartyBackup - Thirdparty backup, PublicRoom - Public room, ReadyFormFolder - Ready form folder, InProcessFormFolder - In process form folder, FormFillingFolderDone - Form filling folder done, FormFillingFolderInProgress - Form filling folder in progress, VirtualDataRoom - Virtual Data Room]

Can be one of: DEFAULT, COMMON, BUNCH, TRASH, USER, SHARE, Projects, Favorites, Recent, Templates, Privacy, VirtualRooms, FillingFormsRoom, EditingRoom, CustomRoom, Archive, ThirdpartyBackup, PublicRoom, ReadyFormFolder, InProcessFormFolder, FormFillingFolderDone, FormFillingFolderInProgress, VirtualDataRoom.

.enum of integer

[0 - Default, 1 - Coomon, 2 - Bunch, 3 - Trash, 5 - User, 6 - Share, 8 - Projects, 10 - Favourites, 11 - Recent, 12 - Templates, 13 - Privacy, 14 - Virtual rooms, 15 - Filling forms room, 16 - Editing room, 19 - Custom room, 20 - Archive, 21 - Thirdparty backup, 22 - Public room, 25 - Ready form folder, 26 - In process form folder, 27 - Form filling folder done, 28 - Form filling folder in progress, 29 - Virtual Data Room]

Can be one of: 0, 1, 2, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 29.

parentRoomTypeone of
.enum of string

[DEFAULT - Default, COMMON - Coomon, BUNCH - Bunch, TRASH - Trash, USER - User, SHARE - Share, Projects - Projects, Favorites - Favourites, Recent - Recent, Templates - Templates, Privacy - Privacy, VirtualRooms - Virtual rooms, FillingFormsRoom - Filling forms room, EditingRoom - Editing room, CustomRoom - Custom room, Archive - Archive, ThirdpartyBackup - Thirdparty backup, PublicRoom - Public room, ReadyFormFolder - Ready form folder, InProcessFormFolder - In process form folder, FormFillingFolderDone - Form filling folder done, FormFillingFolderInProgress - Form filling folder in progress, VirtualDataRoom - Virtual Data Room]

Can be one of: DEFAULT, COMMON, BUNCH, TRASH, USER, SHARE, Projects, Favorites, Recent, Templates, Privacy, VirtualRooms, FillingFormsRoom, EditingRoom, CustomRoom, Archive, ThirdpartyBackup, PublicRoom, ReadyFormFolder, InProcessFormFolder, FormFillingFolderDone, FormFillingFolderInProgress, VirtualDataRoom.

.enum of integer

[0 - Default, 1 - Coomon, 2 - Bunch, 3 - Trash, 5 - User, 6 - Share, 8 - Projects, 10 - Favourites, 11 - Recent, 12 - Templates, 13 - Privacy, 14 - Virtual rooms, 15 - Filling forms room, 16 - Editing room, 19 - Custom room, 20 - Archive, 21 - Thirdparty backup, 22 - Public room, 25 - Ready form folder, 26 - In process form folder, 27 - Form filling folder done, 28 - Form filling folder in progress, 29 - Virtual Data Room]

Can be one of: 0, 1, 2, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 29.

updatedByobject
idstringformat: uuid

ID

displayNamestring

Display name

titlestring

Title

avatarstring

Avatar

avatarOriginalstring

Original size avatar

avatarMaxstring

Maximum size avatar

avatarMediumstring

Medium size avatar

avatarSmallstring

Small avatar

profileUrlstring

Profile URL

hasAvatarboolean

Specifies if the user has an avatar or not

isAnonimboolean

Specifies if the user is an anonim or not

providerItemboolean

Provider is specified or not

providerKeystring

Provider key

providerIdintegerformat: int32

Provider ID

orderstring

Order

idintegerformat: int32

Id

rootFolderIdintegerformat: int32

Root folder id

originIdintegerformat: int32

Origin id

originRoomIdintegerformat: int32

Origin room id

originTitlestring

Origin title

originRoomTitlestring

Origin room title

canShareboolean

Can share

securityobject

Security

Readboolean
Commentboolean
FillFormsboolean
Reviewboolean
Createboolean
Editboolean
Deleteboolean
CustomFilterboolean
EditRoomboolean
Renameboolean
ReadHistoryboolean
Lockboolean
EditHistoryboolean
CopyToboolean
Copyboolean
MoveToboolean
Moveboolean
Pinboolean
Muteboolean
EditAccessboolean
Duplicateboolean
SubmitToFormGalleryboolean
Downloadboolean
Convertboolean
CopySharedLinkboolean
ReadLinksboolean
Reconnectboolean
CreateRoomFromboolean
CopyLinkboolean
Embedboolean
ChangeOwnerboolean
IndexExportboolean
requestTokenstring
folderIdintegerformat: int32

Folder ID

versionintegerformat: int32

Version

versionGroupintegerformat: int32

Version group

contentLengthstring

Content length

pureContentLengthintegerformat: int64

Pure content length

fileStatusone of
.enum of string

[None - None, IsEditing - Is editing, IsNew - Is new, IsConverting - Is converting, IsOriginal - Is original, IsEditingAlone - Is editing alone, IsFavorite - Is favorite, IsTemplate - Is template, IsFillFormDraft - Is fill form draft]

Can be one of: None, IsEditing, IsNew, IsConverting, IsOriginal, IsEditingAlone, IsFavorite, IsTemplate, IsFillFormDraft.

.enum of integer

[0 - None, 1 - Is editing, 2 - Is new, 4 - Is converting, 8 - Is original, 16 - Is editing alone, 32 - Is favorite, 64 - Is template, 128 - Is fill form draft]

Can be one of: 0, 1, 2, 4, 8, 16, 32, 64, 128.

muteboolean

Muted or not

viewUrlstringformat: uri

URL to view a file

webUrlstringformat: uri

Web URL

fileTypeone of
.enum of string

[Unknown - Unknown, Archive - Archive, Video - Video, Audio - Audio, Image - Image, Spreadsheet - Spreadsheet, Presentation - Presentation, Document - Document, Pdf - Pdf]

Can be one of: Unknown, Archive, Video, Audio, Image, Spreadsheet, Presentation, Document, Pdf.

.enum of integer

[0 - Unknown, 1 - Archive, 2 - Video, 3 - Audio, 4 - Image, 5 - Spreadsheet, 6 - Presentation, 7 - Document, 10 - Pdf]

Can be one of: 0, 1, 2, 3, 4, 5, 6, 7, 10.

fileExststring

File extension

commentstring

Comment

encryptedboolean

Encrypted or not

thumbnailUrlstringformat: uri

Thumbnail URL

thumbnailStatusone of
.enum of string

[Waiting - Waiting, Created - Created, Error - Error, NotRequired - Not required, Creating - Creating]

Can be one of: Waiting, Created, Error, NotRequired, Creating.

.enum of integer

[0 - Waiting, 1 - Created, 2 - Error, 3 - Not required, 4 - Creating]

Can be one of: 0, 1, 2, 3, 4.

lockedboolean

Locked or not

lockedBystring

User ID who locked a file

hasDraftboolean

Is there a draft or not

isFormboolean

Is there a form or not

startFillingboolean

Specifies if the filling has started or not

inProcessFolderIdintegerformat: int32

InProcess folder ID

inProcessFolderTitlestring

InProcess folder title

draftLocationobject
folderIdintegerformat: int32

InProcess folder ID

folderTitlestring

InProcess folder title

fileIdintegerformat: int32

Draft ID

fileTitlestring

Draft title

viewAccessibilityobject

File accessibility

ImageViewboolean
MediaViewboolean
WebViewboolean
WebEditboolean
WebReviewboolean
WebCustomFilterEditingboolean
WebRestrictedEditingboolean
WebCommentboolean
CoAuhtoringboolean
CanConvertboolean
MustConvertboolean
availableExternalRightsobject

Available external rights

lastOpenedobject
utcTimestringformat: date-time

UtcTime

timeZoneOffsetstringformat: date-span

TimeZoneOffset

expiredobject
utcTimestringformat: date-time

UtcTime

timeZoneOffsetstringformat: date-span

TimeZoneOffset

fileEntryTypeenum of integerformat: int32

Can be one of: 1, 2.

401

Unauthorized

403

You don't have enough permission to create

404

Folder not found

Get Help

  • If you have any questions about ONLYOFFICE DocSpace, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).