Short API

Create short links from your own site or script with one POST request. To shorten one by hand, use the shortener.

Create a short link

POST https://short.sinkmailer.com/gen

Send the URL to shorten in the request body. The response is the short URL as plain text, and nothing else:

curl --data-urlencode 'url=https://example.com/?a=1&b=2' https://short.sinkmailer.com/gen
https://short.sinkmailer.com/AbC123xy

There is no QR code; the shortener page draws one for each link.

Request

Any of these bodies works.

Form field

curl --data-urlencode 'url=https://example.com/?a=1&b=2' -d expires_in=7d https://short.sinkmailer.com/gen

Use --data-urlencode, not -d, for the URL: -d sends it unencoded, so every & in it would start a new field.

JSON

curl -H 'Content-Type: application/json' \
  -d '{"url": "https://example.com/?a=1&b=2", "expires_in": "30d"}' \
  https://short.sinkmailer.com/gen

The bare URL as the whole body

curl -H 'Content-Type: text/plain' --data-binary 'https://example.com/?a=1&b=2' \
  'https://short.sinkmailer.com/gen?expires_in=7d'

Sent byte for byte, whatever the content type. Put expires_in in the query string, as there is no other field.

multipart/form-data (curl -F, or a browser FormData) is accepted as well.

Fields

FieldRequiredMeaning
url Yes An absolute http:// or https:// URL, at most 15,000 characters.
expires_in No How long the link works. never, the default, or a number of seconds, or a number followed by s, m, h, d, w or y: 90m, 12h, 7d, 1y. At most 100 years.

Response

200 with the short URL as text/plain. If the request body is JSON, or the request sends Accept: application/json, the response is JSON instead:

{
  "short_url": "https://short.sinkmailer.com/AbC123xy",
  "code": "AbC123xy",
  "url": "https://example.com/?a=1&b=2",
  "created_at": "2026-11-30T17:10:00.000Z",
  "expires_at": "2026-12-30T17:10:00.000Z"
}

expires_at is null for a link that never expires. url is the URL as stored, normalised the way a browser would request it: scheme and host lower-cased, non-ASCII characters percent-encoded, and /./ and /../ resolved.

Codes are at least eight characters from a-z, A-Z and 0-9, and case-sensitive.

Errors

The reason comes back as plain text, or as {"error": "…"} in JSON mode.

StatusWhen
400No url; not an absolute http(s) URL; longer than 15,000 characters; an expires_in it cannot read.
405Anything but POST, or GET for this page.
413The request body is larger than 75 KB.
429More than 60 links in a minute from one address. The Retry-After header says how many seconds to wait.

From a browser

Every origin may call it: responses carry Access-Control-Allow-Origin: * and CORS preflight is answered. No cookies or credentials are involved.

const response = await fetch("https://short.sinkmailer.com/gen", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: longUrl, expires_in: "7d" }),
});
const { short_url, error } = await response.json();

Following a short link

A short link answers 302 with the stored URL in its Location header, and Referrer-Policy: no-referrer, so the destination does not learn which short link was used. Once a link expires, or if it never existed, it answers 404. Following links is never rate limited.