API Docs
Public Routes

Public API Routes

This project relies on Cloudflare's Zero Trust for authenticating requests to the core API routes. This means that core routes will be exposed publically if Zero Trust is not configured. See Zero Trust Setup for more information on how to configure Zero Trust.

GET /api/external/links

Endpoint allows for creating links using a publically accessible API. This is useful for creating links from external services.

Headers

HeaderDescription
AuthorizationAn API key called API_KEY set in the wrangler.toml.

Body

ParameterDescriptionRequiredDefault
urlThe URL to shorten.YesN/A
ttlTime in seconds from creation that the link should be deletedNo7776000 (90 days)
metaMetadata to store with the link.NoEmpty object
ownerThe owner of the link.No'anonymous'

Response

Status CodeDescription
200Link created successfully.
400Missing required parameters.
401Invalid API key.

200 Response

{
    "slug": "example",
    "url": "https://example.com",
    "ttl": 7776000,
    "meta": {},
    "owner": "anonymous",
    "short_url": "https://example.ly/123"
}