Update Link
Updates one or more properties of an existing link. Only the fields you include in the request body are changed; omitted fields remain unchanged.
PATCH
/v1/links/{link_id} links:write Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
link_id | string (UUID) | Yes | The unique identifier of the link to update. |
Request Body
All fields are optional. Include only the fields you want to change.
| Parameter | Type | Description |
|---|---|---|
url | string | New destination URL. |
labels | string[] | Replace the full label set (max 10). |
enabled | boolean | Enable or disable the link. Disabled links return 410 Gone. |
routing_rules | object[] | Replace the full routing rules array. |
Request Examples
curl -X PATCH https://xqr.co/api/v1/links/d47f2e1a-8c3b-4a5d-9e6f-1234567890ab \ -H "Authorization: Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/summer-sale-v2?utm_source=qr", "labels": ["campaign", "summer", "updated"] }'const linkId = "d47f2e1a-8c3b-4a5d-9e6f-1234567890ab";
const response = await fetch(`https://xqr.co/api/v1/links/${linkId}`, { method: "PATCH", headers: { Authorization: "Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://example.com/summer-sale-v2?utm_source=qr", labels: ["campaign", "summer", "updated"], }),});
const { data } = await response.json();console.log(data.destination); // https://example.com/summer-sale-v2?utm_source=qrimport httpx
link_id = "d47f2e1a-8c3b-4a5d-9e6f-1234567890ab"
response = httpx.patch( f"https://xqr.co/api/v1/links/{link_id}", headers={ "Authorization": "Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, json={ "url": "https://example.com/summer-sale-v2?utm_source=qr", "labels": ["campaign", "summer", "updated"], },)
data = response.json()["data"]print(data["destination"]) # https://example.com/summer-sale-v2?utm_source=qrResponse
200 OK
The updated link object.
{ "data": { "id": "d47f2e1a-8c3b-4a5d-9e6f-1234567890ab", "short_url": "https://xqr.co/summer24", "short_code": "summer24", "destination": "https://example.com/summer-sale-v2?utm_source=qr", "enabled": true, "labels": ["campaign", "summer", "updated"], "routing_rules": [], "scan_count": 1483, "last_scan_at": "2026-03-20T09:12:44Z", "expires_at": "2026-09-30T23:59:59Z", "created_at": "2026-03-01T10:00:00Z", "updated_at": "2026-03-21T15:45:00Z" }, "meta": { "request_id": "req_3c4d5e6f70890123", "rate_limit": { "limit": 600, "remaining": 596, "reset": 1742572800 } }}Was this page helpful?
Thanks for your feedback!