Edit campaign
v1
put
/1/newsletters/{domain}/campaigns/{campaign}
Edit an existing campaign
domain
requiredinteger
Unique identifier of the Domain
Examples:94733
campaign
requiredinteger
Unique identifier of the Campaign
Examples:33948
Body Parameters
application/jsoncontent_htmlstring
Examples:example
email_from_addrstring
Examples:example
email_from_namestring
Examples:example
force_sendedboolean
langstring
Possible values:de_DEen_GBes_ESfr_FRit_IT
Examples:en_GB
preheaderstring
Examples:example
recipientsobject
MaxLength:5
subjectstring
Examples:example
template_idinteger
Examples:58334
tracking_linkboolean
tracking_openingboolean
tracking_utmobject
unsub_linkboolean
Response Body
application/json
resultrequiredstring
Possible values:successerrorasynchronous
Result of the HTTP request
Examples:success
dataCampaign
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"content_html": "example",
"email_from_addr": "example",
"email_from_name": "example",
"force_sended": false,
"lang": "en_GB",
"preheader": "example",
"recipients": {
"all_subscribers": true,
"emails": [
"example"
],
"expert": {
"conditions": [],
"id": 10879
},
"groups": {
"exclude": [
57836
],
"include": [
72941
]
},
"segments": {
"exclude": [
63241
],
"include": [
63902
]
}
},
"subject": "example",
"template_id": 58334,
"tracking_link": false,
"tracking_opening": false,
"tracking_utm": {
"utm_campaign": "example",
"utm_medium": "example",
"utm_source": "example"
},
"unsub_link": true
}';
$request = new Request('PUT', 'https://api.infomaniak.com/1/newsletters/{domain}/campaigns/{campaign}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"result":"success","data":{"id":12063,"status":"example","lang":"example","subject":"example","preheader":"example","email_from_name":"example","email_from_addr":"example","tracking_link":true,"tracking_opening":true,"tracking_utm":[],"next_step":"example","started_at":1731536565,"created_at":1732175682}}