Update Link
Update an existing link’s properties. You cannot change the URL or short code after creation.
PATCH /api/v1/links/:idAuthentication
Required.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | The link’s unique identifier |
Request Body
All fields are optional — only include the fields you want to change.
| Parameter | Type | Description |
|---|---|---|
title | string | Update the display title |
is_active | boolean | Enable or disable the link |
password | string | null | Set a new password, or null to remove |
expires_at | string | null | Set expiration (ISO 8601), or null to remove |
analytics_public | boolean | Make analytics publicly visible |
analytics_shared_fields | string[] | null | Which analytics sections to share publicly |
Immutable Fields
The following fields cannot be changed after creation:
original_url— The destination URLshort_code— The short code / custom alias
Attempting to include these fields will return a 400 error.
Analytics Shared Fields
When analytics_public is true, you can control which sections are visible:
["overview", "locations", "devices", "referrers", "browsers"]Set to null to share all sections.
Examples
Disable a Link
curl -X PATCH https://snipurl.click/api/v1/links/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer snip_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"is_active": false}'const response = await fetch(
`https://snipurl.click/api/v1/links/${linkId}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer snip_live_your_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ is_active: false }),
}
);import requests
response = requests.patch(
f'https://snipurl.click/api/v1/links/{link_id}',
headers={'Authorization': 'Bearer snip_live_your_key_here'},
json={'is_active': False},
)Set Password and Expiry
curl -X PATCH https://snipurl.click/api/v1/links/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer snip_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"password": "newsecret",
"expires_at": "2025-12-31T23:59:59Z"
}'Remove Password
curl -X PATCH https://snipurl.click/api/v1/links/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer snip_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"password": null}'Make Analytics Public
curl -X PATCH https://snipurl.click/api/v1/links/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer snip_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"analytics_public": true,
"analytics_shared_fields": ["overview", "locations", "devices"]
}'Response (200 OK):
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"short_code": "a8Kx2m",
"short_url": "https://snipurl.click/a8Kx2m",
"original_url": "https://example.com/article",
"title": "Example Article",
"is_active": false,
"has_password": true,
"expires_at": "2025-12-31T23:59:59.000Z",
"clicks_count": 142,
"analytics_public": true,
"created_at": "2025-06-20T10:00:00.000Z",
"updated_at": "2025-06-24T11:30:00.000Z"
}
}Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Attempted to change URL or short code |
| 400 | VALIDATION_ERROR | Invalid field values |
| 404 | NOT_FOUND | Link not found |
Last updated on