Skip to main content

Scheduling & click caps

Links can open late, close early, and stop after N clicks. All three are optional; an unset one means "no constraint", never "unknown".

The fields​

FieldSet onClear on PATCH withNotes
starts_atPOST, PATCHclear_starts_at: trueScheduled start (RFC 3339). Absent means live from creation
expires_atPOST, PATCHclear_expiry: trueEnd of life (RFC 3339). Absent means never
max_clicksPOST, PATCHclear_max_clicks: trueStop resolving after this many clicks. A one-time link is simply 1
clicks_remainingread-only—Clicks left against the cap, from the same counter enforcement uses. Absent when uncapped, floored at 0

Setting starts_at or expires_at requires the expiry feature on the plan — the same paid feature gates both ends of the window. max_clicks has no separate gate.

# A launch link: opens Monday, closes Sunday, 500 clicks max
curl https://lsg.bio/api/v1/links \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"destination_url": "https://example.com/launch",
"starts_at": "2026-10-05T00:00:00Z",
"expires_at": "2026-10-11T23:59:59Z",
"max_clicks": 500
}'

# Lift the cap later without touching anything else
curl -X PATCH https://lsg.bio/api/v1/links/6cb5cd5b-a2c8-4238-b548-b25991bc0559 \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"clear_max_clicks": true}'

PATCH keeps its tri-state discipline here: omit a field to leave it alone, send a value to set it, send the clear_* flag to remove it. An absent max_clicks and "no cap" would otherwise be indistinguishable.

At the cap​

When the last click is served, the link stops resolving and a link.exhausted webhook fires exactly once — see webhooks. Lowering a cap below what has already been served reads clicks_remaining as 0 rather than a negative budget: the link is spent.