Update File/Folder Share Permissions

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 will update the roles of the users with whom the files need to be shared.

The permission_id is created when the file or folder is shared with other users.

Endpoints

OAuth Scope

WorkDrive.files.sharing.UPDATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request PATCH \
  --url https://www.zohoapis.com/workdrive/api/v1/permissions/{permission_id} \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"role_id":"5"},"type":"permissions"}}'

Path Parameters

permission_idstring(Required)

Collaboration ID

Request Body

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

The new role ID is provided to the user.

typestring(Required)

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

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

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "role_id": "5"
      },
      "type": "permissions"
    }
  }
                
Show full

Response Example

U038

U038

R012

R208

R220

COL005

200
200
401
405
422
Copied!
  {
    "data": {
      "id": "cjrrr81bad43595d94a5bbbb4ea1589ef9236-747938058",
      "type": "permissions",
      "attributes": {
        "email_id": "reyansh.ahuja@zylker.com",
        "shared_time_in_millis": 1618298370952,
        "shared_by": "Zylker Creation",
        "expiry_in_millis": 0,
        "relation_type": 0,
        "expiration_date": "Jan 1, 1970, 5:30 AM",
        "share_to_entity_info": {
          "display_name": "Zylker Creation",
          "email_id": "reyansh.ahuja@zylker.com",
          "avatar_url": "https://contacts.zoho.com/file?t=user&ID=747938058&fs=thumb&nps=404"
        },
        "share_to_member_type": 1,
        "role_id": 5,
        "shared_time_i18": "Apr 13, 12:49 PM",
        "shared_time": "Apr 13, 12:49 PM",
        "shared_status": "ACTIVE",
        "can_link_to_docs": true,
        "owner": "747937818",
        "allow_sharing_outside": false,
        "shared_type": "personal",
        "shared_to_entity": "Zylker Creation",
        "delete_from_propagated_space": false,
        "display_name": "Zylker Creation",
        "message": "",
        "share_to": "747938058",
        "is_expired": false,
        "shared_to_member_type": 1,
        "avatar_url": "https://contacts.zoho.com/file?t=user&ID=747938058&fs=thumb&nps=404",
        "is_password_protected": false,
        "resource_id": "cjrrr81bad43595d94a5bbbb4ea1589ef9236",
        "permalink": "https://www.zohoapis.com/workdrive/folder/cjrrr81bad43595d94a5bbbb4ea1589ef9236",
        "shared_by_zuid": "747938014"
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/permissions/cjrrr81bad43595d94a5bbbb4ea1589ef9236-747938058"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "U038",
        "title": "User is not allowed to give permission higher than their own permission"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R012",
        "title": "Resource is not in active status to process this action"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R208",
        "title": "Can not share libraries to user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R220",
        "title": "Can not change the role of a user with higher permission"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "COL005",
        "title": "The expiration date format should be in yyyy-mm-dd or yyyy-m-d hh:mm"
      }
    ]
  }
                
Show full