Zoho: Create Contact Roles
Zoho contactRoles.createContactRoles: arguments, response, policy and SDK examples.
← Contact roles operations · Get started
Operation zoho.createcontactroles
Provider route: POST /crm/v8/Contacts/roles. 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["contactRoles"]["createContactRoles"]>[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.contactRoles.createContactRoles(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.contact_roles.create_contact_roles(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 | Specify the contact role details to create in the CRM organization. Additional keys: not allowed |
body.contact_roles | array | Required within parent | Specify the list of contact roles to create. Maximum items: 100 |
body.contact_roles[] | object | Each item | Specify the details of a single contact role to create. Additional keys: not allowed |
body.contact_roles[].name | string | Required within parent | Specify the name of the contact role. Maximum length: 50 Pattern: [A-Za-z0-9 ]{1,50} |
body.contact_roles[].sequence_number | number | Required within parent | Specify the display position of the contact role in the CRM UI picklist. |
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 |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | Contains the results of the contact role creation, with a status entry for each contact role in the request. Additional keys: not allowed |
$ (anyOf 1).contact_roles | array | Required within parent | Contains the results for each contact role in the request. Maximum items: 100 |
$ (anyOf 1).contact_roles[] | Model | Each item | Expand Create Contact Roles — response body — contact roles contact roles item |
$ (anyOf 2) | object | Alternative | Contains mixed success and error results for bulk contact role creation. Additional keys: not allowed |
$ (anyOf 2).contact_roles | array | Required within parent | Contains the mixed results for each contact role in the request. Maximum items: 100 Minimum items: 2 |
$ (anyOf 2).contact_roles[] | JSON | Each item | Represents a single result entry, which is either a success record or an error record. |
$ (anyOf 2).contact_roles[] (anyOf 1) | Model | Alternative | Expand Create Contact Roles — response body — contact_roles / contact_roles / item / code: MANDATORY NOT FOUND, status: error |
$ (anyOf 2).contact_roles[] (anyOf 2) | Model | Alternative | Expand Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error |
$ (anyOf 2).contact_roles[] (anyOf 3) | Model | Alternative | Expand Create Contact Roles — response body — contact_roles / contact_roles / item / code: DUPLICATE DATA, status: error |
$ (anyOf 2).contact_roles[] (anyOf 4) | Model | Alternative | Expand Create Contact Roles — response body — contact roles contact roles item |
$ (anyOf 2).contact_roles (allOf 1) | JSON | All variants apply | Ensures the array contains at least one successfully created contact role. |
$ (anyOf 2).contact_roles (allOf 2) | JSON | All variants apply | Ensures the array contains at least one contact role that failed validation. |
Referenced models: Create Contact Roles — response body — contact roles contact roles item, Create Contact Roles — response body — contact_roles / contact_roles / item / code: DUPLICATE DATA, status: error, Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error, Create Contact Roles — response body — contact_roles / contact_roles / item / code: MANDATORY NOT FOUND, status: error
Schemas
Section titled “Schemas”Create Contact Roles — response body — contact roles contact roles item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the result of a successful contact role operation. Additional keys: not allowed |
code | string | Required within parent | Represents the status code of the operation. **Possible values:** - **SUCCESS** - The contact role operation completed successfully. Known values: SUCCESS |
details | object | Required within parent | Represents the details of the contact role for the create or update operation. Additional keys: not allowed |
details.id | string | Required within parent | Represents the unique ID of the contact role. Maximum length: 19 |
message | string | Required within parent | Represents the message describing the result of the operation. Maximum length: 255 |
status | string | Required within parent | Represents the overall status of the operation. **Possible values:** - **success** - The contact role operation completed successfully. Known values: success |
Create Contact Roles — response body — contact_roles / contact_roles / item / code: DUPLICATE DATA, status: error
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error when a contact role with the same name already exists in the CRM organization. Additional keys: not allowed |
code | string | Required within parent | Represents the error code. **Possible values:** - **DUPLICATE_DATA** - A contact role with the same name already exists. Known values: DUPLICATE_DATA |
details | object | Required within parent | Represents the error details for the duplicate data. Additional keys: not allowed |
details.api_name | string | Required within parent | Represents the API name of the field that contains a duplicate value. Maximum length: 100 |
details.json_path | string | Required within parent | Represents the JSON path to the field that contains a duplicate value. Maximum length: 255 |
message | string | Required within parent | Represents the error message. Maximum length: 255 |
status | string | Required within parent | Represents the error status. **Possible values:** - **error** - The request failed. Known values: error |
Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an invalid data error for a contact role field in a create operation. Additional keys: not allowed |
code | string | Required within parent | Represents the error code. **Possible values:** - **INVALID_DATA** - The contact role data is invalid. Known values: INVALID_DATA |
details | Model | Required within parent | Expand Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error details |
message | string | Required within parent | Represents the error message. Maximum length: 255 |
status | string | Required within parent | Represents the error status. **Possible values:** - **error** - The request failed. Known values: error |
Referenced models: Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error details
Create Contact Roles — response body — contact_roles / contact_roles / item / code: MANDATORY NOT FOUND, status: error
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error when a required field is missing from the request. Additional keys: not allowed |
code | string | Required within parent | Represents the error code. **Possible values:** - **MANDATORY_NOT_FOUND** - A required field is missing from the request. Known values: MANDATORY_NOT_FOUND |
details | object | Required within parent | Represents the error details for the missing field. Additional keys: not allowed |
details.api_name | string | Required within parent | Represents the API name of the missing required field. Maximum length: 100 |
details.json_path | string | Required within parent | Represents the JSON path to the missing required field. Maximum length: 255 |
message | string | Required within parent | Represents the error message. Maximum length: 255 |
status | string | Required within parent | Represents the error status. **Possible values:** - **error** - The request failed. Known values: error |
Create Contact Roles — response body — contact_roles / contact_roles / item / code: INVALID DATA, status: error details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the error details for the invalid data. Additional keys: not allowed |
api_name | string | Required within parent | Represents the API name of the field that contains invalid data. Maximum length: 100 |
expected_data_type | string | Required within parent | Represents the expected data type for the field. Maximum length: 100 |
json_path | string | Required within parent | Represents the JSON path to the field that contains invalid data. Maximum length: 255 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.createcontactroles. Catalog operation: createContactRoles. 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.