Linkshort logo

REST API

JSON in, JSON out.

Every endpoint runs inside Appwrite Sites. Rate limit: 2 creations per second per IP or API key.

POST /api/v1/links

Create a short link.

curl -X POST https://shortlinks.bhaumicsingh.tech/api/v1/links   -H 'Content-Type: application/json' \
          -H 'Authorization: Bearer <optional-linkshort-api-key>'           -d '{"url":"https://drive.google.com/file/d/example/view?usp=drive_link"}'
{
  "slug": "aB3xQ9",
          "shortUrl": "https://shortlinks.bhaumicsingh.tech/google_drive/aB3xQ9",
          "originalUrl": "https://drive.google.com/file/d/example/view?usp=drive_link",
          "cleanedUrl": "https://drive.google.com/file/d/example/view",
          "platform": "google_drive",
          "platformHost": "drive.google.com",
  "createdAt": "2026-01-01T00:00:00.000Z"
}

GET /api/v1/links/:slug

Read metadata for an existing link.

GET /:platform/:slug

Follow a generated short link, for example /google_drive/aB3xQ9. Older slug-only links continue to redirect for compatibility.

POST /api/v1/clean

Strip tracking params without creating a short link. Useful as a preview step before saving.

GET /api/health

Lightweight readiness probe.

Errors

400 — invalid URL or body. 404 — slug not found, expired, or reserved. 429 — rate limit, with Retry-After: 1.