Assign

v1
put
/1/newsletters/{domain}/subscribers/assign

Assign subscribers to a group.

Path parameters

domain
requiredinteger

Unique identifier of the Domain

Examples:30285

Body Parameters

application/json
filterobject
groupsrequiredarray

An array of valid identifiers or the names of groups to be created.

Examples:[1234, "my new group"]
segmentstring

Filter subscribers with a segment

Examples:example
selectrequiredobject

Response Body

application/json
resultrequiredstring
Possible values:successerrorasynchronous

Result of the HTTP request

Examples:success
datastring

Example request

                <?php
use GuzzleHttp\Client;

$client = new Client();
$headers = [
	'Authorization' => 'Bearer YOUR-TOKEN-HERE',
	'Content-Type' => 'application/json'
];

$body = '{
    "groups": "[1234, \"my new group\"]",
    "select": {
        "all": true,
        "exclude": [],
        "include": []
    }
}';

$request = new Request('PUT', 'https://api.infomaniak.com/1/newsletters/{domain}/subscribers/assign', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
            

Example response

application/json
                
                    
{
"result":"success",
"data":"example"
}