API Documentation
Every answer is JSON with a status code, also in the HTTP status
(200, 400, 403, 404, 413, 415, 429):
{ "statusCode": 0, "statusMessage": "Success", "data": { ... } }
Success = 0, NotFound = 1, Existing = 2, NoPermissions = 3, InvalidUrl = 4, NoFile = 5,
ChallengeFailed = 6, TooManyRequests = 7, FileTooLarge = 8, FileTypeNotAllowed = 9
Challenge
Creating a link or uploading a file takes a solved proof-of-work challenge. Get one, then find a
nonce (a decimal number) so that SHA-256("<salt>:<nonce>") starts with
difficulty zero bits. A challenge is valid for ten minutes and counts once.
GET /api/challenge
{ "statusCode": 0, "statusMessage": "Success",
"data": { "salt": "3f1c...", "difficulty": 19, "expires": 1795377000, "signature": "9a0b..." } }
Url Shortener
POST /api/shortlink
{ "longUrl": "https://example.com/some/long/path",
"challenge": { "salt": "3f1c...", "difficulty": 19, "expires": 1795377000, "signature": "9a0b...", "nonce": "48213" } }
{ "statusCode": 0, "statusMessage": "Success",
"data": { "createdOn": "2026-11-22T18:01:59Z", "alias": "vZ7dVq", "longUrl": "https://example.com/some/long/path",
"viewCount": 0, "shortUrl": "https://ohw.tf/vZ7dVq", "deletionToken": "BaCElazAK0u7YYM5GPJQwHa6ZY5dqnyR" } }
Existing comes back for a URL that is already shortened - without a deletion token.
Links to other shorteners, dynamic DNS hosts and known phishing hosts are refused as InvalidUrl.
GET /api/shortlink/{alias}
DELETE /api/shortlink/{alias}?token={deletionToken}
File Upload
Up to 50 MB, as multipart/form-data with the file in file and the
solved challenge as the fields salt, difficulty, expires, signature
and nonce. Executables, scripts and HTML are refused.
POST /api/files
GET /api/files/{name}
DELETE /api/files/{name}?token={deletionToken}
Limits
Per client and hour: 10 links, 10 uploads, 60 challenges.
With Authorization: Bearer <token> the owner of this instance needs no challenge and has no limits:
curl -H "Authorization: Bearer $OHWTF_TOKEN" -H "Content-Type: application/json" \
-d '{"longUrl":"https://example.com"}' https://ohw.tf/api/shortlink
curl -H "Authorization: Bearer $OHWTF_TOKEN" -F "file=@screenshot.png" https://ohw.tf/api/files