−

Create External Share Custom Link

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 creates a new external share link for a file or folder.

Endpoints

post https://www.zohoapis.com/workdrive/api/v1/links

Copy full URL

OAuth Scope

WorkDrive.links.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/links \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"request_user_data":true,"allow_download":true,"role_id":"7","resource_id":"cjrrr81bad43595d94a5bbbb4ea1589ef9236","input_fields":[{"field_type":"TEXT","is_name_field":true,"field_name":"Name"}],"password_text":"yourpassword","link_name":"notes","expiration_date":"2021-04-15 23:59:59"},"type":"links"}}'
header = Map();
header.put("Accept","application/vnd.api+json");
data=Map();
data_param1=Map();
att_param1=Map();
att_param1.put("request_user_data","true");
att_param1.put("allow_download","true");
att_param1.put("role_id","7");
att_param1.put("resource_id","cjrrr81bad43595d94a5bbbb4ea1589ef9236");
innerattr_param=List();
innerattr_param_map1=Map();
innerattr_param_map1.put("field_name","Name");
innerattr_param_map1.put("field_type","TEXT");
innerattr_param_map1.put("is_name_field","true");
innerattr_param.add(innerattr_param_map1);
att_param1.put("input_fields",innerattr_param);
att_param1.put("password_text","yourpassword");
att_param1.put("link_name","notes");
att_param1.put("expiration_date","2021-04-15 23:59:59");
data_param1.put("attributes",att_param1);
data_param1.put("type","links");
data.put("data",data_param1);
response = invokeurl
[
url : "https://www.zohoapis.com/workdrive/api/v1/links"
type : POST
parameters : data.toString()
headers : header
connection : "wdconnection"
];
info response;

Request Body

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

Set as "true", if the user's information like name, phone and email are required.

allow_downloadboolean(Required)

Set as "true" to allow the "download" option for the shared user.

role_idinteger(Required)

The ID that represents the role given to the shared user in the files/folders

  • 5 - Editor
  • 6 - View & Comment
  • 7 - Upload
  • 34 - Viewer

Note:
For folders:
Only Editor, Upload, and Viewer roles are supported.
For native files (Document, Spreadsheet, or Presentation):
Only Editor, View & Comment, and Viewer roles are supported.
For other files:
Only Viewer role is supported.

resource_idstring(Required)

The unique ID of the file/folder.

input_fieldsJSON Array(Optional)

If the request_user_data is set as true, then the allowed values for input_fields will be

  • for adding Name:
    "field_name":"Name",
    "field_type":"TEXT",
    "is_name_field" : true
  • for adding Phone number:"field_name":"Phone",
    "field_type":"PHONE"
  • for adding Email id:
    "field_name":"Email",
    "field_type":"EMAIL_ID"

Show Sub-Attributes
field_typestring(Optional)

Field data type. Supported values include TEXT, EMAIL_ID, PHONE.

is_name_fieldboolean(Optional)

Set true when this field captures the uploader name.

field_namestring(Optional)

User-visible field label.

password_textstring(Optional)

If set any text as password, the shared link can be accessed only with this password.

link_namestring(Required)

The name of the link to be shared.

expiration_datestring(Optional)

If set any date, the share link will be deactivated after the expiry date.

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

Note:
Where hh is hours in 24 hours format.

typestring(Required)

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

Allowed Values :
Show Values ▾
linksCopied!
Copied!Copy all as JSON Array

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "request_user_data": true,
        "allow_download": true,
        "role_id": "7",
        "resource_id": "cjrrr81bad43595d94a5bbbb4ea1589ef9236",
        "input_fields": [
          {
            "field_type": "TEXT",
            "is_name_field": true,
            "field_name": "Name"
          }
        ],
        "password_text": "yourpassword",
        "link_name": "notes",
        "expiration_date": "2021-04-15 23:59:59"
      },
      "type": "links"
    }
  }
                
▼ Show full

Response Example

R911

R233

R233

R234

R231

COL005

R909

R909

R265

R908

R262

F000

R906

R912

201
201
401
412
422
500
Copied!
  {
    "data": {
      "id": "3iWUoMURXKC-OCgNc",
      "type": "links",
      "attributes": {
        "modified_time_i18": "Apr 13, 1:16 PM",
        "created_time": "Apr 13, 1:16 PM",
        "expiration_date": "Apr 15, 11:59 PM",
        "expiration_date_in_millis": 1618511399000,
        "link": "https://workdrive.zohoexternal.com/external/3iWUoMURXKC-OCgNc",
        "input_fields": [],
        "type": "folder",
        "can_display_profile": false,
        "created_by": "Zylker Creation",
        "use_shorten_link": false,
        "created_time_i18": "Apr 13, 1:16 PM",
        "allow_download": true,
        "request_user_data": false,
        "link_type": "custom",
        "modified_time": "Apr 13, 1:16 PM",
        "is_expired": false,
        "role_id": 34,
        "download_url": "https://workdrive.zohoexternal.com/external/3iWUoMURXKC-OCgNc/download",
        "is_password_protected": true,
        "modified_by": "Zylker Creation",
        "resource_id": "cjrrr81bad43595d94a5bbbb4ea1589ef9236",
        "created_time_in_millis": 1618299960679,
        "link_name": "notes",
        "modified_time_in_millis": 1618299960679,
        "status": 1
      },
      "relationships": {
        "password": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/relationships/password",
            "related": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/password"
          }
        },
        "report": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/relationships/report",
            "related": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/report"
          }
        },
        "timeline": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/relationships/timeline",
            "related": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/timeline"
          }
        },
        "register": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/relationships/register",
            "related": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc/register"
          }
        }
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/links/3iWUoMURXKC-OCgNc"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "R911",
        "title": "External link sharing is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R233",
        "title": "Invalid field_name and field_type combination"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R234",
        "title": "Input_fields Required, when RequestUserData is enabled"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R231",
        "title": "Input_fields cannot be NUll or Empty, when RequestUserData is enabled"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "COL005",
        "title": "The expiration date format should be in yyyy-mm-dd or yyyy-m-d hh:mm"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R909",
        "title": "Link name cannot be null or empty"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R265",
        "title": "Password failed to satisfy policy settings made by team"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R908",
        "title": "Allow Download is restricted for View role from team folder settings"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R262",
        "title": "Team mandates password for all external links"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General exception"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R906",
        "title": "External sharing limit exceeded"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R912",
        "title": "download link creation disabled by settings"
      }
    ]
  }
                
▼ Show full

© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.