From 1b024e31bbf95dc0df3b253ecc3572a1530100548066fa26a3eafbfc68c8d105 Mon Sep 17 00:00:00 2001 From: aslan Date: Mon, 22 Dec 2025 21:55:07 -0500 Subject: [PATCH] Add initial docs --- docs/api/auth.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/api/user.md | 15 +++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docs/api/auth.md create mode 100644 docs/api/user.md diff --git a/docs/api/auth.md b/docs/api/auth.md new file mode 100644 index 0000000..be67bac --- /dev/null +++ b/docs/api/auth.md @@ -0,0 +1,55 @@ +## POST /api/v1/register +### Body: +```json +{ + "username": "string", + "password": "string", + "email": "string" +} +``` + +Registers a new user + +### Returns (success): +```json +{ + "username": "string", + "registerDate": 0 +} +``` + +### Returns (error): +```json +{ + "error": "user already exists" +} +``` + +--- + +## POST /api/v1/login +### Body: +```json +{ + "username": "string", + "password": "string" +} +``` + +Logs in a user and returns a new session + +### Returns (success): +```json +{ + "owner": "string", + "token": "string" +} +``` + +### Returns (incorrect credentials): +```json +{ + "owner": "string", + "error": "incorrect credentials" +} +``` diff --git a/docs/api/user.md b/docs/api/user.md new file mode 100644 index 0000000..53eac68 --- /dev/null +++ b/docs/api/user.md @@ -0,0 +1,15 @@ +## GET /api/v1/user/{id} +Returns a user object with id = {id} + +### Returns: +```json +{ + "id": "string", + "username": "string", + "email": "string", + "description": "string", + "admin": false, + "registerDate": 0, + "lastLogin": 0 +} +```