Skip to main content

Overview

The FoN API is a RESTful API that allows you to interact with the FoN platform programmatically. All requests should be made to the base URL:

Authentication

Most endpoints require authentication, using one of three mechanisms depending on the endpoint:

Session Cookie

Cookie: auth-token=<jwt> — used by almost all endpoints (voting, tags, profile, uploads, MFA, password management, etc.)

JWT Bearer Token

Authorization: Bearer <jwt> — used only by the /api/auth/tokens token-management endpoints

API Token

Authorization: Bearer <api_token> — used only by /api/v1/upload
See the Authentication guide for full details, and each endpoint’s reference page for which mechanism it expects.

Request Format

JSON Requests

For endpoints that accept JSON, set the Content-Type header:

Form Data

For file uploads, use multipart/form-data:

Response Format

All responses are returned as JSON. There is no wrapper envelope — successful responses return the resource or domain object directly. For example, GET /api/uploads returns:

Error Responses

Errors follow the standard Nitro/H3 error shape, with a statusCode, statusMessage, and a descriptive message:

HTTP Status Codes

Rate Limits

The API enforces rate limits to ensure fair usage: When rate limited, you’ll receive a 429 response with a Retry-After header.

Pagination

List endpoints support pagination via query parameters:
Response includes pagination info:

Caching

The API uses caching to improve performance: Use the ETag header for conditional requests.

OpenAPI Specification

The complete API is documented using OpenAPI 3.1. You can:

View OpenAPI Spec

Download the full OpenAPI specification

Endpoints

Authentication

User registration, login, and session management

Uploads

Create, manage, and browse uploads

Voting

Vote on content

Tags

Tag management and discovery

Media

Image and thumbnail retrieval