Skip to main content
PUT
/
links
/
:id
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.new-destination.com"}' \
-X PUT https://api.ayrshare.com/api/links/TkuWEy
{
    "status": "success",
    "id": "TkuWEy",
    "originalUrl": "https://www.new-destination.com",
    "shortUrl": "https://ayrs.io/TkuWEy",
    "created": "2023-07-17T15:20:51.118Z",
    "updated": "2024-01-10T12:30:00.000Z"
}

Documentation Index

Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Update the destination URL of an existing short link. The short link ID is returned when you first create a short link via POST /links.
Social Media Preview Caching: Social media platforms cache Open Graph preview cards from the original destination URL. After updating a short link, the preview card shown on social platforms may not match the new destination until the cache expires.

Header Parameters

Path Parameters

id
string
required
The short link ID returned from POST /links (e.g., “TkuWEy”).

Body Parameters

url
string
required
The new destination URL. Must be a valid URL starting with https://
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.new-destination.com"}' \
-X PUT https://api.ayrshare.com/api/links/TkuWEy
{
    "status": "success",
    "id": "TkuWEy",
    "originalUrl": "https://www.new-destination.com",
    "shortUrl": "https://ayrs.io/TkuWEy",
    "created": "2023-07-17T15:20:51.118Z",
    "updated": "2024-01-10T12:30:00.000Z"
}