API reference
Update a link
Change a short link's destination, alias, expiry or activation time.
PATCHhttps://ishortn.ink/api/v1/links/{alias}
Updates one short link in your personal workspace. Send only the fields you want to change. The change takes effect for visitors straight away.
Request
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
alias | path | string | Yes | The link's current alias. |
domain | query | string | No | The link's domain. Defaults to your default domain, or isht.app. See Domains. |
The JSON body takes at least one of these fields:
| Field | Type | Description |
|---|---|---|
url | string | New destination. Must be a valid absolute URL. It goes through the link safety check again. |
alias | string | New alias, 1 to 20 characters: letters, numbers, - and _. The old alias stops working. |
expiresAt | string | null | Expiry date as ISO 8601 with a time zone, such as 2026-12-31T23:59:59Z. null removes it. |
activatesAt | string | null | Activation time as ISO 8601 with a time zone. Setting a time requires Pro or Ultra; null removes it on any plan. |
expiresAfter | integer | null | Click limit, a whole number above 0. null removes it. |
Any other field, such as password or domain, is rejected with 400. To change those, edit the link in the dashboard.
curl "https://ishortn.ink/api/v1/links/launch-day?domain=isht.app" \
-X PATCH \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/blog/launch-day-recap",
"expiresAt": null
}'Response
200 OK with the updated link, in the same shape as Get a link.
{
"shortLink": "https://isht.app/launch-day",
"url": "https://example.com/blog/launch-day-recap",
"alias": "launch-day",
"expiresAt": null,
"activatesAt": null,
"expiresAfter": null
}Errors
| Status | Body | Cause |
|---|---|---|
400 | Invalid request body | The body isn't valid JSON. |
400 | JSON list of validation issues | A field has the wrong type or format, or the body has a field that isn't listed above. |
400 | No update fields provided | The body is an empty object. |
400 | A link safety message | The new destination failed the safety check. |
401 | Invalid or missing API key | See Authentication. |
403 | Domain not available for this API key | domain isn't a platform domain or an active custom domain in your personal workspace. |
403 | Scheduled links are only available on Pro and Ultra plans | Setting activatesAt on the Free plan. |
404 | Link not found | No link with that alias on that domain in your personal workspace. |
409 | Alias already exists for this domain | The new alias is taken on that domain. |
500 | Failed to update link due to a server error | An unexpected server error. Retry later. |
429 | Rate limit exceeded. Retry in N seconds. | See Rate limits. |
Something missing or unclear? Email support@ishortn.ink.