Zoho CRM Territories

Territories. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 15 operation(s).

OpenAPI Specification

zoho-crm-territories-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Territories",
    "description": "Territories",
    "version": "8.0"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API Version"
        }
      }
    }
  ],
  "security": [
    {
      "iam-oauth2-schema": [
        "ZohoCRM.settings.territories.ALL",
        "ZohoCRM.modules.UPDATE"
      ]
    }
  ],
  "paths": {
    "/settings/territories": {
      "get": {
        "summary": "Get all territories",
        "description": "Retrieves a list of territories.",
        "operationId": "getAllTerritories",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.READ"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Include",
            "description": "Include account_rule_criteria, lead_rule_criteria (or) deal_rule_criteria."
          },
          {
            "$ref": "#/components/parameters/Ids",
            "description": "List of Territory Ids"
          },
          {
            "$ref": "#/components/parameters/Page",
            "description": "Page Numeber"
          },
          {
            "$ref": "#/components/parameters/PerPage",
            "description": "Per Page Number"
          },
          {
            "$ref": "#/components/parameters/Filters",
            "description": "Filter Out the Territories based on Given Criteria"
          },
          {
            "$ref": "#/components/parameters/IncludeInnerDetails",
            "description": "Include manager status & zuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "territories": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TerritoryGETSchema",
                            "description": "The `items` field of type `object`."
                          },
                          "description": "The `territories` property.",
                          "maxItems": 200
                        },
                        "info": {
                          "$ref": "#/components/schemas/InfoSchema",
                          "x-zs-$id": "InfoGET",
                          "description": "The `info` property."
                        }
                      },
                      "required": [
                        "territories",
                        "info"
                      ],
                      "additionalProperties": false,
                      "description": "The `schema` field."
                    },
                    {
                      "type": "object",
                      "properties": {
                        "territories": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TerritoryGETSchema",
                            "description": "The `items` field of type `object`."
                          },
                          "description": "The `territories` property.",
                          "maxItems": 200
                        }
                      },
                      "required": [
                        "territories"
                      ],
                      "additionalProperties": false,
                      "description": "The `schema` field."
                    }
                  ]
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "FiltersErrorResponse",
                  "$ref": "#/components/schemas/NotSupportedFieldsInFilters",
                  "description": "The `GetAllTerritoriesErrorResponseSchema` error."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "GetAllTerritoriesErrorResponseSchema",
                  "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                  "description": "The `GetAllTerritoriesErrorResponseSchema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "GetAllTerritoriesInternalServerErrorSchema",
                  "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                  "description": "The `TerritoryInternalServerErrorSchema` field."
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createTerritories",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.CREATE"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "territories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "manager": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "The `id` property.",
                                  "maxLength": 100
                                }
                              },
                              "description": "The `manager` property.",
                              "additionalProperties": false
                            },
                            {
                              "type": "string",
                              "const": null,
                              "description": "The `manager` property."
                            }
                          ]
                        },
                        "reporting_to": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The `id` property.",
                              "maxLength": 100
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "description": "The `reporting_to` property.",
                          "additionalProperties": false
                        },
                        "permission_type": {
                          "type": "string",
                          "enum": [
                            "read_write_delete",
                            "read_only"
                          ],
                          "description": "The `permission_type` property."
                        },
                        "description": {
                          "type": "string",
                          "description": "The `description` property.",
                          "maxLength": 100
                        },
                        "account_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "x-zs-$id": "AccountRuleCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "x-zs-$id": "AccountRuleGroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `account_rule_criteria` property."
                        },
                        "deal_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "x-zs-$id": "DealRuleCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "x-zs-$id": "DealRuleGroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `deal_rule_criteria` property."
                        },
                        "lead_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `lead_rule_criteria` property."
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 50,
                          "description": "The `name` property."
                        }
                      },
                      "required": [
                        "reporting_to",
                        "permission_type",
                        "name"
                      ],
                      "description": "The `items` field of type `object`.",
                      "additionalProperties": false
                    },
                    "description": "The `territories` property.",
                    "maxItems": 100
                  }
                },
                "description": "The `schema` field of type `object`.",
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "description": "The `requestBody` field."
        },
        "responses": {
          "201": {
            "description": "Territory Create Success response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryCreateSuccessResponseSchema",
                  "$ref": "#/components/schemas/TerritorySuccessResponse",
                  "description": "Territory Create Success response."
                }
              }
            }
          },
          "400": {
            "description": "Territory Create Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/InvalidData",
                      "description": "Invalid data error."
                    },
                    {
                      "$ref": "#/components/schemas/InvalidDataWithSupportedValues",
                      "description": "InvalidDataWithSupportedValues"
                    },
                    {
                      "$ref": "#/components/schemas/DuplicateDataError",
                      "description": "DuplicateDataError"
                    },
                    {
                      "$ref": "#/components/schemas/MandatoryNotFoundError",
                      "description": "MandatoryNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/TerritoryMaxLimitExceededErrorSchema",
                      "description": "Limit Exceeds."
                    },
                    {
                      "$ref": "#/components/schemas/TerritoryMaxLimitExceededErrorSchemaForCriteria",
                      "description": "Territory MaxLimit Exceeded Error For Criteria"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidDataWithMaximumLength",
                      "description": "Invalid Data With Maximum Length"
                    },
                    {
                      "$ref": "#/components/schemas/NotSupportedForCriteriaOnModuleDisable",
                      "description": "Not Supported For Criteria On Module Disable"
                    },
                    {
                      "$ref": "#/components/schemas/PermissionDeniedWithoutId",
                      "description": "Permission Denied"
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "GetAllTerritoriesErrorResponseSchema",
                  "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                  "description": "The `GetAllTerritoriesErrorResponseSchema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryCreateInternalServerErrorSchema",
                  "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                  "description": "Internal server error."
                }
              }
            }
          }
        },
        "summary": "Create Territories",
        "description": "Auto-generated description for operation `Create Territories`."
      },
      "put": {
        "operationId": "updateTerritory",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "territories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "manager": {
                          "x-zs-$id": "MangerIdPUT",
                          "$ref": "#/components/schemas/ManagerSchema",
                          "description": "The `manager` property."
                        },
                        "reporting_to": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The `id` property.",
                              "maxLength": 100
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "description": "The `reporting_to` property.",
                          "additionalProperties": false
                        },
                        "permission_type": {
                          "type": "string",
                          "enum": [
                            "read_write_delete",
                            "read_only"
                          ],
                          "description": "The `permission_type` property."
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The `description` property.",
                          "maxLength": 100
                        },
                        "id": {
                          "type": "string",
                          "description": "The `id` property.",
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 50,
                          "description": "The `name` property."
                        },
                        "account_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `account_rule_criteria` property."
                        },
                        "deal_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `deal_rule_criteria` property."
                        },
                        "lead_rule_criteria": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/CriteriaObject",
                              "description": "No description provided."
                            },
                            {
                              "$ref": "#/components/schemas/GroupCriteriaPOST",
                              "description": "No description provided."
                            },
                            {
                              "type": [
                                "string",
                                "null"
                              ],
                              "const": null,
                              "description": "Literal string \"null\" when not configured"
                            }
                          ],
                          "description": "The `lead_rule_criteria` property."
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "description": "The `items` field of type `object`.",
                      "additionalProperties": false
                    },
                    "description": "The `territories` property.",
                    "maxItems": 100
                  }
                },
                "description": "The `schema` field of type `object`.",
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "description": "The `requestBody` field."
        },
        "responses": {
          "200": {
            "description": "Territory Update Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryUpdateSuccessResponseSchema",
                  "$ref": "#/components/schemas/TerritorySuccessResponse",
                  "description": "No description provided."
                }
              }
            }
          },
          "400": {
            "description": "Client error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/InvalidData",
                      "description": "Invalid data error."
                    },
                    {
                      "$ref": "#/components/schemas/InvalidDataWithSupportedValues",
                      "description": "InvalidDataWithSupportedValues"
                    },
                    {
                      "$ref": "#/components/schemas/DuplicateDataError",
                      "description": "DuplicateDataError"
                    },
                    {
                      "$ref": "#/components/schemas/PermissionDeniedWithoutId",
                      "description": "Permission Denied"
                    },
                    {
                      "$ref": "#/components/schemas/MandatoryNotFoundError",
                      "description": "MandatoryNotFoundError"
                    },
                    {
                      "$ref": "#/components/schemas/TerritoryMaxLimitExceededErrorSchemaForCriteria",
                      "description": "Territory MaxLimit Exceeded Error For Criteria"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidDataWithMaximumLength",
                      "description": "Invalid Data With Maximum Length"
                    },
                    {
                      "$ref": "#/components/schemas/NotSupportedForCriteriaOnModuleDisable",
                      "description": "Not Supported For Criteria On Module Disable"
                    },
                    {
                      "$ref": "#/components/schemas/PermissionDeniedOrgTerritory",
                      "description": "Permission Denied for delete / update the OrgTerritory"
                    },
                    {
                      "$ref": "#/components/schemas/NotAllowedOrgTerritoryUpdate",
                      "description": "Org Territory Not Allowed Update"
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoriesErrorResponseSchema",
                  "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                  "description": "The `TerritoriesErrorResponseSchema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryUpdateInternalServerErrorSchema",
                  "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                  "description": "Internal server error."
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.UPDATE"
            ]
          }
        ],
        "summary": "Update Territory",
        "description": "Auto-generated description for operation `Update Territory`."
      },
      "delete": {
        "operationId": "deleteTerritories",
        "parameters": [
          {
            "$ref": "#/components/parameters/Ids",
            "description": "Parameter `ids` in `query`."
          },
          {
            "$ref": "#/components/parameters/DeletePreviousForecasts",
            "description": "Delete Previous Forecasts for these territories"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryDeleteByIdsSuccessResponseSchema",
                  "$ref": "#/components/schemas/TerritorySuccessResponse",
                  "description": "No description provided."
                }
              }
            }
          },
          "400": {
            "description": "Client error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/NotAllowedDeleteErrorResponse",
                      "description": "Not Allowed Delete Error Response"
                    },
                    {
                      "$ref": "#/components/schemas/RequiredParamMissing",
                      "description": "Required Param Ids Missing"
                    },
                    {
                      "$ref": "#/components/schemas/InvalidDataWithId",
                      "description": "Invalid Data With Id"
                    },
                    {
                      "$ref": "#/components/schemas/PermissionDeniedOrgTerritory",
                      "description": "Permission Denied for delete / update the OrgTerritory"
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoriesErrorResponseSchema",
                  "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                  "description": "The `TerritoriesErrorResponseSchema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryDeleteByIdsInternalServerErrorSchema",
                  "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                  "description": "Internal server error."
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.DELETE"
            ]
          }
        ],
        "summary": "Delete Territories",
        "description": "Auto-generated description for operation `Delete Territories`."
      }
    },
    "/settings/territories/{id}": {
      "get": {
        "operationId": "getTerritory",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.READ"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id",
            "description": "No description provided."
          },
          {
            "$ref": "#/components/parameters/IncludeInnerDetails",
            "description": "No description provided."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryByIDSuccessResponseSchemaWrapper",
                  "$ref": "#/components/schemas/TerritoryGetByIdSchema",
                  "description": "The `schema` field."
                }
              }
            }
          },
          "204": {
            "description": "Successful response."
          },
          "400": {
            "description": "Client error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryGetErrorResponseSchemaById",
                  "$ref": "#/components/schemas/TerritoryInvalidUrlPathErrorSchema",
                  "description": "Invalid Id Url Path Error Schema"
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryByIDErrorResponseSchema",
                  "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                  "description": "Territory Not yet Enabled."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "x-zs-$id": "TerritoryByIDInternalServerErrorSchema",
                  "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                  "description": "Internal server error."
                }
              }
            }
          }
        },
        "summary": "Get Territory",
        "description": " `Get Territory By Id`"
      },
      "put": {
        "operationId": "updateTerritoryById",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.territories.UPDATE"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id",
            "description": "No description provided."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "territories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "manager": {
                          "oneOf": [
                            {
                         

# --- truncated at 32 KB (226 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoho-crm/refs/heads/main/openapi/zoho-crm-territories-openapi.json