Skip to main content
Update the properties of an existing short link.

Endpoint

PUT /api/links/{linkId}
This endpoint uses the POST HTTP method in the actual implementation, but follows PUT semantics for updating resources.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

Link UUID

Request Body

name
string
Link name (max 100 characters)
url
string
Destination URL (max 500 characters)
slug
string
URL slug (min 8 characters, max 100 characters). Must be unique.
All fields are optional. Only provide the fields you want to update.

Response

id
string
Link UUID
name
string
Updated link name
url
string
Updated destination URL
slug
string
Updated URL slug
userId
string
Owner user UUID
teamId
string
Team UUID
updatedAt
string
ISO 8601 timestamp of last update

Example Request

curl -X POST "https://your-umami-instance.com/api/links/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Product Launch",
    "url": "https://example.com/new-product-launch"
  }'

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Product Launch",
  "url": "https://example.com/new-product-launch",
  "slug": "launch2024",
  "userId": "660e8400-e29b-41d4-a716-446655440001",
  "teamId": null,
  "updatedAt": "2024-03-15T09:20:00.000Z"
}

Error Responses

400
error
Bad Request - The slug is already taken by another link
401
error
Unauthorized - You don’t have permission to update this link
404
error
Not Found - Link does not exist
If you change the slug, the old short URL will no longer work. Make sure to update any references to the old URL.
You must have update permissions for the link to modify it.

Build docs developers (and LLMs) love