API
REST API quickstart
A small, boring REST API. Base URL:
https://api.pinr.to/api/v1Authentication
Send your API key as a bearer token on every request:
Authorization: Bearer pinr_live_xxxxxxxxCreate a link
curl -X POST https://api.pinr.to/api/v1/links \
-H "Authorization: Bearer pinr_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/very/long/path","key":"spring"}'201 Created
{ "id": "…", "key": "spring", "short_url": "pinr.to/spring",
"url": "https://example.com/very/long/path", "click_count": 0 }Body fields: url (required), key (optional custom slug), title, comments, expires_at. Omit key and we generate one.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /me | The key's workspace |
| GET | /links | List links (?limit, ?offset) |
| POST | /links | Create a link |
| GET | /links/:id | Get one link |
| PATCH | /links/:id | Update url, title, comments, expires_at, archived |
| DELETE | /links/:id | Delete a link |
| GET | /links/:id/analytics | All-time + 30-day clicks and uniques |
Errors
Errors return a JSON body { "error": "message" } with the matching HTTP status - 400 invalid input, 401 bad or missing key, 404 not found, 409 slug taken.