Update dns record
v2
dns:write
put
/2/zones/{zone}/records/{record}
Update a dns record
zone
requiredstring
Examples:example
record
requiredstring
Examples:example
Query parameters
withstring
Possible values:idnaliasrecords_descriptionlabel
Examples:idn
Body Parameters
application/jsontargetstring
Target of the dns record
Examples:1.2.3.4
ttlinteger
Min:60Max:86400
TTL of the dns record
Examples:3600
typestring
Possible values:CNAMETXT
Only available to update CNAME to TXT and TXT to CNAME
Examples:TXT
Response Body
application/json
resultstring
Possible values:successerrorasynchronous
Result of the HTTP request
Examples:success
datarequiredDns record
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"target": "1.2.3.4",
"ttl": "3600",
"type": "TXT"
}';
$request = new Request('PUT', 'https://api.infomaniak.com/2/zones/{zone}/records/{record}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"result":"success","data":{"id":20011,"source":"example","type":"CAA","ttl":84933,"target":"example","updated_at":1743281139}}