API - Add Members

POST https://gaggle.email/api/v2/add-members

Add members to an existing group.

Request

Parameters

api_key (string) Your API key (see API Introduction)
group_address (string)
The @gaggle.email address of the group to add members to
add_directly (boolean)
True: members added directly to the group
False: members sent an invitation to join the group
send_welcome (boolean) True: send a welcome email to new members
False: don't send a welcome email to new members
members (list) List of members to add.  
{
    'email': <member email>,
    'name': <member name>,
    'delivery: (optional) immediate | digest | paused
}
See example.
If you have Custom Member Fields enabled, you can provide these as extra fields in the members list.

Example

This example shows adding two new members to a group and sending them a welcome email.

POST https://gaggle.email/api/v2/add-members
{
	'api_key': <your-api-key>,
	'group_address': 'test-group@gaggle.email',
	'add_directly': true,
	'send_welcome': true,
	'members': [
	{
		'email': 'new-member-1@acme.com',
		'name': 'New Member 1',
	},
	{
		'email': 'new-member-2@acme.com',
		'name': 'New Member 2'
		'delivery': 'digest',
	},
	]
}

Response 

Status code 200 signifies success.

status (string) success: all members successfully added
partial-success: some members successfully added
failed: no members added
message (string) optional error message
added (list) list of successfully added members
failed (list) list of members who were not added with error message
{ 	
	'status': 'partial-success', 	
	'added': ['new-member-1@acme.com'], 	
	'failed': [ 		
	{ 			
		'email': 'new-member-1@acme.com',  			
		'message': 'Email already exists' 		
	} 	
	]
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us