Roles

Roles

Roles define the permissions a user holds in an organization. Use these endpoints to list, create, update, delete, and toggle the status of roles in Zoho Inventory.

Attribute

role_id
string
Unique ID of the role.
role_name
string
Name of the role. Max-length [200].
description
string
Description of the role. Max-length [2000].
display_name
string
Display name of the role. Max-length [200].
role_type
string
Type of the role.
access_type
string
Access type of the role.
permissions
array
Entity-wise permissions assigned to the role.
Show Sub-Attributes arrow
entity
string
(Required)
Name of the entity (module). Max-length [200].
can_create
boolean
Allowed values true and false.
can_edit
boolean
Allowed values true and false.
can_view
boolean
Allowed values true and false.
can_delete
boolean
Allowed values true and false.
can_approve
boolean
Allowed values true and false.
can_edit_locked_records
boolean
Allowed values true and false.
full_access
boolean
Allowed values true and false.
apply_segment
boolean
Allowed values true and false.
vendor_bank_account
boolean
Allowed values true and false.
assign_owner
boolean
Allowed values true and false.
more_permissions
array
Entity-specific additional permissions.
Show Sub-Attributes arrow
permission
string
(Required)
Name of the entity-specific permission.
is_enabled
boolean
(Required)
Allowed values true and false.
field_permissions
array
Field-level permissions for the entity.
Show Sub-Attributes arrow
field_name
string
(Required)
Name of the field.
permission
string
(Required)
Permission level for the field. Allowed Values: write, read, and none.
segmentation_details
array
Segmentation details applied to the role.
Show Sub-Attributes arrow
entity_id
string
Unique ID of the entity.
entity_type
string
Type of the entity. Max-length [50].
is_segmentation_enabled
boolean
Allowed values true and false.
can_allow_viewing
boolean
Allowed values true and false.
can_show_unassigned
boolean
Allowed values true and false.
supported_entity_list
array
List of supported entities for segmentation.
Show Sub-Attributes arrow
entity_name
string
(Required)
Name of the supported entity. Allowed Values: customer, vendor, and item.
is_enabled
boolean
(Required)
Allowed values true and false.

Example

