Context for link CRUD operations.
Summary
Functions
Archives a link (soft delete, frees up domain/key).
Archives a link, scoped to a workspace.
Creates a tracked link.
Gets a link by ID.
Gets a link by ID, scoped to a workspace.
Gets a link by domain and key (only non-archived).
Gets all non-archived links that share a key, across every domain.
Atomically increments click counters on a link.
Gets click events for a link.
Gets click events for a link, scoped to a workspace.
Gets aggregated stats for a link.
Lists links for a workspace with optional filters.
Resolves a live (non-archived, non-expired) link by domain and key.
Resolves a live (non-archived, non-expired) link by key alone, ignoring domain.
Updates a link.
Updates a link, scoped to a workspace.
Functions
Archives a link (soft delete, frees up domain/key).
Archives a link, scoped to a workspace.
Creates a tracked link.
Gets a link by ID.
Gets a link by ID, scoped to a workspace.
Gets a link by domain and key (only non-archived).
Gets all non-archived links that share a key, across every domain.
Atomically increments click counters on a link.
Gets click events for a link.
Gets click events for a link, scoped to a workspace.
Gets aggregated stats for a link.
Lists links for a workspace with optional filters.
Resolves a live (non-archived, non-expired) link by domain and key.
Returns {:ok, link}, {:error, :not_found}, or {:error, :expired}.
Resolves a live (non-archived, non-expired) link by key alone, ignoring domain.
Useful when the public host is unavailable at redirect time — e.g. behind a
CDN/edge proxy that rewrites the Host header, or when the short-link domain
differs from the backend host. Keys are globally unique in practice, but the
(domain, key) schema permits the same key under different domains, so this
returns {:error, :ambiguous} when more than one live link shares the key.
Returns {:ok, link}, {:error, :not_found}, {:error, :expired}, or
{:error, :ambiguous}.
Updates a link.
Updates a link, scoped to a workspace.