Edit Link

PATCH https://api.example.com/api/link
Requires authentication: x-api-key: YOUR_API_KEY

Updates the name and destination URL of an existing shortened link. The link ID, new name and new destination URL must be supplied in the request body.

Headers

  • x-api-key string required
    Your API authentication key.
    Example: YOUR_API_KEY

Body parameters

  • id integer required
    The database ID of the shortened link to update.
    Example: 123
  • name string required
    The new name for the shortened link.
    Example: example
  • url string required
    The new destination URL.
    Example: https://example.com

Responses

  • 200OK
  • 404Not Found
  • 409Conflict
Request
curl -X PATCH 'https://api.example.com/api/link' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 123,
  "name": "example",
  "url": "https://example.com"
}'
Response
OK
{
  "id": 1,
  "name": "example",
  "url": "https://example.com",
  "count": 0,
  "creator": "API",
  "creatorID": "0",
  "createdAt": 1795400000000
}