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.

POSThttps://hep.gg/uploadAuth required
Send a link field to create a shortlink, or store plain text as a .txt file.

Shorten 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
curl -X POST https://hep.gg/upload \
  -H "Authorization: hyd-up-xxxxxxxxxxxx" \
  --data-urlencode "link=https://example.com/very/long/path?with=query"

Request

Body field
link
stringrequired
The value to shorten. If it matches a URL, it becomes a redirect shortlink. If it is plain text, it is stored as a .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"
}
Response fields
url
stringoptional
The full short URL on your serve host. Visiting it issues a 302 redirect to the target.
ID
stringoptional
The content ID (the slug portion of the short URL).

Storing 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
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

StatusWhen
200Shortlink or text stored.
400link missing or empty on a non-multipart request (Body is missing link property).
400A non-URL text value when your allowed types do not permit text (Not allowed to upload files with the supplied Content-Type).
401Token missing or revoked. See Authentication.
403Maintenance window, or uploader access suspended (Forbidden / ACCESS_REQUIRED).