REST API · JSON · No Auth Required

API Documentation

LinkPulse exposes a simple REST API for shortening URLs, redirecting, and retrieving analytics programmatically. All endpoints return JSON. No authentication required.

Base URL

https://linkpulse.vercel.app

Shorten a URL and optionally set a custom short code.

Request Body

url
stringrequired

The full URL to shorten (must start with http:// or https://)

customCode
stringoptional

Optional custom slug (3–20 chars, letters/numbers/-/_)

Response

{
  "code": "ab12Xkp",
  "shortUrl": "https://linkpulse.vercel.app/r/ab12Xkp",
  "originalUrl": "https://example.com/very/long/path",
  "createdAt": "2024-07-01T12:00:00.000Z"
}

cURL Example

curl -X POST https://linkpulse.vercel.app/api/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/very/long/path"}'

Error Codes

400Bad Request — missing or malformed body
404Not Found — short code does not exist
409Conflict — custom code already taken
422Unprocessable — invalid URL or code format