You can use the API to create, get, or set role information.

Note: To assign an agent to a role, please see Agents.

JSON Format

Roles are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
description string true false The description of the role. Note: The description cannot be changed for the Owner, Admin, and Agent roles. You can change it for custom roles
enabled boolean true false Describes whether the role is enabled. Note: Owner, Admin, and Agent roles cannot be disabled. You can disable custom roles
id integer true false The ID of the role
members_count integer true false The number of members on this role
name string true false The name of the role. Note: The name cannot be changed for the Owner, Admin, and Agent roles. You can change it for custom roles
permissions object true false The permissions for the role (described below). Note: The permissions cannot be changed for Owner and Admin roles. You can change them for Agent and custom roles. See Permissions

Permissions

The permissions property is an object containing permission settings for a role.

Name Type Possible values Description
visitors_seen string "account", "department", "own" Permission to see visitors on your site
proactive_chatting string "listen-join", "listen", "own" Permission to listen to chat and/or proactively join a chat
edit_visitor_information boolean true, false Can edit user name, email, and phone via the chat panel or history
edit_visitor_notes boolean true, false Can edit notes via the chat panel or history
view_past_chats string "account", "department", "own", "none" Permission to view past chats
edit_chat_tags boolean true, false Can add or remove chat tags for past chats in history
manage_bans string "account", "none" Can temporarily ban visitors via browser cookies while in a chat or manage more permanent bans by IP
access_analytics string "account", "none" Can access Analytics and Email Reports (under Personal Settings)
view_monitor string "account", "none" Can view real-time metrics on Monitor across the whole account
edit_department_agents string "account", "none" Can add or edit agents in departments
set_agent_chat_limit string "account", "none" Can set chat limits for agents if agent limits are enabled
manage_shortcuts string "account", "none" Can add, edit, or delete shortcuts that can be used by anyone while chatting with visitors
Permission string values
  • "listen" - Listen to any chat visible to the agent
  • "listen-join" - Listen to any chat and proactively join a chat with any visitor visible to the agent
  • "own" - Not able to listen to any chat or proactive chat with any visitor on the Visitor List
  • "account" - Permission for the whole account
  • "department" - Permission limited to the user's department
  • "own" - Permission limited to the user's own information
  • "none" - No permission

Example

{  "description": "The person who set up the account. In addition to agent and administrator\nprivileges, this role can adjust the account's plan, change billing information,\nand cancel the account. Permissions for Owner role cannot be modified.\n",  "enabled": true,  "id": 1,  "members_count": 1,  "name": "Owner",  "permissions": {    "access_analytics": "account",    "edit_chat_tags": true,    "edit_department_agents": "account",    "edit_visitor_information": true,    "edit_visitor_notes": true,    "manage_bans": "account",    "manage_shortcuts": "account",    "proactive_chatting": "listen-join",    "set_agent_chat_limit": "account",    "view_monitor": "account",    "view_past_chats": "account",    "visitors_seen": "account"  }}

List Roles

  • GET /api/v2/roles

Lists all the roles for your account.

Allowed for

  • Owner
  • Administrator

Using curl

curl https://www.zopim.com/api/v2/roles \  -v -u {email_address}:{password}

Example Response

Status 200 OK
[  {    "description": "The person who set up the account. In addition to agent and administrator privileges, this role can adjust the account's plan, change billing information, and cancel the account. Permissions for Owner role cannot be modified.",    "enabled": true,    "id": 1,    "members_count": 1,    "name": "Owner",    "permissions": {      "access_analytics": "account",      "edit_chat_tags": true,      "edit_department_agents": "account",      "edit_visitor_information": true,      "edit_visitor_notes": true,      "manage_bans": "account",      "manage_shortcuts": "account",      "proactive_chatting": "listen-join",      "set_agent_chat_limit": "account",      "view_monitor": "account",      "view_past_chats": "account",      "visitors_seen": "account"    }  },  {    "description": "Team Lead",    "enabled": true,    "id": 8,    "members_count": 10,    "name": "Team Lead",    "permissions": {      "access_analytics": "account",      "edit_chat_tags": true,      "edit_department_agents": "account",      "edit_visitor_information": true,      "edit_visitor_notes": true,      "manage_bans": "account",      "manage_shortcuts": "account",      "proactive_chatting": "own",      "set_agent_chat_limit": "account",      "view_monitor": "account",      "view_past_chats": "own",      "visitors_seen": "own"    }  }]

Show Role

  • GET /api/v2/roles/{role_id}

Allowed for

  • Owner
  • Administrator

Parameters

Name Type In Required Description
role_id integer Path true The ID of the role

Using curl

curl https://www.zopim.com/api/v2/roles/{role_id} \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "description": "The person who set up the account. In addition to agent and administrator privileges, this role can adjust the account's plan, change billing information, and cancel the account. Permissions for Owner role cannot be modified.",  "enabled": true,  "id": 1,  "members_count": 1,  "name": "Owner",  "permissions": {    "access_analytics": "account",    "edit_chat_tags": true,    "edit_department_agents": "account",    "edit_visitor_information": true,    "edit_visitor_notes": true,    "manage_bans": "account",    "manage_shortcuts": "account",    "proactive_chatting": "listen-join",    "set_agent_chat_limit": "account",    "view_monitor": "account",    "view_past_chats": "account",    "visitors_seen": "account"  }}

Create Role

  • POST /api/v2/roles

Allowed for

  • Owner
  • Administrator

Using curl

curl https://www.zopim.com/api/v2/roles \  -d '{        "name": "Team Lead"      }' \  -v -u {email_address}:{password} \  -X POST -H "Content-Type: application/json"

Example Response

Status 201 Created
{  "description": "",  "enabled": true,  "id": 10000,  "members_count": 0,  "name": "Team Lead",  "permissions": {    "access_analytics": "none",    "edit_chat_tags": false,    "edit_department_agents": "none",    "edit_visitor_information": true,    "edit_visitor_notes": true,    "manage_bans": "account",    "manage_shortcuts": "account",    "proactive_chatting": "listen-join",    "set_agent_chat_limit": "none",    "view_monitor": "account",    "view_past_chats": "account",    "visitors_seen": "account"  }}

Update Role

  • PUT /api/v2/roles/{role_id}

Allowed for

  • Owner
  • Administrator

Parameters

Name Type In Required Description
role_id integer Path true The ID of the role

Using curl

curl https://www.zopim.com/api/v2/roles/{role_id} \  -d '{        "enabled": true,        "description": "Updated description",        "permissions": {          "edit_visitor_information": false        }      }' \  -v -u {email_address}:{password}  -X PUT -H "Content-Type: application/json"

Example Response

Status 200 OK
{  "description": "Updated description",  "enabled": true,  "id": 1,  "members_count": 1,  "name": "Owner",  "permissions": {    "access_analytics": "account",    "edit_chat_tags": true,    "edit_department_agents": "account",    "edit_visitor_information": false,    "edit_visitor_notes": true,    "manage_bans": "account",    "manage_shortcuts": "account",    "proactive_chatting": "listen-join",    "set_agent_chat_limit": "account",    "view_monitor": "account",    "view_past_chats": "account",    "visitors_seen": "account"  }}

Delete Role

  • DELETE /api/v2/roles/{role_id}

Allowed for

  • Owner
  • Administrator

Parameters

Name Type In Required Description
role_id integer Path true The ID of the role

Using curl

curl https://www.zopim.com/api/v2/roles/{role_id} \  -v -u {email_address}:{password} -X DELETE

Example Response

Status 204 No Content