Create a New Group

Purpose

The API is used to create a new group with the specified settings. 

OAuth Scope

Use the scope

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

to generate the Authtoken.

ALL - Full access to groups.

CREATE - Create a new group.

Request URL

Method: POST

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

Path Parameters

  • zoid* long
    • This parameter denotes the unique Zoho Organization Identifier for the organization.
    • This parameter can be retrieved from the Organization Details API.

Request Body ( JSON Object)

  • emailId* string
    • Provide an email address to be associated with this group.
  • namestring
    • Provide a unique name to the group.
  • groupDescription string
    • Provide a short description of the purpose of the group.
  • accessType string
    • This parameter represents the type of access for this group.
    • The possible value for this parameter can be
      • Public
      • Organization
      • Group
      • Moderated
    • The default value is Public.
  • streamsEnabled boolean
    • This parameter specifies whether streams are enabled for this group or not.
    • The possible value can be
      • true
      • false
    • The default value is false.
  • mailGroupMemberList* JSON array of JSON object

    This contains the details of the members to be added to the group. The following parameters should be included in the object:

    • memberEmailId* string
      • memberEmailId represents the email address of the member to be added to the group.
    • role string
      • Specify the role to which the member should be changed.
      • The possible values can be
        • member
        • moderator 
      • The default value is member.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/organization/N****C0CM/groups" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****" \

-d '{
    "mailGroupMemberList": [
        {
            "memberEmailId": "rebecca@zylker.com",
            "role": "moderator"
        }
    ],
    "emailId": "test@zylker.com",
    "name": "test",
    "groupDescription": "test group description",
    "streamsEnabled":true,
    "accessType":"Public"    
}'

Sample Request Body

Copied{
    "mailGroupMemberList": [
        {
            "memberEmailId": "rebecca@zylker.com",
            "role": "moderator"
        }
    ],
    "emailId": "test@zylker.com",
    "name": "test",
    "groupDescription": "test group description",
    "streamsEnabled":true,
    "accessType":"Public"    
}

Sample Response

Copied{
    "status": {
        "code": 201,
        "description": "Created"
    },
    "data": {
        "accessType": "Public",
        "zgid": 80261668,
        "mailGroupMemberList": [
            {
                "role": "moderator",
                "memberEmailId": "rebecca@zylker.com"
            }
        ],
        "streamsEnabled": true,
        "groupDescription": "test group description",
        "name": "test",
        "emailId": "test@zylker.com",
        "URI": "https://mail.zoho.com/api/organization/77226188/groups/80261668"
    }
}