ads
PATCH /v1/ads/connections/{connection_id}/ai-max
Set the customer's own AI Max guard rules; a rule sent as null is Reset to recommended (za-204).
Authentication
Send an API key as a bearer token. The key must carry the ads.manage permission; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X PATCH https://api.zinndigital.com/v1/ads/connections/{connection_id}/ai-max \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "rules": <object> }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Gated on ads.manage and written to the organisation's activity log. rules is merged over the stored rules; a key sent as null returns to its Recommended value and "rules": null resets every rule. A number outside bounds refuses with badAiMaxRule naming the field.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
connection_id (path) | string | Yes | — |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
rules | object | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
as_of | string | Yes | — |
currency | string | Yes | — |
skipped | string<, notInGoodStanding, readRefused> | Yes | — |
expanded | AdsAiMaxFigures | Yes | — |
keyword | AdsAiMaxFigures | Yes | — |
verdict | string<none, learning, no_keyword_return, ok, below> | Yes | — |
basis | string<, value, conversions> | Yes | — |
return_pct | integer | Yes | — |
campaigns | AdsAiMaxCampaign[] | Yes | — |
waste_terms | object[] | Yes | — |
rules | AdsAiMaxRules | Yes | — |
own | string[] | Yes | The rules the customer set (the rest are Recommended). |
recommended | AdsAiMaxRules | Yes | — |
bounds | object | Yes | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429