API

Create and manage short links from scripts and apps. The API is free. Create a key in your dashboard under API keys, then send it as a bearer token.

Authentication

Authorization: Bearer gz_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are shown once. Treat them like passwords: anyone with your key can create and edit links in your account. Revoke a leaked key from the dashboard.

Limits

Create a link

curl -X POST https://gozi.to/api/my/links \
  -H "Authorization: Bearer $GOZI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/launch", "code": "launch"}'

code is optional (4–32 letters, numbers, - or _). Leave it out for a random 7-character code. Response 201:

{
  "link": {
    "code": "launch",
    "shortUrl": "https://gozi.to/launch",
    "url": "https://example.com/launch",
    "status": "active",
    "statusReason": null,
    "custom": true,
    "createdAt": 1790000000000,
    "expiresAt": null
  }
}

List links

GET /api/my/links?limit=25&cursor=<nextCursor>&q=<search>&clicks=1

Newest first. Pass nextCursor from the previous page to get the next one. clicks=1 adds all-time human click counts.

Get, edit, delete

GET    /api/my/links/{code}
PATCH  /api/my/links/{code}   {"url": "https://new.example"}  or  {"status": "disabled" | "active"}
DELETE /api/my/links/{code}

Analytics

GET /api/my/links/{code}/stats

Returns human clicks for the last 90 days and all time, clicks per day, and top countries, referrers, devices, browsers and operating systems. Bots and link previews (Slack, WhatsApp, and so on) are counted separately in botClicks. Results are cached for about 5 minutes.

Errors

Errors use HTTP status codes and a JSON body:

{ "error": { "code": "slug_taken", "message": "That custom link is already taken." } }