This endpoint allows you to change the destination URL that a short URL redirects to. The short URL code remains the same, but visitors will be redirected to the new destination.
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.
Authentication
This endpoint uses HTTPBearer security. Include the access token obtained from the /login endpoint:
Authorization: Bearer <access_token>
Query Parameters
The new destination URL to redirect to. The URL will be automatically formatted and validated against the blacklist.
Response
Success message confirming the destination URL has been updated
Status Codes
200 : Destination URL successfully changed
400 : URL is blacklisted
404 : URL not found
403 : Invalid or expired token
URL Validation
The endpoint performs the following validations:
Checks if the URL is on the blacklist (returns 400 if blacklisted)
Automatically formats the URL using formatURL() helper
Updates the destination while keeping the short code unchanged
cURL
Response (200)
Error (400)
Error (404)
Error (403)
curl -X PATCH "https://api.example.com/change_url?url=https://newdestination.com" \
-H "Authorization: Bearer <access_token>"
Example Use Cases
Update a campaign URL without changing the short link
Fix a typo in the destination URL
Redirect existing traffic to a new landing page
A/B test different destinations with the same short code