ShortU REST API

Integrate link shortening and analytics directly into your applications.

Open interactive API docs

Recommendation: Use the interactive Swagger UI for full API reference, live request testing, and schema exploration. Open Swagger UI →

Authentication

Every request must carry your API token in the X-API-Token header.

X-API-Token: <your_api_token>

Generate and manage tokens from your profile page.

Rate Limits

Plan Calls per minute
Free6
Starter30
Pro120

Endpoints

POST /api/v1/shorten

Description: Shorten a single URL. Optionally provide a custom alias code.

Request body (JSON):

{ "long_url": "https://example.com/long/path", "custom_code": "my-alias" }

Success response (201):

{
  "short_url": "https://stu.cm/my-alias",
  "long_url":  "https://example.com/long/path",
  "code":      "my-alias"
}
POST /api/v1/shorten/bulk

Description: Shorten up to 100 URLs in a single call.

{ "urls": ["https://a.com/path1", "https://b.com/path2"] }
GET /api/v1/shorten/<code>/stats

Description: Retrieve total and unique click statistics for a link you own.

{
  "code":          "AbCdEf",
  "total_clicks":  142,
  "unique_clicks": 98
}
GET /api/v1/links

Description: List all links belonging to the authenticated token owner. Paginated.

PATCH /api/v1/shorten/<code>

Description: Update title, destination URL, expiry date or active status of an existing link. (Starter plan)

{ "long_url": "https://new-destination.com", "is_active": true }
DELETE /api/v1/shorten/<code>

Description: Permanently delete a short link. Only the owner can delete.

GET /api/v1/check/<code> No token required

Description: Publicly check the destination and safety status of any ShortU link. No authentication needed.

Ready to integrate?

Get your API token from your profile and start making requests today.