URL shortener
Shorten a URL or store a text snippet by POSTing a link field to /upload.
URL shortener
The same POST /upload endpoint shortens URLs and stores text snippets. Send a link field instead of a file part. This is the only programmatic shortening path, the dashboard's vanity-alias creation is not a public API.
https://hep.gg/uploadAuth requiredShorten a URL
Send link=<url> as application/x-www-form-urlencoded, or as a link field inside a multipart form. If the value parses as a URL, it is stored as a shortlink row.
curl -X POST https://hep.gg/upload \
-H "Authorization: hyd-up-xxxxxxxxxxxx" \
--data-urlencode "link=https://example.com/very/long/path?with=query"const res = await fetch("https://hep.gg/upload", {
method: "POST",
headers: {
Authorization: "hyd-up-xxxxxxxxxxxx",
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
link: "https://example.com/very/long/path?with=query",
}),
});
const { url, ID } = await res.json();
console.log(url); // https://i.hep.gg/abc123Request
link.txt file (see Storing text). Accepts application/x-www-form-urlencoded or a multipart link field. If link is missing or empty on a non-multipart request, the endpoint returns 400 Body is missing link property.Response
A successful shorten returns 200 with the public URL and content ID. Unlike a file upload, the shortlink url and ID carry no file extension:
{
"url": "https://i.hep.gg/abc123",
"ID": "abc123"
}url302 redirect to the target.IDStoring text
If the link value is not a URL, it is treated as plain text and stored as a <timestamp>.txt file under your account. This is gated by your allowed MIME types: text storage works only if your allowed-types list includes text/plain, text/*, or */*. If text is not permitted, the request returns 400 with Not allowed to upload files with the supplied Content-Type.
curl -X POST https://hep.gg/upload \
-H "Authorization: hyd-up-xxxxxxxxxxxx" \
--data-urlencode "link=just some notes I want to keep"The response shape is identical to the shortlink path ({ url, ID }), and the URL serves the stored text.
Errors
| Status | When |
|---|---|
200 | Shortlink or text stored. |
400 | link missing or empty on a non-multipart request (Body is missing link property). |
400 | A non-URL text value when your allowed types do not permit text (Not allowed to upload files with the supplied Content-Type). |
401 | Token missing or revoked. See Authentication. |
403 | Maintenance window, or uploader access suspended (Forbidden / ACCESS_REQUIRED). |