POST/api/v6/urlshortener/links/{domain}/{code}/restore

Restore a deleted link

Brings back a link of yours that you deleted, with the same code and no new charge.

Scope and limits

Scope

API key with the urlshortener service enabled and the urlshortener.write capability granted

Usage limit

35 requests per second

The code of a deleted link is never released, so you cannot create it again (creating with that alias returns 409 ALIAS_RETIRED). With this endpoint you restore it: it comes back with its destination, its expiry and the status it had when you deleted it —if it was disabled, it comes back disabled—, and its earlier visits keep counting. It is not charged again. You can do it for 90 days after deleting it: after that the link is archived and restoring it returns 404 LINK_NOT_FOUND.

  • Restoring a link that is not deleted returns it as is: you can retry safely.
  • A link blocked by Hablame cannot be restored (409 LINK_BLOCKED).
  • Who restored it is recorded. It shares the usage limit of editing.

Requires a key that can write

Besides the urlshortener service, the API key needs the urlshortener.write capability, which only an owner or an administrator of your organization can grant when creating the key. Without it, the key lists and reads links, statistics, the overview, the domains and the pricing, and gets 403 AUTH_CAPABILITY_NOT_ALLOWED here.

Path parameters

domain
stringrequired
Domain of the link, as the API returns it in domain. Compared in lowercase. It names the link that answers at that short URL today; for one on a domain that no longer belongs to your organization (domainStatus: released), add domainStatus=released.
code
stringrequired
Code or alias of the link. Compared in lowercase.

Query parameters

domainStatus
stringoptional
With released, the link is the one on a domain that no longer belongs to your organization (the one the list returns with domainStatus: released), even if that name is today another domain with the same code. Without it, domain names the domain that has that name today. Any other value returns 400 VALIDATION_INVALID_PARAMETER.
released

Responses

200

The link, already restored.

{
  "success": true,
  "data": {
    "domain": "h0b.co",
    "code": "a1b2c3d",
    "shortUrl": "https://h0b.co/a1b2c3d",
    "longUrl": "https://example.com/landing?utm_source=sms",
    "isAlias": false,
    "status": "active",
    "domainStatus": "active",
    "expiresAt": null,
    "createdAt": "2026-09-23T15:04:05Z",
    "clicks": 0,
    "uniqueClicks": 0,
    "firstClickAt": null,
    "lastClickAt": null
  },
  "meta": {
    "requestId": "8f0c0e2a4b1d4c8fae2b7a91e0c5d3f6",
    "timestamp": "2026-09-23T18:30:00+00:00",
    "responseTimeMs": 7.2
  }
}
401

Invalid or missing credentials.

403

The API key does not have the URL shortener enabled (or it is turned off for your organization), lacks the urlshortener.write capability to create and edit links, cannot be used from the request network, or the organization is not active.

404

No link of your organization with that domain and code (deleted or not).

409

The link is blocked by Hablame.

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
POST /api/v6/urlshortener/links/{domain}/{code}/restore
curl -X POST 'https://developers.hablame.co/api/v6/urlshortener/links/h0b.co/a1b2c3d/restore' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer hk_YOUR_API_KEY'

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, as the API returns it in domain. Compared in lowercase. It names the link that answers at that short URL today; for one on a domain that no longer belongs to your organization (domainStatus: released), add domainStatus=released.

Code or alias of the link. Compared in lowercase.

With released, the link is the one on a domain that no longer belongs to your organization (the one the list returns with domainStatus: released), even if that name is today another domain with the same code. Without it, domain names the domain that has that name today. Any other value returns 400 VALIDATION_INVALID_PARAMETER.

POST https://developers.hablame.co/api/v6/urlshortener/links/h0b.co/a1b2c3d/restore

Response

You have not sent a request yet.