Add initial docs
This commit is contained in:
parent
3803d0cd09
commit
1b024e31bb
2 changed files with 70 additions and 0 deletions
55
docs/api/auth.md
Normal file
55
docs/api/auth.md
Normal file
|
|
@ -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"
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue