๐Ÿ”Œ api.link.to.it

Interactive demo ยท Documentation ยท OpenAPI

Get an API Key

POST /v1/keys/request

Request an API key via magic link. You'll receive an email with a one-time link to claim your key.

curl -X POST https://api.link.to.it/v1/keys/request \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","label":"my-app","terms_accepted":true}'
โ† Enter your email and click "Request Key"

Rate-limited: max 5 requests per hour. Key is shown only once โ€” save it!

Public Endpoints (No Auth)

GET /v1/captcha

Get a proof-of-work challenge for anonymous link creation.

curl https://api.link.to.it/v1/captcha
โ† Click "Run" to see result

GET /v1/check-hash

Check if a custom hash is available.

curl "https://api.link.to.it/v1/check-hash?hash=bio"
โ† Click "Run" to see result (bio is taken)

GET /v1/lookup

Check if a URL was already shortened.

curl "https://api.link.to.it/v1/lookup?url=https://kosmar.bio.link/"
โ† Click "Run" to see result

GET /v1/stats

Get click statistics for a short link.

curl "https://api.link.to.it/v1/stats?hash=bio"
โ† Click "Run" to see result

GET /v1/qr-resolve

Resolve a QR payload hash to its data.

curl "https://api.link.to.it/v1/qr-resolve?hash=bio"
โ† Click "Run" to see result

POST /v1/report

Report an abusive link.

curl -X POST https://api.link.to.it/v1/report \
  -H 'Content-Type: application/json' \
  -d '{"hash":"bio","reason":"spam","details":"Demo test"}'
โ† Click "Run" to see result

Note: This creates a real abuse report โ€” use sparingly.

Authenticated Endpoints (Need API Key)

Enter your API key to test authenticated endpoints. Without a key, you'll see a 401 error.

POST /v1/shorten

Create a new short link.

curl -X POST https://api.link.to.it/v1/shorten \
  -H 'Authorization: Bearer lti_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.org/demo"}'
โ† Click "Run" (expects 401 without API key)

GET /v1/usage

Get your API key usage statistics.

curl https://api.link.to.it/v1/usage \
  -H 'Authorization: Bearer lti_live_...'
โ† Click "Run" (expects 401 without API key)

POST /v1/bulk/shorten

Bulk create multiple short links (max 100).

curl -X POST https://api.link.to.it/v1/bulk/shorten \
  -H 'Authorization: Bearer lti_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"urls":["https://example.org/page1","https://example.org/page2"]}'
โ† Click "Run" (expects 401 without API key)

GET /v1/links/{hash}

Get details of a link you own.

curl https://api.link.to.it/v1/links/bio \
  -H 'Authorization: Bearer lti_live_...'

PATCH /v1/links/{hash}

Update a link's URL or rename its hash.

curl -X PATCH https://api.link.to.it/v1/links/bio \
  -H 'Authorization: Bearer lti_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.org/updated"}'

DELETE /v1/links/{hash}

Soft-delete a link (can't be undone via API).

curl -X DELETE https://api.link.to.it/v1/links/bio \
  -H 'Authorization: Bearer lti_live_...'