{ "role_id": "982000000006005", "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "role_type": "custom", "access_type": "full", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] }

Create a role

Create a role with a set of entity-wise permissions for your organization.
OAuth Scope : ZohoInventory.settings.CREATE

Arguments

role_name
string
(Required)
Name of the role. Max-length [200].
description
string
Description of the role. Max-length [2000].
display_name
string
Display name of the role. Max-length [200].
access_type
string
Access type for the role.
role_type
string
Type of the role. Max-length [200].
permissions
array
Entity-wise permissions for the role.
Show Sub-Attributes arrow
entity
string
(Required)
Name of the entity (module). Max-length [200].
can_create
boolean
Allowed values true and false.
can_edit
boolean
Allowed values true and false.
can_view
boolean
Allowed values true and false.
can_delete
boolean
Allowed values true and false.
can_approve
boolean
Allowed values true and false.
can_edit_locked_records
boolean
Allowed values true and false.
full_access
boolean
Allowed values true and false.
apply_segment
boolean
Allowed values true and false.
vendor_bank_account
boolean
Allowed values true and false.
assign_owner
boolean
Allowed values true and false.
more_permissions
array
Entity-specific additional permissions.
Show Sub-Attributes arrow
permission
string
(Required)
Name of the entity-specific permission.
is_enabled
boolean
(Required)
Allowed values true and false.
field_permissions
array
Field-level permissions for the entity.
Show Sub-Attributes arrow
field_name
string
(Required)
Name of the field.
permission
string
(Required)
Permission level for the field. Allowed Values: write, read, and none.
segmentation_details
array
Segmentation details for the role.
Show Sub-Attributes arrow
entity_id
string
Unique ID of the entity.
entity_type
string
Type of the entity. Max-length [50].
is_segmentation_enabled
boolean
Allowed values true and false.
can_allow_viewing
boolean
Allowed values true and false.
can_show_unassigned
boolean
Allowed values true and false.
supported_entity_list
array
List of supported entities for segmentation.
Show Sub-Attributes arrow
entity_name
string
(Required)
Name of the supported entity. Allowed Values: customer, vendor, and item.
is_enabled
boolean
(Required)
Allowed values true and false.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695") .post(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/inventory/v1/roles?organization_id=10234695", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end();
curl --request POST \ --url 'https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "access_type": "full", "role_type": "custom", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] }

Response Example

{ "code": 0, "message": "The role has been created.", "role": { "role_id": "982000000006005", "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "role_type": "custom", "access_type": "full", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] } }

List Roles

Get the list of all roles in the organization. Filter and sort the results using the available query parameters.
OAuth Scope : ZohoInventory.settings.READ

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
sort_column
string
Sort roles. Allowed Values: role_name and role_description.
description
string
Search roles by description.
created_by
string
Filter roles by the user IDs that created them. Pass a comma-separated list of user IDs.
modified_by
string
Filter roles by the user IDs that last modified them. Pass a comma-separated list of user IDs.
created_date
date
Filter roles by created date in yyyy-mm-dd format. Use created_date_start and created_date_end for a range.
modified_date
date
Filter roles by last modified date in yyyy-mm-dd format. Use modified_date_start and modified_date_end for a range.
created_date_start
date
Filter roles created on or after this date. Format yyyy-mm-dd.
created_date_end
date
Filter roles created on or before this date. Format yyyy-mm-dd.
modified_date_start
date
Filter roles last modified on or after this date. Format yyyy-mm-dd.
modified_date_end
date
Filter roles last modified on or before this date. Format yyyy-mm-dd.
rule
string
Advanced search rule passed as a JSON object string. Supports columns (array of {index, field, value, comparator} where comparator is with or with_out) and criteria_string.
role_type
string
Filter roles by role type.
portal_id
string
Unique ID of the portal.
page
integer
Page number to be fetched. Default value is 1.
per_page
integer
Number of records to be fetched per page. Default value is 10.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695" type: GET headers: headers_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'GET', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/inventory/v1/roles?organization_id=10234695", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
curl --request GET \ --url 'https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "roles": [ { "role_id": "982000000006005", "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "role_type": "custom", "access_type": "full", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] }, {...}, {...} ], "page_context": { "page": 1, "per_page": 10, "has_more_page": false, "report_name": "Roles", "applied_filter": "Status.All", "sort_column": "role_name", "sort_order": "A" } }

Update a role

Update the details of a role.
OAuth Scope : ZohoInventory.settings.UPDATE

Path Parameters

role_id
string
(Required)
Unique identifier of the role.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695" type: PUT headers: headers_data content-type: application/json parameters: parameters_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695") .put(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'PUT', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("PUT", "/inventory/v1/roles/982000000006005?organization_id=10234695", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "PUT", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles/982000000006005?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end();
curl --request PUT \ --url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "access_type": "full", "role_type": "custom", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] }

Response Example

{ "code": 0, "message": "The role information has been updated.", "role": { "role_id": "982000000006005", "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "role_type": "custom", "access_type": "full", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] } }

Retrieve a role

Get the details of a role, including its entity-wise permissions.
OAuth Scope : ZohoInventory.settings.READ

Path Parameters

role_id
string
(Required)
Unique identifier of the role.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
role_type
string
Type of the role.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695" type: GET headers: headers_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'GET', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/inventory/v1/roles/982000000006005?organization_id=10234695", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles/982000000006005?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
curl --request GET \ --url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "role": { "role_id": "982000000006005", "role_name": "Manager", "description": "Can view, create, and edit transactions across modules.", "display_name": "Manager", "role_type": "custom", "access_type": "full", "permissions": [ { "entity": "invoices", "can_create": true, "can_edit": true, "can_view": true, "can_delete": false, "can_approve": false, "can_edit_locked_records": false, "full_access": false, "apply_segment": false, "vendor_bank_account": false, "assign_owner": false, "more_permissions": [ { "permission": "can_export", "is_enabled": true } ], "field_permissions": [ { "field_name": "vendor_bank_account", "permission": "read" } ] } ], "segmentation_details": [ { "entity_id": "982000000045123", "entity_type": "customer", "is_segmentation_enabled": true, "can_allow_viewing": true, "can_show_unassigned": false, "supported_entity_list": [ { "entity_name": "customer", "is_enabled": true } ] } ] } }

Delete a role

Delete a role from your organization. Roles assigned to active users cannot be deleted.
OAuth Scope : ZohoInventory.settings.DELETE

Path Parameters

role_id
string
(Required)
Unique identifier of the role.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695" type: DELETE headers: headers_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695") .delete(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'DELETE', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("DELETE", "/inventory/v1/roles/982000000006005?organization_id=10234695", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "DELETE", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles/982000000006005?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
curl --request DELETE \ --url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The role has been deleted." }

Activate a role

Activate a role to make it available for assignment to users.
OAuth Scope : ZohoInventory.settings.CREATE

Path Parameters

role_id
string
(Required)
Unique identifier of the role.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695" type: POST headers: headers_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695") .post(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/inventory/v1/roles/982000000006005/active?organization_id=10234695", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles/982000000006005/active?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
curl --request POST \ --url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success" }

Deactivate a role

Deactivate a role to prevent it from being assigned to users.
OAuth Scope : ZohoInventory.settings.CREATE

Path Parameters

role_id
string
(Required)
Unique identifier of the role.

Query Parameters

organization_id
string
(Required)
ID of the organization. Note: This value is a set of numeric characters.
portal_id
string
Unique ID of the portal.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695" type: POST headers: headers_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695") .post(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/inventory/v1/roles/982000000006005/inactive?organization_id=10234695", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/inventory/v1/roles/982000000006005/inactive?organization_id=10234695", "headers": { "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
curl --request POST \ --url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success" }