Add User

Table of Contents

Note:

  • This task is applicable to all services except Zoho Creator.
  • Each time the zoho.directory.addUser integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
  • Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.directory.addUser integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script. 

Overview

The zoho.directory.addUser task is used to add a specified user to an organization.

Syntax

<response> = zoho.directory.addUser(<orgID>, <userData>, <connection>);

Scope

ZohoDirectory.Users.CREATE

where:

ParameterDescriptionData type
responseis the variable which will hold the details of the user added to the organization.KEY-VALUE
<orgID>is the ID of the organization to which the user needs to be added.NUMBER
<userData>

is the variable that will hold the user data. The supported user data that can be included are

  • first_name
  • email_id
  • last_name
  • employee_id
  • designation_id
  • department_id
  • reporting_to
  • work_location
  • language_code
  • country
  • timezone
  • date_of_birth
  • gender
  • date_of_joining
  • seating_location
  • street_address
  • city
  • state
  • postal_code
  • extension
  • mobile
  • phone
KEY-VALUE
<connection>is the name of the Zoho Directory connection.TEXT

Example

The following script adds a user with name - John and designation ID - 48XXXXXX in Zoho Directory organization with ID - 72XXXXXXX:

userData = Map();
userData.put("first_name", "John");
userData.put("email_id", "John@xxxx.xxx");
userData.put("designation_id", "48XXXXXX");
response = zoho.directory.addUser(72XXXXXXX, userData, "zoho_directory_connection")

where:

response
This is the KEY-VALUEresponse returned by Zoho Directory.
72XXXXXXX
This is the NUMBERthat represents the organization ID of Zoho Directory account.
zoho_directory_connection
This is the TEXTthat represents the link name of the connection.
John
This is the FIRST NAME of the user to be added.
John@xxxx.xxx
This is the EMAIL ADDRESS of the user to be added.
48XXXXXX
This is the DESIGNATION ID of the user to be added.

Response

{
   "status_code": 201,
   "users": {
       "is_active": true,
       "user_id": "15133************",
       "href": "https://directory.zoho.com/api/v1/orgs/72*******/users/1513*********"
   },
   "resource_name": "users",
   "message": "Success"
}