pinrpinr
API

REST API quickstart

A small, boring REST API. Base URL:

https://api.pinr.to/api/v1

Authentication

Send your API key as a bearer token on every request:

Authorization: Bearer pinr_live_xxxxxxxx
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

MethodPathWhat it does
GET/meThe key's workspace
GET/linksList links (?limit, ?offset)
POST/linksCreate a link
GET/links/:idGet one link
PATCH/links/:idUpdate url, title, comments, expires_at, archived
DELETE/links/:idDelete a link
GET/links/:id/analyticsAll-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.

PreviousCreate an API key
Didn't answer your question?

Email [email protected] or browse more topics.

All help topics