TinyThis API Docs
Use bearer API keys to create short links, upload hosted files, and fetch raw textual web responses through predictable JSON endpoints.
https://www.tinythis.com/api/v1
Authentication
Every API endpoint requires a bearer API key and an Accept: application/json header. Raw keys are only shown once when created and are stored hashed at rest.
Authorization: Bearer tt_live_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
/links/shortenShorten a URL
Create a fresh short code for a public HTTP or HTTPS URL.
201 Created with the original URL, short code, and short URL.curl -X POST https://www.tinythis.com/api/v1/links/shorten \
-H "Authorization: Bearer tt_live_your_api_key" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/some/long/path"}'
{
"success": true,
"data": {
"id": 42,
"short_code": "abc1234",
"short_url": "https://tinythis.com/abc1234",
"original_url": "https://example.com/some/long/path",
"created_at": "2026-10-17T10:00:00.000000Z"
}
}
/filesUpload a hosted file
Upload a file with multipart form data. Files are private by default; private uploads do not return a permanent direct storage URL.
private or public. Defaults to private.url is the TinyThis short URL. Each visit creates a tracked temporary signed storage URL using the configured Spaces/CDN hostname.url and direct_url are permanent storage/CDN URLs that do not require signing.short_url is always available and tracked. Requests to a public direct_url bypass TinyThis and cannot be tracked.curl -X POST https://www.tinythis.com/api/v1/files \
-H "Authorization: Bearer tt_live_your_api_key" \
-H "Accept: application/json" \
-F "file=@invoice.pdf" \
-F "visibility=private"
Private response
{
"data": {
"id": "0199...",
"original_name": "invoice.pdf",
"mime_type": "application/pdf",
"size_bytes": 843221,
"short_code": "abc1234",
"visibility": "private",
"url": "https://tinythis.com/f/abc1234",
"short_url": "https://tinythis.com/f/abc1234",
"direct_url": null,
"created_at": "2026-10-17T10:00:00.000000Z"
}
}
Public response
{
"data": {
"id": "0199...",
"original_name": "image.webp",
"mime_type": "image/webp",
"size_bytes": 128400,
"short_code": "def5678",
"visibility": "public",
"url": "https://cdn.example.com/hosted-files/2026/10/17/file.webp",
"short_url": "https://tinythis.com/f/def5678",
"direct_url": "https://cdn.example.com/hosted-files/2026/10/17/file.webp",
"created_at": "2026-10-17T10:00:00.000000Z"
}
}
/fetchesFetch a textual URL
Fetch a public HTTP or HTTPS URL with GET and receive the raw textual response body inside JSON.
optimize or best. Defaults to optimize.false; true bypasses the cache.200 OK with response headers, UTF-8 body, source, timing, cache, and cost information.curl -X POST https://www.tinythis.com/api/v1/fetches \
-H "Authorization: Bearer tt_live_your_api_key" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","mode":"optimize","fresh":false}'
{
"success": true,
"data": {
"request_id": "01...",
"url": "https://example.com",
"status_code": 200,
"headers": {"content-type": ["text/html; charset=UTF-8"]},
"body": "<html>...</html>",
"content_type": "text/html; charset=UTF-8",
"source": "direct",
"origin": "direct",
"mode": "optimize",
"cache_hit": false,
"cost": "0",
"duration_ms": 184,
"fetched_at": "2026-10-17T10:00:00.000000Z"
}
}
Errors
Authentication errors use success and message. Validation errors use Laravel's standard message and field-keyed errors object.
{
"message": "The selected visibility is invalid.",
"errors": {
"visibility": ["The selected visibility is invalid."]
}
}
Fetch failures return the request ID when one was created:
{
"success": false,
"message": "The target could not return a usable textual response.",
"request_id": "0199..."
}