POST - Add User to Organization

Purpose

This API is used to add a user to the organization.  

OAuth Scope

Use the scope

ZohoMail.organization.accounts.ALL (or) ZohoMail.organization.accounts.CREATE 

to generate the Authtoken.

ALL - Grants full access to accounts.

CREATE - Grants create access to accounts.

Request URL 

Using admin authentication

Method: POST

https://mail.zoho.com/api/organization/{zoid}/accounts

Path Parameters

  • zoid* long
    • zoid denotes the unique Zoho Organization Identifier for the organization. 
    • The value can be retrieved using the GET Organization details API.

Request Body- JSON

  • primaryEmailAddress* string
    • Specifies the domain-based primary email address for the user to be created. 
  • password* string
    • Specifies the password for the user to be created.
  • displayName string
    • Specifies the display name to be assigned to the user.
  • role string
    • Specifies the role to be assigned for the user to be created.
    • The value can be either
      •  member
      • admin
      • super_admin
  • country string
    • Specifies the country the user works from.
  • language string
    • Specifies the choice of language for the user.
  • timeZone string
    • Specifies the timezone the user works from.
  • oneTimePassword boolean
    • Specifies if the password is a one-time password.
    • Allowed values
      • true - The user will be asked to change the password on the first login.
      • false
  • groupMailList JSON Array
    • Specifies an array of the group's email addresses to which the user needs to be added.
    • The maximum number of group email addresses that can be added is 100.
    To Add to Zoho People

    In case your organization is also using Zoho People, you can add the same user in Zoho People also. You must also pass the related fields - employeeId, department, designation, mobileNumber, and extension in the Request Body. Note that the employeeId and lastName are mandatory to add the data to People.

  • employeeId* string
    •  Provide the employee ID of the user.
  • lastName* string
    •  Provide the last name of the user.
  • department string
    •  Provide the department in which the user works.
  • designation string
    •  Provide the designation the user holds.
  • mobileNumber string
    •  Provide the mobile number of the user.
  • extension string
    •  Provide the extension number of the user.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/organization/1234567890/accounts" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Zoho-oauthtoken 1********" \
-d '{
   "primaryEmailAddress": "rebecca@zylker.com",
   "password": "Abc@123",
   "displayName": "Rebecca",
   "role": "member",
   "country": "in",
   "language": "En",
   "timeZone": "Asia/Kolkata",
   "oneTimePassword": false,
   "groupMailList": ["newgroupmail@zylker.com", "newgroup@zylker.com"],
   "employeeId": "E123",
   "lastName": "Anderson",
   "department": "Sales",
   "designation": "Manager",
   "mobileNumber": "+911234567890",
   "extension": "123"
}'