Change domains
Point many links at a website's new domain, or move short links to another short domain.
Two changes that touch many links at once, each with a preview that writes nothing and an apply call that does the work:
- Destination domain. The website your links open moved from
old-site.comtonew-site.com. Every link pointing at the old domain is rewritten, with its path and query string kept. The short links stay the same. - Short domain. The short links themselves move, keeping their code:
ivi.to/springbecomesgo.yourbrand.com/spring.
Both work on the whole workspace, or on the links you list in links. They are
the same changes as Change destination domain and Change short
domain on the links page in the app.
Preview a destination domain change
/api/v1/links/destination-domain/preview
How many links point at the old domain, and what the first ones would point at instead. Changes nothing.
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | required | The domain the links point at now: "old-site.com". Only that exact domain matches; www.old-site.com is a separate one. |
to |
string | required | The domain they should point at: "new-site.com". It goes through the same safety check as any new destination. |
links |
array | optional | Only these links, at most 1,000, each as {"code": "spring", "domain": "go.yourbrand.com"}: the same addressing as GET /api/v1/links/{code}?domain=. Leave domain out when the code is on one domain only. Without links, the whole workspace. |
curl -X POST "https://urlicer.com/api/v1/links/destination-domain/preview" \
-H "Authorization: Bearer url_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"from": "old-site.com", "to": "new-site.com"}'
{
"from": "old-site.com",
"to": "new-site.com",
"matched": 2,
"samples": [
{
"link": "ivi.to/TGPs",
"url": "https://old-site.com/b",
"newUrl": "https://new-site.com/b",
"alsoChanges": null
},
{
"link": "ivi.to/spring",
"url": "https://old-site.com/a?x=1",
"newUrl": "https://new-site.com/a?x=1",
"alsoChanges": "the fallback"
}
],
"notIncluded": ["www.old-site.com (3 links)"]
}
| Field | Type | Description |
|---|---|---|
matched |
integer | How many links the change would rewrite. |
samples |
array | The first ten of them, newest first: the short link, its destination now and after. |
samples[].alsoChanges |
string or null | What else on the link is on the old domain and changes with it, such as "the fallback and 2 A/B variants". Written for people; do not parse it. |
notIncluded |
array of strings | Subdomains of from that the same links use, with a count, which this change leaves alone. Written for people. |
Change the destination domain
/api/v1/links/destination-domain
Rewrites up to 300 links per call. Post again with the cursor until done is true.
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | required | As in the preview. |
to |
string | required | As in the preview. |
links |
array | optional | Only these links, at most 1,000, each as {"code": "spring", "domain": "go.yourbrand.com"}: the same addressing as GET /api/v1/links/{code}?domain=. Leave domain out when the code is on one domain only. Without links, the whole workspace. |
cursor |
integer | optional | The cursor from the previous call. Leave it out, or send 0, on the first call. |
curl -X POST "https://urlicer.com/api/v1/links/destination-domain" \
-H "Authorization: Bearer url_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"from": "old-site.com", "to": "new-site.com"}'
{"changed": 2, "done": true, "cursor": 124109}
| Field | Type | Description |
|---|---|---|
changed |
integer | How many links this call rewrote. |
done |
boolean | True when no links are left to change. Until then, send the same body again with the cursor. |
cursor |
integer | Where this call stopped. Opaque: send it back, do not compute with it. |
- On the Pro plan and above. Without it the request answers 403 feature with the key BulkEdit, and nothing changes.
- Besides the destination, each link's fallback URL, A/B destinations and targeting rules change wherever they use the old domain. The path, query string and the rest of each address stay as they are.
Preview a short domain move
/api/v1/links/short-domain/preview
How many links would move to the other short domain, the first ones old and new, and which links stay where they are. Changes nothing.
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | required without links | The short domain the links are on now: "ivi.to" or one of your custom domains. With links you can leave it out, and each link moves from whichever domain it is on. |
to |
string | required | The short domain they move to: "ivi.to", or a custom domain of yours that is verified and active. |
links |
array | optional | Only these links, at most 1,000, each as {"code": "spring", "domain": "go.yourbrand.com"}: the same addressing as GET /api/v1/links/{code}?domain=. Leave domain out when the code is on one domain only. Without links, the whole workspace. |
curl -X POST "https://urlicer.com/api/v1/links/short-domain/preview" \
-H "Authorization: Bearer url_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"from": "ivi.to", "to": "go.yourbrand.com"}'
{
"from": "ivi.to",
"to": "go.yourbrand.com",
"matched": 2,
"samples": [
{"link": "ivi.to/TGPs", "newLink": "go.yourbrand.com/TGPs"},
{"link": "ivi.to/spring", "newLink": "go.yourbrand.com/spring"}
],
"notMoving": ["1 code is already taken on go.yourbrand.com: sale."]
}
| Field | Type | Description |
|---|---|---|
from |
string or null | The source domain, or null when the links came from several. |
matched |
integer | How many links would move. |
samples |
array | The first ten of them, newest first, with the address now and after. |
notMoving |
array of strings | The links that stay where they are, one line per reason, with counts. Written for people; do not parse them. |
Move links to another short domain
/api/v1/links/short-domain
Moves up to 300 links per call, each keeping its code. Post again with the cursor until done is true.
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | required without links | As in the preview. |
to |
string | required | As in the preview. |
links |
array | optional | Only these links, at most 1,000, each as {"code": "spring", "domain": "go.yourbrand.com"}: the same addressing as GET /api/v1/links/{code}?domain=. Leave domain out when the code is on one domain only. Without links, the whole workspace. |
cursor |
integer | optional | The cursor from the previous call. Leave it out, or send 0, on the first call. |
curl -X POST "https://urlicer.com/api/v1/links/short-domain" \
-H "Authorization: Bearer url_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "go.yourbrand.com", "links": [{"code": "spring"}, {"code": "TGPs", "domain": "ivi.to"}]}'
{"moved": 2, "skipped": 0, "done": true, "cursor": 124109}
| Field | Type | Description |
|---|---|---|
moved |
integer | How many links this call moved. |
skipped |
integer | Links left where they were because their code was taken on the new domain after the preview. |
done |
boolean | True when no links are left to move. Until then, send the same body again with the cursor. |
cursor |
integer | Where this call stopped. Opaque: send it back, do not compute with it. |
- Moving onto a custom domain needs a plan with custom domains (Pro and above); without it the request answers 403 feature with the key CustomDomains. Moving back to ivi.to does not.
- The link is moved, so its old address stops resolving at once and its code is free for anyone to take. Its id, clicks and settings stay. In responses and webhooks, short and domain show the new address.
Applying a large change
Apply changes at most 300 links per call and answers done and a
cursor. Until done is true, send the same body again with that
cursor. Each call counts as one request against your
per-minute limit. If a call fails part way, the links already
changed stay changed, and starting again from the last cursor you received finishes the
rest.
Moving a short link breaks its old address. The old short URL stops resolving at once, including from printed QR codes, and its code becomes free for anyone to use. Run the preview first, and keep links whose old address is printed or widely shared on their current domain.
Links that stay where they are
A short domain move leaves a link on its current domain, and the preview lists it under
notMoving, when:
- its code is already in use on the new domain;
- it fires retargeting pixels and the new domain cannot run them (
ivi.tonever can; your own domain can once it has a business name and a privacy policy link); - it moves to
ivi.towith a custom alias shorter than your plan allows there.
What else happens
Each changed link sends a link.updated webhook,
and each apply call is one entry in the workspace's audit log, naming your API key.