EaserixDocs
DevelopersAPI referenceLinksLinks

Sync a link's routing rules

Syncs the link's routing rules to the given set: a rule whose id matches an existing one is updated in place (keeping that id and its analytics history), a rule with no id (or an id that doesn't belong to this link) is created, and any existing rule left out of the set is deleted. For editing or removing a single rule without resending the whole list, prefer PATCH/DELETE on /v1/links/{id}/rules/{ruleId} instead. An actual change to the rule set is audited as link.rules_updated (counts of rules added, removed and changed — never their destinations); re-sending an unchanged set is not an event, and neither are the single-rule endpoints below when nothing changes. On redirect, inactive rules (active: false) are skipped entirely regardless of kind; among the rest, geo rules (2-letter country) match first, then device rules (mobile/tablet/desktop), then schedule rules (active start/end window), then split rules pick a destination by weight — the unallocated remainder stays on the main destination. Clicks record the winning rule's label as their variant.

View as Markdown
POST
/v1/links/{id}/rules
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/links/string/rules" \  -H "Content-Type: application/json" \  -d '{    "rules": [      {        "kind": "geo",        "destinationUrl": "string"      }    ]  }'
{  "rules": [    {      "id": "string",      "kind": "geo",      "match": "string",      "destinationUrl": "string",      "weight": 0,      "label": "string",      "startAt": "2019-08-24T14:15:22Z",      "endAt": "2019-08-24T14:15:22Z",      "active": true    }  ]}