Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jaimegayo/KERNDOCUMENTATION/llms.txt

Use this file to discover all available pages before exploring further.

The KERN API is a REST interface that powers the KERN Android fitness app. All requests and responses use JSON. The API is built with FastAPI v1.0.0 and deployed as a Vercel serverless function, so there is no persistent server process — each invocation is stateless.

Base URL

https://kern-api.vercel.app
Every path in this reference is relative to that base URL. The root endpoint (GET /) returns a health-check JSON confirming the version and the location of the interactive docs.

Interactive docs

FastAPI auto-generates a Swagger UI playground at:
https://kern-api.vercel.app/docs
You can use it to explore and test every endpoint without writing any code.

Request and response format

  • All request bodies must be sent as Content-Type: application/json.
  • All successful responses return Content-Type: application/json.
  • Dates are returned in ISO 8601 format (YYYY-MM-DDTHH:MM:SS+00:00).
  • Boolean values use JSON true/false.

Authentication

Protected endpoints require a JWT Bearer token in the Authorization header:
Authorization: Bearer <accessToken>
Tokens are obtained from POST /register or POST /login and expire after 30 minutes. See Authentication for full details.

API version

1.0.0 — defined in the FastAPI application constructor. No versioning prefix is used in the URL paths.

Endpoint groups

GroupEndpointsAuth required
AuthPOST /register, POST /loginNo
UsersGET /users/me, PUT /users/avatar, PUT /users/update_name, GET /users/stats, GET /users/my-routines, GET /users/my-history, POST /users/complete-quizYes
RoutinesGET /routines/{id}, POST /routines/create, PUT /routines/{id}, DELETE /routines/{id}Yes
ExercisesGET /exercises/gym, GET /exercises/home, GET /exercises/{id}No
WorkoutsPOST /workouts/finishYes

Auth endpoints

Register a new account or log in to receive a JWT token.

User endpoints

Read and update profile data, stats, routines, and history.

Routine endpoints

Create, retrieve, update, and delete workout routines.

Exercise endpoints

Browse the gym and home exercise catalogs.

Workout endpoints

Save completed training sessions to the history log.

Data models

Full reference for all Pydantic and SQLAlchemy models.

Build docs developers (and LLMs) love