Get Started
Usage API
More information

DELETE api/2.0/files/file/{fileId} This function requires authentication

Description

Deletes a file with the ID specified in the request.

Parameters
Name Description Type Example
fileId
sent in url
File ID string some text
deleteAfter
sent in body
Deletes after finished Bool value true
immediately
sent in body
Doesn't move a file to the recycle bin Bool value true
Example
DELETE api/2.0/files/file/some+text
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "deleteAfter": true,
  "immediately": true
}
Returns

Operation result

Example Response

application/json

{
  "status": 0,
  "response": [
    {
      "id": "a98570df-c019-45d9-a037-ef4a23f990dd",
      "operation": 0,
      "progress": 100,
      "error": "",
      "processed": "1",
      "finished": false,
      "url": null,
      "files": [
        {
          "folderId": 12334,
          "version": 3,
          "versionGroup": 1,
          "contentLength": "12.06 KB",
          "pureContentLength": 12345,
          "fileStatus": 2,
          "viewUrl": "http:\/\/www.onlyoffice.com\/viewfile?fileid=2221",
          "fileType": 7,
          "fileExst": ".txt",
          "comment": null,
          "id": 81851944,
          "title": "Some titile.txt",
          "access": 1,
          "shared": false,
          "rootFolderType": 2,
          "updatedBy": {
            "id": "00000000-0000-0000-0000-000000000000",
            "displayName": "Mike Zanyatski",
            "title": "Manager",
            "avatarSmall": "url to small avatar",
            "profileUrl": ""
          },
          "created": "2021-12-02T05:36:20.5215183Z",
          "createdBy": {
            "id": "00000000-0000-0000-0000-000000000000",
            "displayName": "Mike Zanyatski",
            "title": "Manager",
            "avatarSmall": "url to small avatar",
            "profileUrl": ""
          },
          "updated": "2021-12-02T05:36:20.5215183Z"
        }
      ],
      "folders": [
        {
          "parentId": 81851944,
          "filesCount": 81851944,
          "foldersCount": 81851944,
          "id": 81851944,
          "title": "Some titile",
          "access": 1,
          "shared": false,
          "rootFolderType": 2,
          "updatedBy": {
            "id": "00000000-0000-0000-0000-000000000000",
            "displayName": "Mike Zanyatski",
            "title": "Manager",
            "avatarSmall": "url to small avatar",
            "profileUrl": ""
          },
          "created": "2021-12-02T05:36:20.5215183Z",
          "createdBy": {
            "id": "00000000-0000-0000-0000-000000000000",
            "displayName": "Mike Zanyatski",
            "title": "Manager",
            "avatarSmall": "url to small avatar",
            "profileUrl": ""
          },
          "updated": "2021-12-02T05:36:20.5215183Z"
        }
      ]
    }
  ]
}

text/xml

<result>
  <status>0</status>
  <response>
    <id>a98570df-c019-45d9-a037-ef4a23f990dd</id>
    <operation>0</operation>
    <progress>100</progress>
    <error></error>
    <processed>1</processed>
    <finished>false</finished>
    <url />
    <files>
      <folderId>12334</folderId>
      <version>3</version>
      <versionGroup>1</versionGroup>
      <contentLength>12.06 KB</contentLength>
      <pureContentLength>12345</pureContentLength>
      <fileStatus>2</fileStatus>
      <viewUrl>http://www.onlyoffice.com/viewfile?fileid=2221</viewUrl>
      <fileType>7</fileType>
      <fileExst>.txt</fileExst>
      <comment />
      <id>81851944</id>
      <title>Some titile.txt</title>
      <access>1</access>
      <shared>false</shared>
      <rootFolderType>2</rootFolderType>
      <updatedBy>
        <id>00000000-0000-0000-0000-000000000000</id>
        <displayName>Mike Zanyatski</displayName>
        <title>Manager</title>
        <avatarSmall>url to small avatar</avatarSmall>
        <profileUrl></profileUrl>
      </updatedBy>
      <created>2021-12-02T05:36:20.5215183Z</created>
      <createdBy>
        <id>00000000-0000-0000-0000-000000000000</id>
        <displayName>Mike Zanyatski</displayName>
        <title>Manager</title>
        <avatarSmall>url to small avatar</avatarSmall>
        <profileUrl></profileUrl>
      </createdBy>
      <updated>2021-12-02T05:36:20.5215183Z</updated>
    </files>
    <folders>
      <parentId>81851944</parentId>
      <filesCount>81851944</filesCount>
      <foldersCount>81851944</foldersCount>
      <id>81851944</id>
      <title>Some titile</title>
      <access>1</access>
      <shared>false</shared>
      <rootFolderType>2</rootFolderType>
      <updatedBy>
        <id>00000000-0000-0000-0000-000000000000</id>
        <displayName>Mike Zanyatski</displayName>
        <title>Manager</title>
        <avatarSmall>url to small avatar</avatarSmall>
        <profileUrl></profileUrl>
      </updatedBy>
      <created>2021-12-02T05:36:20.5215183Z</created>
      <createdBy>
        <id>00000000-0000-0000-0000-000000000000</id>
        <displayName>Mike Zanyatski</displayName>
        <title>Manager</title>
        <avatarSmall>url to small avatar</avatarSmall>
        <profileUrl></profileUrl>
      </createdBy>
      <updated>2021-12-02T05:36:20.5215183Z</updated>
    </folders>
  </response>
</result>