Zoho: Create a user group
Zoho userGroups.createGroup: arguments, response, policy and SDK examples.
← User groups operations · Get started
Operation zoho.creategroup
Provider route: POST /crm/v8/settings/user_groups. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["userGroups"]["createGroup"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.userGroups.createGroup(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.user_groups.create_group(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Required within parent | Request body schema for creating a user group. Additional keys: not allowed |
body.user_groups | array | Required within parent | Specify an array containing up to 10 user group objects to create. Maximum items: 10 |
body.user_groups[] | object | Each item | Specify the details of the user group to create, including its name, optional description, and member sources. Additional keys: not allowed |
body.user_groups[].description | JSON | Optional | Specify an optional text description for the user group. |
body.user_groups[].description (anyOf 1) | string | Alternative | Specify the text description for the user group. Maximum length: 250 |
body.user_groups[].description (anyOf 2) | null | Alternative | Use null to indicate no description. |
body.user_groups[].name | string | Required within parent | Specify the name of the user group. Maximum length: 250 |
body.user_groups[].sources | array | Required within parent | Specify the array of member sources for the user group. Maximum items: 200 |
body.user_groups[].sources[] | object | Each item | Specify one member source entry for the user group, including the source type, the source identifier, and optional flags for subordinates or sub-territories. Additional keys: not allowed |
body.user_groups[].sources[].source | object | Required within parent | Specify the identifier of the source to add to the user group. Additional keys: not allowed |
body.user_groups[].sources[].source.id | string | Required within parent | Specify the unique ID of the user, role, or territory to add as a member source. Maximum length: 19 |
body.user_groups[].sources[].sub_territories | JSON | Optional | Specify whether to include members from sub-territories when the source type is territories. Possible values: true - Include members from sub-territories. false - Do not include members from sub-territories. |
body.user_groups[].sources[].sub_territories (anyOf 1) | boolean | Alternative | Specify true to include members from sub-territories, or false to exclude them. |
body.user_groups[].sources[].sub_territories (anyOf 2) | null | Alternative | Use null to omit the sub-territories flag. |
body.user_groups[].sources[].subordinates | JSON | Optional | Specify whether to include users in subordinate roles when the source type is roles. Possible values: true - Include users in subordinate roles. false - Do not include users in subordinate roles. |
body.user_groups[].sources[].subordinates (anyOf 1) | boolean | Alternative | Specify true to include users in subordinate roles, or false to exclude them. |
body.user_groups[].sources[].subordinates (anyOf 2) | null | Alternative | Use null to omit the subordinates flag. |
body.user_groups[].sources[].type | string | Required within parent | Specify the type of the member source being added to the user group. Possible values: territories - Add a CRM territory as a member source. roles - Add a CRM role as a member source. users - Add individual CRM users as a member source. One of: territories, roles, users |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response schema for a successful user group creation. Additional keys: not allowed |
user_groups | array | Required within parent | Represents the array containing the result of the user group creation operation. Maximum items: 10 |
user_groups[] | object | Each item | Represents the creation result for the user group, including the status, result code, message, and the ID of the newly created group. Additional keys: not allowed |
user_groups[].code | string | Required within parent | Represents the result code for the user group creation operation. Possible values: SUCCESS - The user group creation succeeded. Known values: SUCCESS |
user_groups[].details | object | Required within parent | Represents additional details about the created user group. Additional keys: not allowed |
user_groups[].details.id | string | Required within parent | Represents the unique ID of the newly created user group. Maximum length: 19 |
user_groups[].message | string | Required within parent | Represents the result message for the user group creation operation. Maximum length: 500 |
user_groups[].status | string | Required within parent | Represents the status of the user group creation operation. Possible values: success - The user group creation succeeded. Known values: success |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.creategroup. Catalog operation: createGroup. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.