Zoho CRM Territory Users

Manage users assigned to territories. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 6 operation(s).

OpenAPI Specification

zoho-crm-territory-users-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Territory Users",
    "description": "Manage users assigned to territories.",
    "version": "8"
  },
  "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"
        }
      }
    }
  ],
  "paths": {
    "/settings/territories/{territory}/users": {
      "get": {
        "operationId": "getTerritoryUsers",
        "description": "Return users for a territory.",
        "summary": "List territory users",
        "parameters": [
          {
            "name": "territory",
            "description": "The ID of the territory.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "description": "The `schema` field of type `string`."
            }
          }
        ],
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.READ",
              "ZohoCRM.settings.territories.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "users": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "$ref": "#/components/schemas/User",
                        "description": "The `items` field."
                      },
                      "description": "The `users` property."
                    },
                    "info": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "per_page": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `per_page` property."
                        },
                        "count": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `count` property."
                        },
                        "page": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `page` property."
                        },
                        "more_records": {
                          "type": "boolean",
                          "description": "The `more_records` property."
                        }
                      },
                      "required": [
                        "per_page",
                        "count",
                        "page",
                        "more_records"
                      ],
                      "description": "The `info` property."
                    }
                  },
                  "required": [
                    "users",
                    "info"
                  ],
                  "description": "The `schema` field of type `object`."
                }
              }
            }
          },
          "204": {
            "description": "No content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvalidErrorSchemaInURL",
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                      "description": "Territory Not yet Enabled."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                      "description": "Internal server error."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "associateUsersToTerritory",
        "description": "Add users to a territory.",
        "summary": "Add users",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "parameters": [
          {
            "name": "territory",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "description": "The `schema` field of type `string`."
            },
            "description": "Parameter `territory` in `path`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "users": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "maxLength": 100,
                          "description": "The `id` property."
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "description": "The `items` field of type `object`."
                    },
                    "description": "The `users` property."
                  }
                },
                "required": [
                  "users"
                ],
                "description": "The `schema` field of type `object`."
              }
            }
          },
          "description": "The `requestBody` field."
        },
        "responses": {
          "200": {
            "description": "Successful add",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "users": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "code": {
                            "type": "string",
                            "enum": [
                              "SUCCESS"
                            ],
                            "description": "The `code` property."
                          },
                          "details": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string",
                                "maxLength": 100,
                                "description": "The `id` property."
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "description": "The `details` property."
                          },
                          "message": {
                            "type": "string",
                            "maxLength": 250,
                            "description": "The `message` property."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "success"
                            ],
                            "description": "The `status` property."
                          }
                        },
                        "required": [
                          "code",
                          "details",
                          "message",
                          "status"
                        ],
                        "description": "User operation result."
                      },
                      "description": "The `users` property."
                    }
                  },
                  "required": [
                    "users"
                  ],
                  "description": "The `schema` field of type `object`."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvalidErrorSchemaOnRequestBody",
                      "description": "A `object` value."
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "description": "A `object` value.",
                      "properties": {
                        "users": {
                          "type": "array",
                          "maxItems": 100,
                          "items": {
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/TerritoryUsersLimitExceededErrorSchema",
                                "description": "A `object` value."
                              }
                            ]
                          },
                          "description": "The `users` property."
                        }
                      }
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                      "description": "Territory Not yet Enabled."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INTERNAL_SERVER_ERROR"
                          ],
                          "description": "The `code` property."
                        },
                        "details": {
                          "type": "object",
                          "description": "The `details` property.",
                          "additionalProperties": false
                        },
                        "message": {
                          "type": "string",
                          "description": "The `message` property.",
                          "maxLength": 100
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "error"
                          ],
                          "description": "The `status` property."
                        }
                      },
                      "required": [
                        "code",
                        "details",
                        "message",
                        "status"
                      ],
                      "description": "A `object` value.",
                      "additionalProperties": false
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deassociateUsersFromTerritories",
        "description": "Remove users from a territory.",
        "summary": "Remove users",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Territory",
            "description": "Territory Id Param in URL"
          },
          {
            "$ref": "#/components/parameters/Ids",
            "description": "Ids to be removed from territory"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful remove",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "users": {
                          "type": "array",
                          "maxItems": 100,
                          "items": {
                            "oneOf": [
                              {
                                "type": "array",
                                "maxItems": 100,
                                "items": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "code": {
                                      "type": "string",
                                      "enum": [
                                        "SUCCESS"
                                      ],
                                      "description": "The `code` property."
                                    },
                                    "details": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "maxLength": 100,
                                          "description": "The `id` property."
                                        }
                                      },
                                      "required": [
                                        "id"
                                      ],
                                      "description": "The `details` property."
                                    },
                                    "message": {
                                      "type": "string",
                                      "maxLength": 250,
                                      "description": "The `message` property."
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "success"
                                      ],
                                      "description": "The `status` property."
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "details",
                                    "message",
                                    "status"
                                  ],
                                  "description": "The `items` field of type `object`."
                                },
                                "description": "A `array` value."
                              }
                            ],
                            "description": "The `items` field."
                          },
                          "description": "The `users` property."
                        }
                      },
                      "required": [
                        "users"
                      ],
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvalidErrorSchemaOnRequestBody",
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                      "description": "Territory Not yet Enabled."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INTERNAL_SERVER_ERROR"
                          ],
                          "description": "The `code` property."
                        },
                        "details": {
                          "type": "object",
                          "description": "The `details` property.",
                          "additionalProperties": false
                        },
                        "message": {
                          "type": "string",
                          "description": "The `message` property.",
                          "maxLength": 100
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "error"
                          ],
                          "description": "The `status` property."
                        }
                      },
                      "required": [
                        "code",
                        "details",
                        "message",
                        "status"
                      ],
                      "description": "A `object` value.",
                      "additionalProperties": false
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          }
        }
      }
    },
    "/settings/territories/{territory}/users/{user}": {
      "get": {
        "operationId": "getUserDetailsFromTerritory",
        "summary": "Get user details",
        "description": "Return a specific user in a territory.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Territory",
            "description": "Territory Id Param in URL"
          },
          {
            "$ref": "#/components/parameters/User",
            "description": "User Id Param in URL"
          }
        ],
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.READ",
              "ZohoCRM.settings.territories.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "users": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "$ref": "#/components/schemas/User",
                        "description": "The `items` field."
                      },
                      "description": "The `users` property."
                    },
                    "info": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "per_page": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `per_page` property."
                        },
                        "count": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `count` property."
                        },
                        "page": {
                          "type": "integer",
                          "format": "int32",
                          "description": "The `page` property."
                        },
                        "more_records": {
                          "type": "boolean",
                          "description": "The `more_records` property."
                        }
                      },
                      "required": [
                        "per_page",
                        "count",
                        "page",
                        "more_records"
                      ],
                      "description": "The `info` property."
                    }
                  },
                  "required": [
                    "users",
                    "info"
                  ],
                  "description": "The `schema` field of type `object`."
                }
              }
            }
          },
          "204": {
            "description": "No content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvalidErrorSchemaInURL",
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                      "description": "Territory Not yet Enabled."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                      "description": "Internal server error."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "associateUserToSpecificTerritory",
        "summary": "Add specific user",
        "description": "Add a specific user to a territory.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Territory",
            "description": "Territory Id Param in URL"
          },
          {
            "$ref": "#/components/parameters/User",
            "description": "User Id Param in URL"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful add",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "users": {
                          "type": "array",
                          "maxItems": 100,
                          "items": {
                            "oneOf": [
                              {
                                "type": "array",
                                "maxItems": 100,
                                "items": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "code": {
                                      "type": "string",
                                      "enum": [
                                        "SUCCESS"
                                      ],
                                      "description": "The `code` property."
                                    },
                                    "details": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "maxLength": 100,
                                          "description": "The `id` property."
                                        }
                                      },
                                      "required": [
                                        "id"
                                      ],
                                      "description": "The `details` property."
                                    },
                                    "message": {
                                      "type": "string",
                                      "maxLength": 250,
                                      "description": "The `message` property."
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "success"
                                      ],
                                      "description": "The `status` property."
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "details",
                                    "message",
                                    "status"
                                  ],
                                  "description": "The `items` field of type `object`."
                                },
                                "description": "A `array` value."
                              }
                            ],
                            "description": "The `items` field."
                          },
                          "description": "The `users` property."
                        }
                      },
                      "required": [
                        "users"
                      ],
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserInvalidErrorSchemaOnRequestBody",
                      "description": "A `object` value."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "403": {
            "description": "Territories Get Error Response ",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryErrorPermissionDenied",
                      "description": "Territory Not yet Enabled."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          },
          "500": {
            "description": "Server error response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TerritoryInternalServerErrorSchema",
                      "description": "Internal server error."
                    }
                  ],
                  "description": "The `schema` field."
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deassociateUserFromSpecificTerritory",
        "description": "Remove a specific user from a territory.",
        "summary": "Remove user",
        "parameters": [
          {
            "$ref": "#/components/parameters/Territory",
            "description": "Territory Id Param in URL"
          },
          {
            "$ref": "#/components/parameters/User",
            "description": "User Id Param in URL"
          }
        ],
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.users.ALL",
              "ZohoCRM.settings.territories.ALL"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Successful remove",
            "content": {
              "application/json": {
                "schema": {
        

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