API documentation

Use the ZIPN API to shorten URLs programmatically.

Overview

Guests can create up to 3 links for free every 24 hours.

Authentication (API key)

Sign in, create an API key in your profile, and send it in the request header. Links are then created under your personal code without expiry, and you can edit them and view stats in your dashboard.

Authorization: Bearer sk_short_...

Shorten a URL

POST /api/v1/shorten

Request parameters:

ParameterRequiredDescription
original_urlโœ…Original URL to shorten
custom_codeโŒCustom short code (generated automatically if omitted)
expire_durationโŒExpiration: 24h, 48h, 1week, 1month
code_idโŒWith an API key: the personal code ID to use (defaults to your primary code). Pass temp to create a temporary link that is still managed in your dashboard.

Example request:

curl -X POST https://zipn.app/api/v1/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "original_url": "https://example.com/very-long-url",
    "custom_code": "example",
    "expire_duration": "1week"
  }'

Success response (201):

{
  "status": "success",
  "message": "URL shortened successfully.",
  "data": {
    "short_url": "https://zipn.app/example/",
    "original_url": "https://example.com/very-long-url",
    "code": "example",
    "expiration_date": "2026-04-21T10:00:00.000Z"
  }
}

Request with an API key:

curl -X POST https://zipn.app/api/v1/shorten \
  -H "Authorization: Bearer sk_short_..." \
  -H "Content-Type: application/json" \
  -d '{
    "original_url": "https://example.com/very-long-url",
    "custom_code": "example"
  }'

Success response with an API key (201):

{
  "status": "success",
  "message": "URL shortened successfully.",
  "data": {
    "short_url": "https://zipn.app/mycode/example/",
    "original_url": "https://example.com/very-long-url",
    "code": "example",
    "expiration_date": "2126-03-28T10:00:00.000Z",
    "username": "mycode",
    "user_code_id": 12,
    "is_temp": false
  }
}

Error response:

{
  "status": "error",
  "message": "This short code is already in use."
}

Get API information

GET /api/v1/shorten

Returns endpoint information and available parameters.