Skip to main content
POST
/
shorten
Create Shortened URL
curl --request POST \
  --url https://spoo.me/api/v1/shorten \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "long_url": "https://example.com/very/long/url",
  "alias": "mylink",
  "password": "secure123",
  "max_clicks": 100,
  "expire_after": 1735689600,
  "block_bots": true,
  "private_stats": false
}
'
{
  "alias": "mylink",
  "short_url": "https://spoo.me/mylink",
  "long_url": "https://example.com/very/long/url",
  "owner_id": "507f1f77bcf86cd799439011",
  "created_at": 1704067200,
  "status": "ACTIVE",
  "private_stats": false
}

Authorizations

Authorization
string
header
required

API key in format: spoo_. Use in Authorization header as 'Bearer spoo_'

Body

application/json
long_url
string<uri>
required

The original URL to shorten. Must start with http:// or https://

Maximum string length: 2048
Example:

"https://example.com/very/long/url"

alias
string

Custom short code/alias for the URL. Alphanumeric, hyphens, and underscores only. Auto-generated if not provided. Auto truncated to 16 characters if longer.

Required string length: 3 - 16
Example:

"mylink"

password
string

Password to protect the shortened URL. Minimum 8 characters long, must contain a letter and a number and a special character either '@' or '.' and cannot be consecutive

Minimum string length: 8
Example:

"secure123"

max_clicks
integer

Maximum number of clicks allowed. URL becomes inactive after limit reached.

Required range: x >= 1
Example:

100

expire_after
integer

Expiration timestamp (Unix epoch seconds). Must be in the future.

Example:

1735689600

block_bots
boolean

Block known bot user agents from accessing the URL.

Example:

true

private_stats
boolean

Make statistics private (only owner can view). Requires authentication.

Example:

false

Response

URL successfully shortened

alias
string
Example:

"mylink"

short_url
string<uri>
Example:

"https://spoo.me/mylink"

long_url
string<uri>
Example:

"https://example.com/very/long/url"

owner_id
string

User ID if authenticated, null otherwise

Example:

"507f1f77bcf86cd799439011"

created_at
integer

Unix timestamp

Example:

1704067200

status
enum<string>
Available options:
ACTIVE,
INACTIVE
Example:

"ACTIVE"

private_stats
boolean
Example:

false