Restore as Top Version

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

This API restores a specific version of a file to be the top version of the file.

Endpoints

OAuth Scope

WorkDrive.files.UPDATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/versions \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"revert_to":"5.0","resource_id":"cjrrr55b395f872ad4b0a8c52b02eab98c1c5"},"type":"versions"}}'

Request Body

application/vnd.api+json
dataJSON Object(Required)
Hide Sub-Attributes
attributesJSON Object(Required)
Hide Sub-Attributes
revert_tostring(Required)

The version of the file that needs to be set as the top version.

resource_idstring(Required)

The unique ID of the file.

typestring(Required)

The JSON:API resource type. Always "versions".

Allowed Values :
Show Values
versionsCopied!
Copied!Copy all as JSON Array

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "revert_to": "5.0",
        "resource_id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5"
      },
      "type": "versions"
    }
  }
                
Show full

Response Example

R008

R006

R006

R004

V003

V003

F000

R1114

200
200
401
404
500
Copied!
  {
    "data": {
      "id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5-2774428000000002078",
      "type": "versions",
      "attributes": {
        "created_time": "Apr 13, 3:07 PM",
        "is_locked": false,
        "notes": "Reverted to version 3.0",
        "capabilities": {
          "can_read": true,
          "can_edit": true,
          "can_delete": true
        },
        "del_time": -1,
        "created_time_in_milliseconds": 1618306634449,
        "version_number": 5,
        "version_id": 2774428000000002000,
        "created_by": "Zylker Creation",
        "file_size": 92684,
        "file_id": 2774428000000002000,
        "size_in_bytes": "90.0 KB",
        "resource_id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5"
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/versions/cjrrr55b395f872ad4b0a8c52b02eab98c1c5-2774428000000002078"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "R008",
        "title": "Unauthorized access"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R006",
        "title": "Invalid version/resource info"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R004",
        "title": "Resource Details Empty"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "V003",
        "title": "Top version cannot be restored as top version"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General exception"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R1114",
        "title": "Invalid params"
      }
    ]
  }
                
Show full