Developers

REST API v1

Create and manage short links from your own apps. Get your API key from Dashboard → Settings → API (Pro plan).

Authentication

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Create a link

POST https://tiny.pk/api/v1/links
{
  "url": "https://www.toyotawalton.com/career/",
  "domain": "tiny.pk",        // optional: cutt.pk | surl.pk | tiny.pk | your branded domain
  "alias": "jobs",               // optional
  "title": "Careers",            // optional
  "password": "secret",          // optional
  "expires_at": "2026-12-31 23:59:59",  // optional
  "max_clicks": 1000,            // optional
  "utm": {"source":"facebook","medium":"social","campaign":"jobs"}  // optional
}

200 OK
{ "ok": true, "id": 123, "short": "https://tiny.pk/jobs", "code": "jobs", "qr": "https://tiny.pk/qr/jobs" }

List links

GET https://tiny.pk/api/v1/links?page=1&q=search

Get a link + stats

GET https://tiny.pk/api/v1/links/{id}
GET https://tiny.pk/api/v1/links/{id}/stats?days=30

Update / delete

PUT    https://tiny.pk/api/v1/links/{id}     { "url": "https://new-destination", "alias": "new-alias" }
DELETE https://tiny.pk/api/v1/links/{id}

Bulk create

POST https://tiny.pk/api/v1/links/bulk
{ "links": [ {"url":"https://a.com"}, {"url":"https://b.com","alias":"b"} ] }

URL metadata (title, description, image)

GET https://tiny.pk/api/v1/meta?url=https://example.com

Errors

{ "error": "This alias is already taken on this domain" }   // HTTP 422
{ "error": "Unauthenticated" }                               // HTTP 401
{ "error": "Rate limit exceeded" }                           // HTTP 429 (120 requests / minute)

cURL example

curl -X POST https://tiny.pk/api/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://www.toyotawalton.com/career/","alias":"jobs"}'