Custom Fields APIs
Zoho Directory lets you create your own fields to capture additional user data. Not just create, you can also configure those field's settings. Use the following APIs to manage custom fields.
End Points
Get all custom fields in the organization
Get all custom fields in the organization
Fetches all the custom fields created for the given organization.
OAuth Scope : ZohoDirectory.Orgs.READ
Path Parameters
org_id
string
(Required)
The unique identifier of the org.
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://zohoapis.com/directory/api/v2/orgs/987000000654321/fields")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://zohoapis.com/directory/api/v2/orgs/987000000654321/fields"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
const http = require("https");
const options = {
"method": "GET",
"hostname": "zohoapis.com",
"port": null,
"path": "/directory/api/v2/orgs/987000000654321/fields",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
import http.client
conn = http.client.HTTPSConnection("zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/directory/api/v2/orgs/987000000654321/fields", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --request GET \
--url https://zohoapis.com/directory/api/v2/orgs/987000000654321/fields \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"status_code": 200,
"resource_name": "fields",
"fields": [
{
"field_id": "2xxxxxxxxxxxxxxxx3",
"field_name": "temporary",
"field_type": "String",
"default_value": "Sample",
"is_mandatory": true,
"is_phi_enabled": true,
"is_encrypt": true,
"tooltip_text": "Sample Value",
"tooltip_type": 1,
"created_time": "2024-xx-14T14:57:42.617+0530",
"modified_time": "2025-01-22T15:41:32.487+0530",
"max_allowed_chars": 255,
"is_custom_field": true,
"is_enabled": true,
"modified_by": "Sample Value",
"user_editable": "Sample Value",
"picklist_options": [
{
"picklist_id": "2xxxxxxxx3",
"picklist_value": "Temp"
}
]
},
{...},
{...}
]
}
{
"status_code": 401,
"error_code": "INVALID_TOKEN",
"message": "Authentication required."
}
{
"status_code": 403,
"error_code": "no_permission",
"message": "If the user does not have the required permission to access fields"
}
{
"status_code": 404,
"error_code": "RESOURCE_NOT_FOUND",
"message": "The requested resource was not found."
}