API docs
Create short links over HTTP. No login or API key required.
Create a short link
POST https://dol.ink/api/links with the header Content-Type: application/json.
curl -X POST https://dol.ink/api/links \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com","expiresIn":"7d"}'Request fields
Each IP can create 100 links per day, shared across the website and API. Resets at midnight in China Standard Time (UTC+8).
- url · required
- A complete HTTP/HTTPS URL, up to 4096 characters, without embedded credentials.
- expiresIn · optional
- 1h, 1d, 7d or 30d. Defaults to 7d. Custom dates are not supported.
- code · optional
- 3–32 letters, digits, underscores or hyphens. Omit to generate automatically.
- password · optional
- Optional 4–128 character password, stored as a hash. Protected links show a password form at the original short URL. POST /api/links/{code}/unlock sets a long-lived HttpOnly access cookie after verification. Limited to 10 attempts per link/client in 10 minutes. Default sharing excludes the password.
- title · optional
- Optional note, up to 120 characters.
Success response · 201
{
"data": {
"code": "abc12345",
"url": "https://example.com/",
"shortUrl": "https://dol.ink/s/abc12345",
"active": true,
"expires_at": "2026-11-12T00:00:00.000Z",
"clicks": 0
}
}Share the shortUrl from the response. Short links return a 302 redirect. HEAD requests do not count as visits. Expired, disabled or missing links return 404.
Common errors
400: invalid input; 409: code conflict; 413: request exceeds 8 KiB; 503: service unavailable. Error format: {"error":"Error description"}.
This public endpoint only creates a link. It does not expose global lists or visit records.
Download OpenAPI specification ↗