Share Files/Folders to Individual Team Members

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 share the files or folders with individual team members personally via their email ids.

Endpoints

OAuth Scope

WorkDrive.files.sharing.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/permissions \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"email_id":"reyansh.ahuja@zylker.com","shared_type":"personal","role_id":"5","send_notification_mail":true,"resource_id":"cjrrrbba68351fce045a986ea712783c38fe6","expiration_date":"1970-1-1 23:59:59"},"type":"permissions"}}'

Request Body

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

The email of the team members with whom the file needs to be shared.

shared_typestring(Required)

Should be "personal".

role_idinteger(Required)

Allowed role IDs for files:

  • 34 - View
  • 5 - Edit
  • 4 - Share
  • 6 - View and comment
  • 33 - View and fill
Allowed role IDS for folders:
  • 6 - View
  • 5 - Edit
  • 3 - Organize
  • 7 - Upload

send_notification_mailboolean(Required)

Set as 'true' if the notification mail needs to be sent to the team member who gets access to the file. Or set 'false'.

resource_idstring(Required)

The unique ID of the file/folder.

expiration_datestring(Optional)

Specifies when the personal share (via email) with individual team members should expire. After this date and time, access will be revoked.

  • format : "yyyy-mm-dd hh:mm:ss"

Note:
Where hh is hours in 24 hours format.

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": {
        "email_id": "reyansh.ahuja@zylker.com",
        "shared_type": "personal",
        "role_id": "5",
        "send_notification_mail": true,
        "resource_id": "cjrrrbba68351fce045a986ea712783c38fe6",
        "expiration_date": "1970-1-1 23:59:59"
      },
      "type": "permissions"
    }
  }
                
Show full

Response Example

R910

R910

R012

R914

R208

R913

R220

COL005

R955

R955

R952

R974

R953

R950

R214

R973

R971

R905

R708

R956

R253

R260

200
200
401
405
422
500
Copied!
  {
    "data": [
      {
        "id": "cjrrrbba68351fce045a986ea712783c38fe6-747938058",
        "type": "permissions",
        "attributes": {
          "email_id": "reyansh.ahuja@zylker.com",
          "shared_time_in_millis": 1618923400449,
          "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 20, 6:26 PM",
          "shared_time": "Apr 20, 6:26 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": "cjrrrbba68351fce045a986ea712783c38fe6",
          "permalink": "https://workdrive.zoho.com/file/cjrrrbba68351fce045a986ea712783c38fe6",
          "shared_by_zuid": "747938014"
        },
        "links": {
          "self": "https://www.zohoapis.com/workdrive/permissions/cjrrrbba68351fce045a986ea712783c38fe6-747938058"
        }
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R910",
        "title": "External User Email share is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R012",
        "title": "Resource is not in active status to process this action"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R914",
        "title": "External User Email share is allowed only for white listed domains and users"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R208",
        "title": "Can not share libraries to user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R913",
        "title": "Anyone on internet and publish share are not allowed"
      }
    ]
  }
                
  {
    "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"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R955",
        "title": "Sharing resource outside org with share permission is restricted."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R952",
        "title": "User doesn't provide permission for sharing to outside org user."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R974",
        "title": "External Sharing has been restricted via DLP Classification label\""
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R953",
        "title": "User doesn't provide permission for sharing to non zoho user."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R950",
        "title": "Insufficient permission to share to yourself"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R214",
        "title": "Unknown shareTo zuid / emailid"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R973",
        "title": "Warn on External Sharing has been enforced via DLP Classification label to external user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R971",
        "title": "Warn on External Sharing has been enforced via DLP Classification label to non zoho user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R905",
        "title": "External share is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R708",
        "title": "Group with mentioned id not available"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R956",
        "title": "Recieving resource from outside is restricted for Share_to user Org"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R253",
        "title": "Client user cannot perform any action on another client user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R260",
        "title": "Cross org share limit exceeded"
      }
    ]
  }
                
Show full