Перейти к содержимому

Update link

PATCH
/api/v1/links/{code}
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": {} }'
code
required
string

Short code or custom alias

Media typeapplication/json
object
url

New destination URL

string
<= 2048 characters

Example

https://example.com/new-destination
title
string
<= 255 characters

Example

Updated title
description
string
<= 500 characters

Example

Updated description
tags
Array<string>

Example

[
"updated",
"tags"
]
expiresAt

Expiration date (ISO 8601) or null to remove

object

Example

2027-01-01T00:00:00Z
maxClicks

Max clicks or null to remove limit

object

Example

5000
isActive
boolean

Example

false
retargetingPixels

Retargeting pixels (null to remove all)

Array<object>
nullable
object
provider
required
string
Allowed values: facebook google tiktok linkedin custom

Example

facebook
pixelId
required
string
<= 100 characters

Example

1234567890123
scriptUrl

Script URL (required only for “custom” provider, must be HTTPS)

string

Example

https://cdn.example.com/tracker.js
accessToken

Access token for server-side Events API (e.g., TikTok CAPI, Meta CAPI). Stored encrypted in JSONB.

string
<= 500 characters
forwardParams

Forward original query parameters to the destination URL on redirect

boolean

Example

false
trafficSourceId

Traffic source of the link; null clears it

object

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