New endpoints

This commit is contained in:
Aslan 2025-12-28 04:29:04 +01:00
parent 983623dff2
commit c37a81e8fd
4 changed files with 80 additions and 10 deletions

View file

@ -14,3 +14,28 @@ Returns a channel with id = {id}
"creationDate": 0
}
```
## POST /api/v1/channel
_Requires an authorization header_
### Request:
```json
{
"name": "string",
"communityId": "string"
}
```
Creates a new channel and returns it
### Response:
```json
{
"id": "string",
"name": "string",
"communityId": "string"
}
```

View file

@ -9,10 +9,37 @@ Returns a community with id = {id}
"id": "string",
"name": "string",
"description": "string",
"ownerId": "string",
"creationDate": 0
}
```
## POST /api/v1/community
_Requires an authorization header_
### Request:
```json
{
"name": "string",
"description": "string?"
}
```
Creates a new community and returns it
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string",
"ownerId": "string"
}
```
## PATCH /api/v1/community/{id}
_Requires an authorization header_
@ -109,7 +136,6 @@ _Requires an authorization header_
```json
{
"creatorId": "string",
"totalInvites": "number?",
"expirationDate": "number?"
}

View file

@ -11,6 +11,7 @@ Returns an invite with id = {id}
"valid": true,
"unlimitedInvites": false,
"hasExpiration": false,
"totalInvites": 0,
"remainingInvites": 0,
"creationDate": 0,
"expirationDate": 0
@ -32,18 +33,10 @@ Removes an invite with id = {id}
}
```
## POST /api/v1/invite/{id}/accept
## GET /api/v1/invite/{id}/accept
_Requires an authorization header_
### Request:
```json
{
"userId": "string"
}
```
Accepts an invite and joins user to a community with id = {id}
### Response:

View file

@ -14,3 +14,29 @@ Returns a role with id = {id}
"creationDate": 0
}
```
## POST /api/v1/role
_Requires an authorization header_
### Request:
```json
{
"name": "string",
"communityId": "string",
"permissions": "string[]"
}
```
Creates a new role and returns it
### Response:
```json
{
"id": "string",
"name": "string",
"communityId": "string"
}
```