PATCH/api/v6/urlshortener/links/{domain}/{code}

Update a short link

Change the state, the expiry or the destination. The code is immutable.

Scope and limits

Scope

API key with the urlshortener service enabled

Usage limit

35 requests per second

Updates the active state, the expiresAt date (send null to clear it) or the destination longUrl, which is revalidated. The code or alias is immutable. At least one field is required.

Path parameters

domain
stringrequired
Domain of the link.
code
stringrequired
Short code or alias (lowercase).

Request body

application/json
active
booleanoptional
Enables or disables the link.
expiresAt
stringoptional
New expiry, or null to clear it.
longUrl
stringoptional
New destination URL. Revalidated as on creation.
{
  "active": false
}

Responses

200

Link updated.

{
  "success": true,
  "data": {
    "id": 1024,
    "code": "a1b2c3d",
    "domain": "go.acme.co",
    "shortUrl": "https://go.acme.co/a1b2c3d",
    "longUrl": "https://example.com/landing?utm_source=sms",
    "alias": false,
    "active": true,
    "expiresAt": null,
    "createdAt": "2026-06-01T15:04:05Z",
    "clicks": 0,
    "uniqueClicks": 0,
    "lastClickAt": null
  },
  "meta": {
    "requestId": "8f0c0e2a4b1d4c8fae2b7a91e0c5d3f6",
    "timestamp": "2026-06-01T15:04:05+00:00",
    "responseTimeMs": 7.2
  }
}
400

Nothing to update, or an invalid field.

401

Invalid or missing credentials.

404

No link with that domain and code.

429

Request limit exceeded.

Possible errors

Codes this endpoint can return in error.code. The full detail lives in the catalog.

See the full catalog
PATCH /api/v6/urlshortener/links/{domain}/{code}
curl -X PATCH 'https://developers.hablame.co/api/v6/urlshortener/links/go.acme.co/a1b2c3d' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer hk_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{"active":false}'

Try-It

Run the request against the real API with your own API key.

The key is used only in your browser for this request. It is not stored nor sent anywhere else.

Parameters

Domain of the link.

Short code or alias (lowercase).

Request body

Enables or disables the link.

New expiry, or null to clear it.

New destination URL. Revalidated as on creation.

PATCH https://developers.hablame.co/api/v6/urlshortener/links/go.acme.co/a1b2c3d

Response

You have not sent a request yet.