Skip to Content

Update Link

Update an existing link’s properties. You cannot change the URL or short code after creation.

PATCH /api/v1/links/:id

Authentication

Required.

Path Parameters

ParameterTypeDescription
idstring (UUID)The link’s unique identifier

Request Body

All fields are optional — only include the fields you want to change.

ParameterTypeDescription
titlestringUpdate the display title
is_activebooleanEnable or disable the link
passwordstring | nullSet a new password, or null to remove
expires_atstring | nullSet expiration (ISO 8601), or null to remove
analytics_publicbooleanMake analytics publicly visible
analytics_shared_fieldsstring[] | nullWhich analytics sections to share publicly

Immutable Fields

The following fields cannot be changed after creation:

  • original_url — The destination URL
  • short_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

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

StatusCodeDescription
400BAD_REQUESTAttempted to change URL or short code
400VALIDATION_ERRORInvalid field values
404NOT_FOUNDLink not found
Last updated on