Aller au contenu
Docs menu

Short links

Turn a short link off without deleting it

Disable a short link to stop it redirecting while keeping its back-half, settings and click history, then turn it back on later.

Updated

Disabling a short link stops it from redirecting but keeps everything else: the back-half, the destination, the options and the click history. Turn it back on and it works exactly as before. Deleting is permanent, so disable a link when you might need it again, for example a seasonal promotion you run every year or a link pointing at a page that's down for maintenance.

The Status column on the Links page shows Enabled or Disabled for each link. Switching a link on or off is done with the API for now, using an API key.

Send is_enabled: false with the link's current settings:

curl https://api.shortener.dev/v1/links/black-friday \
  -H "Authorization: Bearer $SHORTENER_API_KEY" > link.json

# set "is_enabled": false in link.json, then:
curl -X PUT https://api.shortener.dev/v1/links/black-friday \
  -H "Authorization: Bearer $SHORTENER_API_KEY" \
  -H "Content-Type: application/json" \
  -d @link.json

Send the whole link, not only is_enabled. An update replaces the link's settings, so fields you leave out, such as UTM parameters or a password, are removed. See Change where a short link goes for the details.

To turn the link back on, send the same request with is_enabled: true.

What visitors see

A disabled link returns a page that says "This link is not available" with HTTP status 404. It's the same page a deleted link shows, so visitors can't tell the difference.

For comparison, a link past its expiration date shows "This link has expired" with status 410.

The change reaches every visitor within about a minute, because short links are cached briefly at the edge.

Disable, expire or delete

You want toUse
Stop a link now and maybe bring it back laterDisable
Stop a link automatically at a set date and timeExpiration
Remove a link for good and free up the back-halfDelete

A disabled link still counts toward your plan's link limit, and its back-half stays reserved for you.