Update a redirect rule
const url = 'https://example.com/api/v1/links/example/rules/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ruleType":"geo","targetUrl":"https://example.com/target","priority":0,"weight":100,"conditions":{"countries":["US","GB"]},"schema":"redirect","redirectType":"301","flowConfig":{"landings":[{"id":"landing-uuid","weight":100}],"offers":[{"id":"offer-uuid-1","weight":70},{"id":"offer-uuid-2","weight":30}]},"flowType":"forced","isActive":true}'};
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://example.com/api/v1/links/example/rules/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ruleType": "geo", "targetUrl": "https://example.com/target", "priority": 0, "weight": 100, "conditions": { "countries": [ "US", "GB" ] }, "schema": "redirect", "redirectType": "301", "flowConfig": { "landings": [ { "id": "landing-uuid", "weight": 100 } ], "offers": [ { "id": "offer-uuid-1", "weight": 70 }, { "id": "offer-uuid-2", "weight": 30 } ] }, "flowType": "forced", "isActive": true }'Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Path Parameters
Заголовок раздела «Path Parameters»Short code or custom alias
Rule ID
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»object
Required when schema is “redirect” (the default). Ignored for “landing_offer” and “action” — see flowConfig.
Example
https://example.com/targetExample
0Example
100Legacy shorthand (“countries”/“excludeCountries”/“devices”) is still accepted, but the general filter engine ({ match, filters }) supports far more: country, city, device, os, browser, language, ip (exact/CIDR/mask), referer, empty_referer, bot, param, sub_id, timetable, date_between — each with exact/mask/regex/@empty matching.
object
“redirect” (default): targetUrl wins, exactly as before. “landing_offer”: flowConfig holds independently weighted landing/offer sets — an empty landings list goes straight to the offer. “action”: flowConfig describes a non-redirect response (show_html, show_text, http_404, do_nothing, send_to_campaign).
How the redirect is delivered. Defaults to a plain 302.
Required for schema “landing_offer” ({ landings: [{id,weight}], offers: [{id,weight}] }) and schema “action” ({ actionType, html?, text?, campaignCode? }). Ignored for “redirect”.
object
Processing order: forced rules win outright when their filters match, then regular rules (existing geo/device/ab_test/rotation logic), then default as fallback.
Responses
Заголовок раздела «Responses»object
object
object
object
Example
{ "ruleType": "geo", "schema": "redirect", "redirectType": "301", "flowType": "forced"}