Formatting; Creation dates

This commit is contained in:
Aslan 2025-12-25 00:24:40 +01:00
parent d1685fde77
commit a85fc8a49d
7 changed files with 94 additions and 41 deletions

View file

@ -1,5 +1,7 @@
## POST /api/v1/auth/register
### Request:
```json
{
"username": "string",
@ -11,6 +13,7 @@
Registers a new user
### Response (success):
```json
{
"id": "string",
@ -20,6 +23,7 @@ Registers a new user
```
### Response (error):
```json
{
"error": "user already exists"
@ -29,7 +33,9 @@ Registers a new user
---
## POST /api/v1/auth/login
### Request:
```json
{
"username": "string",
@ -40,6 +46,7 @@ Registers a new user
Logs in a user and returns a new session
### Response (success):
```json
{
"id": "string",
@ -49,6 +56,7 @@ Logs in a user and returns a new session
```
### Response (incorrect credentials):
```json
{
"ownerId": "string",

View file

@ -1,13 +1,16 @@
## GET /api/v1/channel/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns a channel with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"communityId": "string"
"communityId": "string",
"creationDate": 0
}
```

View file

@ -1,21 +1,26 @@
## GET /api/v1/community/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string"
"description": "string",
"creationDate": 0
}
```
## UPDATE /api/v1/community/{id}/name
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"name": "string"
@ -25,17 +30,20 @@ Returns a community with id = {id}
Updates name for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"name": "string"
}
```
## PATCH /api/v1/community/{id}/description
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"description": "string"
@ -45,19 +53,22 @@ Updates name for a community with id = {id}
Updates description for a community with id = {id}
### Response:
```json
{
"id": "string",
"description": "string",
"description": "string"
}
```
## GET /api/v1/community/{id}/members
*Requires an authentication header*
_Requires an authentication header_
Returns users for a community with id = {id}
### Response:
```json
{
"id": "string",
@ -72,11 +83,13 @@ Returns users for a community with id = {id}
```
## GET /api/v1/community/{id}/channels
*Requires an authentication header*
_Requires an authentication header_
Returns channels for a community with id = {id}
### Response:
```json
{
"id": "string",
@ -91,11 +104,13 @@ Returns channels for a community with id = {id}
```
## GET /api/v1/community/{id}/roles
*Requires an authentication header*
_Requires an authentication header_
Returns roles for a community with id = {id}
### Response:
```json
{
"id": "string",
@ -110,9 +125,11 @@ Returns roles for a community with id = {id}
```
## POST /api/v1/community/{id}/invite
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"userId": "string"
@ -122,20 +139,22 @@ Returns roles for a community with id = {id}
Creates an invite to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
"communityName": "string"
}
```
## POST /api/v1/community/{id}/join
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"userId": "string"
@ -145,11 +164,12 @@ Creates an invite to a community with id = {id}
Joins a user to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
"communityName": "string"
}
```

View file

@ -1,9 +1,11 @@
## GET /api/v1/invite/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns an invite with id = {id}
### Response:
```json
{
"id": "string",
@ -18,14 +20,16 @@ Returns an invite with id = {id}
```
## DELETE /api/v1/invite/{id}
*Requires an authentication header*
_Requires an authentication header_
Removes an invite with id = {id}
### Response:
```json
{
"id": "string",
"communityId": "string",
"communityId": "string"
}
```

View file

@ -1,13 +1,16 @@
## GET /api/v1/role/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns a role with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"communityId": "string"
"communityId": "string",
"creationDate": 0
}
```

View file

@ -1,25 +1,30 @@
## GET /api/v1/session/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns a session with id = {id}
### Response:
```json
{
"id": "string",
"userId": "string",
"creationDate": 0
}
```
## DELETE /api/v1/session/{id}
_Requires an authentication header_
Revokes a session with id = {id}
### Response:
```json
{
"id": "string",
"userId": "string"
}
```
## DELETE /api/v1/session/{id}
*Requires an authentication header*
Revokes a session with id = {id}
### Response:
```json
{
"id": "string",
"userId": "string",
}
```

View file

@ -1,9 +1,11 @@
## GET /api/v1/user/{id}
*Requires an authentication header*
_Requires an authentication header_
Returns a user with id = {id}
### Response:
```json
{
"id": "string",
@ -17,11 +19,13 @@ Returns a user with id = {id}
```
## GET /api/v1/user/{id}/sessions
*Requires an authentication header*
_Requires an authentication header_
Returns all sessions for a user with id = {id}
### Response:
```json
{
"sessions": [
@ -34,9 +38,11 @@ Returns all sessions for a user with id = {id}
```
## PATCH /api/v1/user/{id}/email
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"email": "string"
@ -46,17 +52,20 @@ Returns all sessions for a user with id = {id}
Updates email for a user with id = {id}
### Response:
```json
{
"id": "string",
"email": "string",
"email": "string"
}
```
## PATCH /api/v1/user/{id}/description
*Requires an authentication header*
_Requires an authentication header_
### Request:
```json
{
"description": "string"
@ -66,9 +75,10 @@ Updates email for a user with id = {id}
Updates description for a user with id = {id}
### Response:
```json
{
"id": "string",
"description": "string",
"description": "string"
}
```