Conventions

Example flow

flowchart LR
	start([Start]) --> api[API]
	api -- query --> db[(Database)]
	db -- return --> resp[API response]
	resp --> finish([End])

POST /shorten

Purpose

Create a short URL mapping for an originalUrl with a fixed 10-day expiration.

Request body

{
  "originalUrl": "<https://google.com/>"
}

Response body (success)

{
  "shortCode": "ab12cd",
  "shortUrl": "<https://localhost:3000/ab12cd>",
  "expiresAt": "2026-05-30T10:00:00Z"
}

Validation

Status codes