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 has two public authentication endpoints. Neither requires an existing token. Both return a LoginResponse containing a JWT access token and the full user object.

POST /register

Registers a new user account and returns a JWT access token immediately. No email verification step is required. Auth required: No

Request body

username
string
required
Unique display name for the account. Must not already exist in the database.
email
string
required
Email address. Must be unique across all accounts.
password
string
required
Plain-text password. Stored as a SHA-256 hash — never in plain text.
full_name
string
User’s full name. Optional.
phone
string
Phone number. Optional.

Response — 200

accessToken
string
required
Signed JWT token. Valid for 30 minutes. Use as Authorization: Bearer <accessToken>.
token_type
string
required
Always "bearer".
user
object
required

Errors

StatusdetailCause
400"El usuario o email ya existe"username or email is already taken

Example

curl --request POST \
  --url https://kern-api.vercel.app/register \
  --header "Content-Type: application/json" \
  --data '{
    "username": "jaime",
    "email": "jaime@example.com",
    "password": "mypassword123",
    "full_name": "Jaime Gayo"
  }'

POST /login

Authenticates an existing user with their email address and password, and returns a fresh JWT access token. Auth required: No

Request body

email
string
required
The email address used when registering the account.
password
string
required
The account password in plain text. The API compares its SHA-256 hash against the stored hash.

Response — 200

Same LoginResponse structure as POST /register. See the response fields above.

Errors

StatusdetailCause
401"Email o contraseña incorrectos"No account found for that email, or password hash does not match

Example

curl --request POST \
  --url https://kern-api.vercel.app/login \
  --header "Content-Type: application/json" \
  --data '{
    "email": "jaime@example.com",
    "password": "mypassword123"
  }'

Build docs developers (and LLMs) love