Change Ads settings
const url = 'https://digize.com/api/v1/ads/settings';const options = { method: 'PATCH', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"conversionApis":[{"platform":"google","enabled":true}],"attributionWindow":"1d_click","utmTemplate":"example","protection":{"mode":"off","repeatClicks":1,"windowHours":1,"blockDays":1,"blockNetworks":true,"blockAutomation":true,"allowedCountries":["example"],"response":"page","shield":"off","syncGoogleAds":true},"alerts":{"enabled":true,"monthlyCap":1,"threshold":1,"overspend":true,"rejections":true,"recipients":["example"]},"approval":{"required":true,"above":1,"approvers":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://digize.com/api/v1/ads/settings \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "conversionApis": [ { "platform": "google", "enabled": true } ], "attributionWindow": "1d_click", "utmTemplate": "example", "protection": { "mode": "off", "repeatClicks": 1, "windowHours": 1, "blockDays": 1, "blockNetworks": true, "blockAutomation": true, "allowedCountries": [ "example" ], "response": "page", "shield": "off", "syncGoogleAds": true }, "alerts": { "enabled": true, "monthlyCap": 1, "threshold": 1, "overspend": true, "rejections": true, "recipients": [ "example" ] }, "approval": { "required": true, "above": 1, "approvers": [ "example" ] } }'Changes some sections of the Ads settings and keeps the rest. Click protection reaches every site within a minute.
Needs the ads:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Scripted traffic on every page: strict turns away all of it, safe only what comes from VPNs and data centers.
Adds blocked addresses to Google Ads campaigns as IP exclusions.
Responses
Section titled “Responses”Done
object
object
Scripted traffic on every page: strict turns away all of it, safe only what comes from VPNs and data centers.
Adds blocked addresses to Google Ads campaigns as IP exclusions.
The workspace’s own short link domain; null for the platform’s.
Example
{ "conversionApis": [ { "platform": "google" } ], "attributionWindow": "1d_click", "protection": { "mode": "off", "response": "page", "shield": "off" }}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}