ShortyyDocs

Link Immutability Architectural Invariant

Why Shortyy guarantees short links can never be edited or mutated after creation.

Link Immutability Architectural Invariant

In Shortyy, short links are immutable. Once created, the destination original_url and short code code are permanent for the duration of the link's lifecycle.


The Immutable Guarantee

Traditional URL shortening services allow account holders or compromised credentials to silently edit destination URLs. This creates a severe attack vector:

▪
An attacker can take over an API key and redirect thousands of previously published links to malicious phishing sites.
▪
QR codes, marketing emails, printed collateral, and enterprise SMS messages become vulnerable to retroactive hijacking.

Shortyy eliminates this vulnerability at the protocol level.


Why PATCH is Omitted by Design

There is no PATCH /v1/links/:id or PUT /v1/links/:id endpoint in the Shortyy API. Attempting a PATCH request returns HTTP 404 or HTTP 405 Method Not Allowed.

This design ensures:

▪
Audit Compliance: A link created on a specific date will forever point to the URL recorded in the immutable audit log.
▪
Edge Cache Coherence: Distributed edge CDNs and Redis nodes can aggressively cache redirects with zero risk of cache invalidation desynchronization.
▪
Cryptographic Trust: Downstream consumers and compliance scanners can verify link destinations without fear of silent modification.

How to Update Targets

If your business requirements require changing a link's destination:

▪
Delete the existing short link using DELETE /v1/links/:id.
▪
The old code is permanently retired into tombstone reservation.
▪
Create a new short link pointing to the updated target URL.