Update link
PATCH
/api/v1/links/{code}
const url = 'https://example.com/api/v1/links/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com/new-destination","title":"Updated title","description":"Updated description","tags":["updated","tags"],"expiresAt":"2027-01-01T00:00:00Z","maxClicks":5000,"isActive":false,"retargetingPixels":[{"provider":"facebook","pixelId":"1234567890123","scriptUrl":"https://cdn.example.com/tracker.js","accessToken":"example"}],"forwardParams":false,"trafficSourceId":{}}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/new-destination", "title": "Updated title", "description": "Updated description", "tags": [ "updated", "tags" ], "expiresAt": "2027-01-01T00:00:00Z", "maxClicks": 5000, "isActive": false, "retargetingPixels": [ { "provider": "facebook", "pixelId": "1234567890123", "scriptUrl": "https://cdn.example.com/tracker.js", "accessToken": "example" } ], "forwardParams": false, "trafficSourceId": {} }'Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Path Parameters
Заголовок раздела «Path Parameters»code
required
string
Short code or custom alias
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
url
New destination URL
string
Example
https://example.com/new-destinationtitle
string
Example
Updated titledescription
string
Example
Updated descriptiontags
Array<string>
Example
[ "updated", "tags"]expiresAt
Expiration date (ISO 8601) or null to remove
object
Example
2027-01-01T00:00:00ZmaxClicks
Max clicks or null to remove limit
object
Example
5000isActive
boolean
Example
falseretargetingPixels
Retargeting pixels (null to remove all)
Array<object>
object
provider
required
string
Example
facebookpixelId
required
string
Example
1234567890123scriptUrl
Script URL (required only for “custom” provider, must be HTTPS)
string
Example
https://cdn.example.com/tracker.jsaccessToken
Access token for server-side Events API (e.g., TikTok CAPI, Meta CAPI). Stored encrypted in JSONB.
string
forwardParams
Forward original query parameters to the destination URL on redirect
boolean
Example
falsetrafficSourceId
Traffic source of the link; null clears it
object
Responses
Заголовок раздела «Responses»Link updated
Media typeapplication/json
object
id
required
string
originalUrl
required
string
shortUrl
required
string
shortCode
required
string
customAlias
object
title
object
description
object
tags
required
Array<string>
clickCount
required
number
uniqueClicks
required
number
isActive
required
boolean
forwardParams
required
boolean
hasTemplates
required
boolean
trafficSourceId
object
expiresAt
object
maxClicks
object
retargetingPixels
object
createdAt
required
string
updatedAt
required
string
Example generated
{ "id": "example", "originalUrl": "example", "shortUrl": "example", "shortCode": "example", "customAlias": {}, "title": {}, "description": {}, "tags": [ "example" ], "clickCount": 1, "uniqueClicks": 1, "isActive": true, "forwardParams": true, "hasTemplates": true, "trafficSourceId": {}, "expiresAt": {}, "maxClicks": {}, "retargetingPixels": {}, "createdAt": "example", "updatedAt": "example"}Validation error
Forbidden — not the owner
Link not found