Skip to content

Add subscriber to a group

Adds one or more subscribers to the specified group.

HTTP method: POST

https://api.sender.net/v2/subscribers/groups/{groupId}


ParameterTypeDescription
groupIdstring requiredProvide the group id
subscribersarray requiredArray of email addresses that would be added to this group.
conditionsstringWill be selecting all the subscribers at once. Won’t work when sending together [subscribers] parameter.
trigger_automationbooleanThis property by default its true. You ca send it as false if you want not to activate an automation.

const url = new URL("https://api.sender.net/v2/subscribers/groups/{groupId}");
let headers = {
"Authorization": "Bearer [your-token]",
"Content-Type": "application/json",
"Accept": "application/json",
};
let bodyContent = {
"subscribers": ["[email protected]", "[email protected]"],
"trigger_automation": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(bodyContent)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example Response
{
"success": true,
"message": {
"subscribers_added_to_group": [
],
"non_existing_subscribers": [
]
}
}