Skip to content

API Overview

  • Production: https://api.korta.click/api/v1
  • Local: http://localhost:5000/api/v1
  • Public developers page: /developers
  • “API Documentation” button target: https://docs.korta.click/
  • Developers page example base URL: https://api.korta.click

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 is path-based:

/api/v1

Current public version: v1.

Korta supports two authentication modes:

  1. Bearer JWT:
Authorization: Bearer <access_token>
  1. API Key:
X-API-Key: <api_key>

Some endpoints are public (for example POST /urls/public), while others require authentication.

POST /urls/public HTTP/1.1
Host: api.korta.click
Content-Type: application/json
{
"originalUrl": "https://example.com"
}

Successful responses return JSON specific to each endpoint.

{
"message": "URL shortened successfully",
"shortUrl": "https://korta.click/abc12",
"shortId": "abc12"
}

Errors follow a consistent structure:

{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation failed",
"details": {}
}
  • details is optional and usually present for validation errors.