Node.js SDK for Zoho CRM API v2.0 providing OAuth authentication, multi-user support, and complete CRUD operations for CRM data
The Fields & Metadata module provides access to CRM module configurations, field definitions, picklist values, and other metadata essential for understanding the structure of your CRM data.
Access field definitions and metadata for CRM modules.
/**
* Operations for retrieving field metadata and configuration
*/
class FieldsOperations {
/**
* Get all fields for a specific module
* @param moduleAPIName - API name of the CRM module (e.g., "Leads", "Contacts", "Accounts")
* @returns Promise with APIResponse containing field definitions
*/
getFields(moduleAPIName: string): Promise<APIResponse>;
/**
* Get details of a specific field
* @param moduleAPIName - API name of the CRM module
* @param fieldId - Unique identifier of the field
* @returns Promise with APIResponse containing field details
*/
getField(moduleAPIName: string, fieldId: string): Promise<APIResponse>;
}Fields Operations Example:
const { FieldsOperations } = require("@zohocrm/nodejs-sdk-2.0/core/com/zoho/crm/api/fields/fields_operations");
// Get all fields for Leads module
const fieldsOperations = new FieldsOperations();
const fieldsResponse = await fieldsOperations.getFields("Leads");
if (fieldsResponse != null) {
const responseObject = fieldsResponse.object;
if (responseObject instanceof ResponseWrapper) {
const fields = responseObject.getFields();
fields.forEach(field => {
console.log(`Field: ${field.getAPIName()}, Type: ${field.getDataType()}`);
});
}
}
// Get specific field details
const fieldResponse = await fieldsOperations.getField("Leads", "123456789012345678");Access module configurations and metadata.
/**
* Operations for retrieving module metadata and configuration
*/
class ModulesOperations {
/**
* Get all modules in the CRM
* @param paramInstance - Optional parameters for filtering modules
* @param headerInstance - Optional headers for request customization
* @returns Promise with APIResponse containing module information
*/
getModules(paramInstance?: ParameterMap, headerInstance?: HeaderMap): Promise<APIResponse>;
/**
* Get details of a specific module
* @param moduleAPIName - API name of the CRM module
* @returns Promise with APIResponse containing module details
*/
getModule(moduleAPIName: string): Promise<APIResponse>;
/**
* Update module settings by API name
* @param moduleAPIName - API name of the CRM module
* @param request - Body wrapper containing module update data
* @returns Promise with APIResponse containing update results
*/
updateModuleByAPIName(moduleAPIName: string, request: BodyWrapper): Promise<APIResponse>;
/**
* Update module settings by module ID
* @param moduleId - Unique identifier of the module
* @param request - Body wrapper containing module update data
* @returns Promise with APIResponse containing update results
*/
updateModuleById(moduleId: string, request: BodyWrapper): Promise<APIResponse>;
}Modules Operations Example:
const { ModulesOperations } = require("@zohocrm/nodejs-sdk-2.0/core/com/zoho/crm/api/modules/modules_operations");
// Get all modules
const modulesOperations = new ModulesOperations();
const modulesResponse = await modulesOperations.getModules();
// Get specific module details
const moduleResponse = await modulesOperations.getModule("Leads");
if (moduleResponse != null) {
const responseObject = moduleResponse.object;
if (responseObject instanceof ResponseWrapper) {
const modules = responseObject.getModules();
modules.forEach(module => {
console.log(`Module: ${module.getAPIName()}, Plural: ${module.getPluralLabel()}`);
});
}
}Access page layout definitions and configuration for different CRM modules.
/**
* Operations for retrieving layout metadata and configuration
*/
class LayoutsOperations {
/**
* Creates a LayoutsOperations instance for a specific module
* @param module - Optional API name of the CRM module to filter layouts
*/
constructor(module?: string);
/**
* Get all layouts or layouts for a specific module
* @returns Promise with APIResponse containing layout definitions
*/
getLayouts(): Promise<APIResponse>;
/**
* Get details of a specific layout
* @param layoutId - Unique identifier of the layout
* @returns Promise with APIResponse containing layout details
*/
getLayout(layoutId: BigInt): Promise<APIResponse>;
}Layouts Operations Example:
const { LayoutsOperations } = require("@zohocrm/nodejs-sdk-2.0/core/com/zoho/crm/api/layouts/layouts_operations");
// Get all layouts for a specific module
const layoutsOp = new LayoutsOperations("Leads");
const layoutsResponse = await layoutsOp.getLayouts();
// Get a specific layout
const layoutResponse = await layoutsOp.getLayout(123456789012345678n);Access custom view definitions and filtering configurations for CRM modules.
/**
* Operations for retrieving custom view metadata and configuration
*/
class CustomViewsOperations {
/**
* Creates a CustomViewsOperations instance for a specific module
* @param module - Optional API name of the CRM module to filter views
*/
constructor(module?: string);
/**
* Get all custom views or views for a specific module
* @param paramInstance - Optional parameters for filtering custom views
* @returns Promise with APIResponse containing custom view definitions
*/
getCustomViews(paramInstance?: ParameterMap): Promise<APIResponse>;
/**
* Get details of a specific custom view
* @param customViewId - Unique identifier of the custom view
* @param paramInstance - Optional parameters for filtering
* @returns Promise with APIResponse containing custom view details
*/
getCustomView(customViewId: BigInt, paramInstance?: ParameterMap): Promise<APIResponse>;
}Custom Views Operations Example:
const { CustomViewsOperations } = require("@zohocrm/nodejs-sdk-2.0/core/com/zoho/crm/api/custom_views/custom_views_operations");
// Get all custom views for a specific module
const customViewsOp = new CustomViewsOperations("Leads");
const viewsResponse = await customViewsOp.getCustomViews();
// Get a specific custom view
const viewResponse = await customViewsOp.getCustomView(123456789012345678n);Access and manage business process workflows and automation rules for CRM records.
/**
* Operations for managing business process blueprints and workflows
*/
class BluePrintOperations {
/**
* Creates a BluePrintOperations instance for a specific record
* @param recordId - Unique identifier of the record
* @param moduleAPIName - API name of the CRM module
*/
constructor(recordId: BigInt, moduleAPIName: string);
/**
* Get blueprint details for the record
* @returns Promise with APIResponse containing blueprint information
*/
getBlueprint(): Promise<APIResponse>;
/**
* Update blueprint/workflow state for the record
* @param request - Body wrapper containing blueprint transition data
* @returns Promise with APIResponse containing update results
*/
updateBlueprint(request: BodyWrapper): Promise<APIResponse>;
}Blueprint Operations Example:
const { BluePrintOperations } = require("@zohocrm/nodejs-sdk-2.0/core/com/zoho/crm/api/blue_print/blue_print_operations");
// Get blueprint for a specific record
const blueprintOp = new BluePrintOperations(123456789012345678n, "Leads");
const blueprintResponse = await blueprintOp.getBlueprint();Comprehensive field definition with all metadata.
/**
* Represents a field definition in the CRM with all metadata
*/
class Field {
/** Get field ID */
getId(): string;
/** Set field ID */
setId(id: string): void;
/** Get field API name */
getAPIName(): string;
/** Set field API name */
setAPIName(apiName: string): void;
/** Get field display label */
getFieldLabel(): string;
/** Set field display label */
setFieldLabel(fieldLabel: string): void;
/** Get field data type */
getDataType(): string;
/** Set field data type */
setDataType(dataType: string): void;
/** Get field length */
getLength(): number;
/** Set field length */
setLength(length: number): void;
/** Get field precision (for decimal fields) */
getPrecision(): number;
/** Set field precision */
setPrecision(precision: number): void;
/** Check if field is mandatory */
getRequired(): boolean;
/** Set field as mandatory */
setRequired(required: boolean): void;
/** Check if field is custom */
getCustomField(): boolean;
/** Set custom field flag */
setCustomField(customField: boolean): void;
/** Get field default value */
getDefaultValue(): any;
/** Set field default value */
setDefaultValue(defaultValue: any): void;
/** Get field tooltip */
getTooltip(): ToolTip;
/** Set field tooltip */
setTooltip(tooltip: ToolTip): void;
/** Get field creation time */
getCreatedTime(): Date;
/** Get field modification time */
getModifiedTime(): Date;
/** Get picklist values (for picklist fields) */
getPickListValues(): PickListValue[];
/** Set picklist values */
setPickListValues(pickListValues: PickListValue[]): void;
/** Get auto number configuration (for auto-number fields) */
getAutoNumber(): AutoNumber;
/** Set auto number configuration */
setAutoNumber(autoNumber: AutoNumber): void;
/** Get lookup field configuration (for lookup fields) */
getLookup(): LookupField;
/** Set lookup field configuration */
setLookup(lookup: LookupField): void;
/** Get multi-select lookup configuration */
getMultiSelectLookup(): MultiSelectLookup;
/** Set multi-select lookup configuration */
setMultiSelectLookup(multiSelectLookup: MultiSelectLookup): void;
/** Check if field is read-only */
getReadOnly(): boolean;
/** Set read-only flag */
setReadOnly(readOnly: boolean): void;
/** Check if field supports mass update */
getMassUpdate(): boolean;
/** Set mass update support */
setMassUpdate(massUpdate: boolean): void;
/** Get field blueprint configuration */
getBlueprint(): any;
/** Set field blueprint configuration */
setBlueprint(blueprint: any): void;
/** Get multi-user lookup configuration */
getMultiUserLookup(): any;
/** Set multi-user lookup configuration */
setMultiUserLookup(multiUserLookup: any): void;
/** Get currency field configuration */
getCurrency(): Currency;
/** Set currency field configuration */
setCurrency(currency: Currency): void;
/** Get formula field configuration */
getFormula(): Formula;
/** Set formula field configuration */
setFormula(formula: Formula): void;
/** Get field visibility */
getVisible(): boolean;
/** Set field visibility */
setVisible(visible: boolean): void;
/** Get field profiles (who can see this field) */
getProfiles(): Profile[];
/** Set field profiles */
setProfiles(profiles: Profile[]): void;
}Configuration for picklist and multi-select picklist fields.
/**
* Represents a picklist value option
*/
class PickListValue {
/** Get picklist value display name */
getDisplayValue(): string;
/** Set picklist value display name */
setDisplayValue(displayValue: string): void;
/** Get actual picklist value */
getActualValue(): string;
/** Set actual picklist value */
setActualValue(actualValue: string): void;
/** Get sequence number */
getSequenceNumber(): number;
/** Set sequence number */
setSequenceNumber(sequenceNumber: number): void;
/** Get expected data type */
getExpectedDataType(): string;
/** Set expected data type */
setExpectedDataType(expectedDataType: string): void;
/** Get maps for dependent picklists */
getMaps(): any[];
/** Set maps for dependent picklists */
setMaps(maps: any[]): void;
}Configuration for lookup and multi-lookup fields.
/**
* Lookup field configuration
*/
class LookupField {
/** Get lookup module */
getModule(): string;
/** Set lookup module */
setModule(module: string): void;
/** Get display label */
getDisplayLabel(): string;
/** Set display label */
setDisplayLabel(displayLabel: string): void;
/** Get API name */
getAPIName(): string;
/** Set API name */
setAPIName(apiName: string): void;
/** Get lookup field ID */
getId(): string;
/** Set lookup field ID */
setId(id: string): void;
}
/**
* Multi-select lookup field configuration
*/
class MultiSelectLookup {
/** Get display label */
getDisplayLabel(): string;
/** Set display label */
setDisplayLabel(displayLabel: string): void;
/** Get linking module */
getLinkingModule(): string;
/** Set linking module */
setLinkingModule(linkingModule: string): void;
/** Get lookup API name */
getLookupApiname(): string;
/** Set lookup API name */
setLookupApiname(lookupApiname: string): void;
/** Get API name */
getAPIName(): string;
/** Set API name */
setAPIName(apiName: string): void;
/** Get connected module */
getConnectedModule(): string;
/** Set connected module */
setConnectedModule(connectedModule: string): void;
/** Get ID */
getId(): string;
/** Set ID */
setId(id: string): void;
}Comprehensive module configuration and metadata.
/**
* Represents a CRM module with all configuration and metadata
*/
class Module {
/** Get module ID */
getId(): string;
/** Set module ID */
setId(id: string): void;
/** Get module API name */
getAPIName(): string;
/** Set module API name */
setAPIName(apiName: string): void;
/** Get module display name (singular) */
getSingularLabel(): string;
/** Set module display name (singular) */
setSingularLabel(singularLabel: string): void;
/** Get module display name (plural) */
getPluralLabel(): string;
/** Set module display name (plural) */
setPluralLabel(pluralLabel: string): void;
/** Check if module is creatable */
getCreatable(): boolean;
/** Set creatable flag */
setCreatable(creatable: boolean): void;
/** Check if module is editable */
getEditable(): boolean;
/** Set editable flag */
setEditable(editable: boolean): void;
/** Check if module is deletable */
getDeletable(): boolean;
/** Set deletable flag */
setDeletable(deletable: boolean): void;
/** Check if module is viewable */
getViewable(): boolean;
/** Set viewable flag */
setViewable(viewable: boolean): void;
/** Check if module supports API names */
getAPISupported(): boolean;
/** Set API supported flag */
setAPISupported(apiSupported: boolean): void;
/** Check if module is custom */
getCustomModule(): boolean;
/** Set custom module flag */
setCustomModule(customModule: boolean): void;
/** Get scoring supported flag */
getScoringSupported(): boolean;
/** Set scoring supported flag */
setScoringSupported(scoringSupported: boolean): void;
/** Get webform supported flag */
getWebformSupported(): boolean;
/** Set webform supported flag */
setWebformSupported(webformSupported: boolean): void;
/** Get module arguments */
getArguments(): Argument[];
/** Set module arguments */
setArguments(arguments: Argument[]): void;
/** Get module parent module */
getParentModule(): string;
/** Set module parent module */
setParentModule(parentModule: string): void;
/** Get business card field limit */
getBusinessCardFieldLimit(): number;
/** Set business card field limit */
setBusinessCardFieldLimit(limit: number): void;
/** Get related list properties */
getRelatedListProperties(): RelatedListProperties;
/** Set related list properties */
setRelatedListProperties(properties: RelatedListProperties): void;
/** Get module properties */
getProperties(): string[];
/** Set module properties */
setProperties(properties: string[]): void;
/** Get per page count */
getPerPage(): number;
/** Set per page count */
setPerPage(perPage: number): void;
/** Get module visibility */
getVisibility(): number;
/** Set module visibility */
setVisibility(visibility: number): void;
/** Check if module is convertable */
getConvertable(): boolean;
/** Set convertable flag */
setConvertable(convertable: boolean): void;
/** Check if module supports email template */
getEmailtemplateSupport(): boolean;
/** Set email template support */
setEmailtemplateSupport(emailtemplateSupport: boolean): void;
/** Get module profiles */
getProfiles(): Profile[];
/** Set module profiles */
setProfiles(profiles: Profile[]): void;
/** Check if module supports filter status */
getFilterStatus(): boolean;
/** Set filter status */
setFilterStatus(filterStatus: boolean): void;
/** Get inventory template supported */
getInventoryTemplateSupported(): boolean;
/** Set inventory template supported */
setInventoryTemplateSupported(inventoryTemplateSupported: boolean): void;
/** Get modified time */
getModifiedTime(): Date;
/** Set modified time */
setModifiedTime(modifiedTime: Date): void;
/** Get modified by user */
getModifiedBy(): User;
/** Set modified by user */
setModifiedBy(modifiedBy: User): void;
}Common field data types and module properties.
/**
* Field data type constants
*/
class DataType {
static TEXT: string = "text";
static TEXTAREA: string = "textarea";
static PICKLIST: string = "picklist";
static MULTISELECTPICKLIST: string = "multiselectpicklist";
static INTEGER: string = "integer";
static BIGINT: string = "bigint";
static DOUBLE: string = "double";
static CURRENCY: string = "currency";
static DECIMAL: string = "decimal";
static BOOLEAN: string = "boolean";
static DATE: string = "date";
static DATETIME: string = "datetime";
static LOOKUP: string = "lookup";
static MULTISELECTLOOKUP: string = "multiselectlookup";
static EMAIL: string = "email";
static PHONE: string = "phone";
static URL: string = "url";
static AUTONUMBER: string = "autonumber";
static FORMULA: string = "formula";
static FILEUPLOAD: string = "fileupload";
}
/**
* Module property constants
*/
class ModuleProperty {
static CONVERTABLE: string = "convertable";
static EDITABLE: string = "editable";
static DELETABLE: string = "deletable";
static API_SUPPORTED: string = "api_supported";
static CUSTOM_MODULE: string = "custom_module";
static WEBFORM_SUPPORTED: string = "webform_supported";
static SCORING_SUPPORTED: string = "scoring_supported";
}Install with Tessl CLI
npx tessl i tessl/npm-zohocrm--nodejs-sdk-2-0