Skip to main content

API Documentation

Complete guide to integrating the TinyUR URL Shortener API into your applications

POST

Shorten URL

Create a short URL from a long URL with optional custom alias. Pass a personal API key (Account → API in your dashboard) as a Bearer token to save the link to your account; omit it to shorten anonymously. A key that's present but wrong is rejected with an error rather than falling back to anonymous.

Request Details

ENDPOINT URLhttps://tinyur.in/api/shorten

Parameters

Authorizationheader

Bearer <your API key> — attributes the short link to your account

Example: Bearer tur_live_xxxxxxxxxxxxxxxxxxxxxxxx
urlstring
Required

The URL to be shortened

Example: https://example.com/very-long-url
customAliasstring

Custom alias for the short URL (3-50 characters, letters, numbers, hyphens, and underscores only)

Example: my-custom-alias

Request Body

JSON
{
  "url": "https://example.com/very-long-url",
  "customAlias": "my-custom-alias"
}

Response Details

Success (200)
JSON
{
  "originalUrl": "string",
  "shortCode": "string",
  "shortUrl": "string"
}
Error
JSON
{
  "error": "string"
}