Update a link

THE CALL, PART BY PART

method

PATCH

host

strait.link

version

/v1

resource

/links/{slug}

PATCH /v1/links/{slug}

Auth: secret key as Authorization: Bearer. Server-side only.

Request

Send only the fields to change. null clears expiresAt (never expires), expiredAction (back to the workspace setting), expiredUrl, startsAt (live now), notLiveAction (the coming-soon page), notLiveUrl and countryRules (null or [] = none; a list replaces all rules). isActive is sent on its own: false pauses the link (same as DELETE). true answers the active link with this slug if there is one (safe to retry; check its longUrl), else turns the most recently paused one back on (taps follow within 30 seconds, like any edit). A link disabled for abuse cannot be turned back on (409 link_blocked).

Parameters

slug required string path
The link's slug: the part after your link domain, e.g. summer

Body (JSON)

longUrl string
https only
title string
tags string[]
expiresAt object
expiredAction "page" | "store" | "url" | "null"
Where taps go once the link has expired (see NewLink); null = the workspace setting.
expiredUrl string,null
https; required when expiredAction is url.
startsAt object
Scheduled go-live (see NewLink); null = live now.
notLiveAction "page" | "store" | "url" | "null"
Where taps go before startsAt (see NewLink); null = the coming-soon page.
notLiveUrl string,null
https; required when notLiveAction is url.
isActive boolean
Send alone. false = pause, true = turn the paused link back on.
webTapId boolean,null
strait_click on web pages for this link (see NewLink); null = follow the workspace setting.
countryRules array,null
Replaces all country rules (see NewLink); null or [] removes them.

Response

  • 200 Updated
  • 400 Invalid field, isActive sent with other fields, or destination_blocked (a URL failed the unsafe-destination check; field names which one; with isActive: true the link stays paused)
  • 404 Not found (with isActive: true: no paused or active link with this slug)
  • 409 isActive: true refused: link_blocked (disabled for abuse) or slug_in_use (the database refused: a link created at the same moment, or the same Firebase link is on)
Request · curl
curl -X PATCH https://strait.link/v1/links/summer \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "longUrl": "https://shop.example.com/sale/summer-v2",
    "expiresAt": "2026-12-31T23:59:59Z"
  }'

The response, printed

Response 200
{
  "id": "lnk_5f0c2a8e-3b1d-4f6a-9c7e-2d8b1a0e4f63",
  "tenantId": "0b8f6d2e-7a41-4c39-9e15-3f2a6c8d1b70",
  "slug": "summer",
  "shortUrl": "https://hilltop.strait.link/summer",
  "longUrl": "https://shop.example.com/sale/summer-v2",
  "isActive": true,
  "title": "Summer sale",
  "campaign": "summer-2026",
  "tags": [
    "sale"
  ],
  "expiresAt": 1798761599000
}