Insert

Add a single user to one or more groups. When new users are added, invites are sent automatically within 1-5 minutes. If the group does not exist, it will automatically be created.

Parameters

Key

Type

groups

Array of Strings

user

User Object (firstname, lastname, email, optional telelphone)

invite

Boolean (defaults to true)

forceSync

Boolean (defaults to false)

Caution

When using forceSync, this will potentially remove users from other groups they may have been manually assigned. You should only use this if it is unlikely the user will be manually assigned to groups.

Example

curl -X POST \
  v1/groups/insert \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
	"groups" : ["Group One","Group Two"],
	"user" : {
	  "firstname" : "Test",
	  "lastname" : "User",
	  "email" : "test@example.com"   
        }
 }'

Success Response

{
    "status": "success",
    "data": [
        {
            "group": "Group One",
            "status": "success",
            "inserts": 1,
            "warnings": 0
        },
        {
            "group": "Group Two",
            "status": "success",
            "inserts": 1,
            "warnings": 0
        }
    ],
    "hash": "15cc3e129ddd0c4ea2e5f0ebc4b18688",
    "response_time": 0.225816011428833
}

Last updated