API Overview
Base URL
Section titled “Base URL”- Production:
https://api.korta.click/api/v1 - Local:
http://localhost:5000/api/v1
Developers page links
Section titled “Developers page links”- Public developers page:
/developers - “API Documentation” button target:
https://docs.korta.click/ - Developers page example base URL:
https://api.korta.click
API Style
Section titled “API Style”Korta API follows REST and standard HTTP semantics:
- Resource-oriented routes (
/auth,/urls) - HTTP verbs for actions (
GET,POST,PATCH,DELETE) - JSON request/response payloads
- Status codes that match operation results (
200,201,400,401,403,404,409,429,500)
Versioning
Section titled “Versioning”Versioning is path-based:
/api/v1
Current public version: v1.
Authentication
Section titled “Authentication”Korta supports two authentication modes:
- Bearer JWT:
Authorization: Bearer <access_token>- API Key:
X-API-Key: <api_key>Some endpoints are public (for example POST /urls/public), while others require authentication.
Common Request Format
Section titled “Common Request Format”POST /urls/public HTTP/1.1Host: api.korta.clickContent-Type: application/json{ "originalUrl": "https://example.com"}Common Response Format
Section titled “Common Response Format”Successful responses return JSON specific to each endpoint.
Success Example
Section titled “Success Example”{ "message": "URL shortened successfully", "shortUrl": "https://korta.click/abc12", "shortId": "abc12"}Error Format
Section titled “Error Format”Errors follow a consistent structure:
{ "statusCode": 400, "error": "Bad Request", "message": "Validation failed", "details": {}}detailsis optional and usually present for validation errors.