Update a subscriber
v1
put
/1/newsletters/{domain}/subscribers/{subscriber}
Update a subscriber with new values.
This is non-destructive operation, omitted parameters will not affect the subscriber.
domain
requiredinteger
Unique identifier of the Domain
Examples:48267
subscriber
requiredinteger
Unique identifier of the Subscriber
Examples:84191
Query parameters
withstring
Possible values:statisticsgroupssourcessourcefields
Examples:source
Body Parameters
application/jsonfieldsarray
Object keys must correspond to field's key. Omitted values will be deleted.
Examples:{"firstname": "John","lastname": "Wick"}
groupsarray
An array of valid identifiers or the names of groups to be created. Omitted values will be deleted.
Examples:[1234, "my new group"]
statusstring
Possible values:activeunsubscribed
Status of the resource {name}
Examples:active
Response Body
application/json
resultrequiredstring
Possible values:successerrorasynchronous
Result of the HTTP request
Examples:success
dataSubscriber
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"fields": "{\"firstname\": \"John\",\"lastname\": \"Wick\"}",
"groups": "[1234, \"my new group\"]",
"status": "active"
}';
$request = new Request('PUT', 'https://api.infomaniak.com/1/newsletters/{domain}/subscribers/{subscriber}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"result":"success","data":{"id":51338,"email":"hill.maverick@feeney.com","status":"active","created_at":1731875203}}