Skip to main content
PATCH
Update URL

Authorizations

Authorization
string
header
required

API key authentication. Pass your key as: Bearer spoo_<your_key>

Path Parameters

url_id
string
required

Unique identifier of the URL

Body

application/json

Request body for partially updating an existing shortened URL.

All fields are optional; only provided fields are updated. Pass max_clicks=0 or max_clicks=null to remove the limit. Pass password=null (or omit) to remove password protection.

long_url
string | null

New destination URL. Must be a valid http:// or https:// URL.

Example:

"https://example.com/updated/url"

alias
string | null

New custom short code. Pass null to keep existing. Must be unique and available.

Example:

"newlink"

password
string | null

New password. Pass null to remove password protection.

Example:

"newPass@456"

block_bots
boolean | null

Block known bot user agents. Pass null to keep existing setting.

max_clicks
integer | null

New click limit. Pass 0 or null to remove the limit.

Required range: x >= 0
Example:

500

expire_after

Expiration time. ISO 8601 string (e.g. 2025-12-31T23:59:59Z) or Unix epoch seconds (e.g. 1735689599). Pass null to remove.

Example:

"2025-12-31T23:59:59Z"

private_stats
boolean | null

Make statistics private (only owner can view). Pass null to keep existing.

status
enum<string> | null

URL status. ACTIVE enables redirects, INACTIVE disables them.

Available options:
ACTIVE,
INACTIVE
Example:

"ACTIVE"

Response

Successful Response

Response body after a successful URL update (PATCH /api/v1/urls/{url_id}).

id
string
required

MongoDB ObjectId of the URL.

Example:

"507f1f77bcf86cd799439011"

password_set
boolean
required

Whether the URL is password-protected.

updated_at
integer
required

Last update time as Unix timestamp.

Example:

1704067200

alias
string | null

Short code.

Example:

"mylink"

long_url
string | null

Destination URL.

Example:

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

status
string | null

URL status.

Example:

"ACTIVE"

max_clicks
integer | null

Click limit, or null if unlimited.

Example:

100

expire_after
integer | null

Expiration as Unix timestamp, or null.

Example:

1735689599

block_bots
boolean | null

Whether bot blocking is enabled.

private_stats
boolean | null

Whether statistics are private.