Beam Help
Get help now

How-to · Zoho DESK

How to get field validation rules in Zoho Desk

Retrieve validation rules applied to a specific field.

Retrieving field validation rules in Zoho Desk is straightforward once you know which API endpoints to call and what parameters each one requires.


Why this matters


When building integrations or automations on top of Zoho Desk, you often need to inspect the validation logic attached to specific fields or entire layouts before submitting data. Without querying these rules first, your integration may silently fail or produce confusing errors. Understanding the available endpoints lets you audit, replicate, or conditionally enforce validation logic in your own code.


Step-by-step


Step 1. Ensure your OAuth token includes the correct scopes.


Before making any API call, confirm that your OAuth credentials include at minimum Desk.settings.READ (or Desk.settings.ALL). The Zoho Desk OAuth configuration recognises a range of scopes covering tickets, contacts, tasks, and settings — the settings family is what governs organisation field and validation rule access. [3]


Step 2. Retrieve validation rules for a specific organisation field.


Send a GET request to the following endpoint, substituting the target module name and field ID:


GET /api/v1/organizationFields/{moduleName}/{fieldId}/validations

  • moduleName — the API name of the module (e.g., tickets, contacts).
  • fieldId — the unique identifier of the field whose rules you want to inspect.
  • p — an optional dictionary of additional query parameters.

A minimal Python call looks like this:


result = client.get_field_validation_rules(
    moduleName="tickets",
    fieldId="<your_field_id>"
)

The response will contain the validation rules currently configured for that field. [1]


Step 3. Retrieve layout-level validation rules for a department.


If you need validation rules scoped to an entire layout rather than a single field, use the layout validation endpoint instead:


GET /api/v1/validationRules

Pass any relevant query parameters (such as department ID or layout ID) inside the p dictionary. This returns all layout validation rules configured for the specified department. [6]


result = client.get_layout_validation_rules_for(
    p={"departmentId": "<your_department_id>"}
)

Step 4. List the criteria fields available for validation rules.


Before building or auditing criteria-based rules, you may want to know which fields can actually be used as criteria. Call:


GET /api/v1/validationRules/criteriaFields

This endpoint lists every field eligible to serve as a criterion in department or layout validation rules. Pass optional query parameters via p to filter by department or layout context. [5][7]


criteria = client.list_criteria_fields_for_department()

Step 5. (Optional) Update field validation rules after reviewing them.


Once you have inspected the existing rules and confirmed what needs to change, you can push updates using a PATCH request to the same field-level endpoint:


PATCH /api/v1/organizationFields/{moduleName}/{fieldId}/validations

Supply the updated rule definitions inside the data dictionary. [2]


client.update_field_validation_rules(
    moduleName="tickets",
    fieldId="<your_field_id>",
    data={"validations": [...]}
)

Common pitfalls


  • Authentication errors (HTTP 401): If the API returns a 401 status, your OAuth token has likely expired or was generated without the required scopes. Reconnect and regenerate the token with Desk.settings.READ included. [3]
  • Invalid module name: Passing an unrecognised moduleName value will cause the request to fail. Double-check the exact API name of the module — common values include tickets and contacts, but custom modules may differ. [1]
  • Confusing field-level vs. layout-level endpoints: The field-level endpoint (/organizationFields/{moduleName}/{fieldId}/validations) targets a single field, while /validationRules targets an entire layout or department. Using the wrong one will return an empty or unexpected result. [1][6]

What to check


  • Confirm your OAuth token was issued with Desk.settings.READ or Desk.settings.ALL before making any validation-related call. [3]
  • Verify that the moduleName and fieldId values you are passing match the actual API names returned by the organisation fields listing endpoint. [1]
  • After retrieving rules, cross-reference the criteria fields list (/api/v1/validationRules/criteriaFields) to ensure any field you plan to use in a rule is actually eligible as a criterion. [5]

---


*Beam Help provides independent expert support for Zoho — we are not official Zoho support. For platform-level issues, always raise a ticket directly with Zoho.*

Sources cited

  1. [1] GET /api/v1/organizationFields/{moduleName}/{fieldId}/validations
  2. [2] PATCH /api/v1/organizationFields/{moduleName}/{fieldId}/validations
  3. [3] config.py
  4. [4] server.py: _clarifying_question_from_tool_error
  5. [5] GET /api/v1/validationRules/criteriaFields
  6. [6] GET /api/v1/validationRules
  7. [7] GET /api/v1/validationRules/criteriaFields
Get Field Validation Rules | Beam Help