Add invitations and joining

This commit is contained in:
Aslan 2025-12-24 05:18:01 -05:00
parent 66b25d5135
commit d1685fde77
4 changed files with 131 additions and 2 deletions

View file

@ -12,6 +12,46 @@ Returns a community with id = {id}
} }
``` ```
## UPDATE /api/v1/community/{id}/name
*Requires an authentication header*
### Request:
```json
{
"name": "string"
}
```
Updates name for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
}
```
## PATCH /api/v1/community/{id}/description
*Requires an authentication header*
### Request:
```json
{
"description": "string"
}
```
Updates description for a community with id = {id}
### Response:
```json
{
"id": "string",
"description": "string",
}
```
## GET /api/v1/community/{id}/members ## GET /api/v1/community/{id}/members
*Requires an authentication header* *Requires an authentication header*
@ -68,3 +108,48 @@ Returns roles for a community with id = {id}
] ]
} }
``` ```
## POST /api/v1/community/{id}/invite
*Requires an authentication header*
### Request:
```json
{
"userId": "string"
}
```
Creates an invite to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
}
```
## POST /api/v1/community/{id}/join
*Requires an authentication header*
### Request:
```json
{
"userId": "string"
}
```
Joins a user to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
}
```

31
docs/api/invite.md Normal file
View file

@ -0,0 +1,31 @@
## GET /api/v1/invite/{id}
*Requires an authentication header*
Returns an invite with id = {id}
### Response:
```json
{
"id": "string",
"communityId": "string",
"valid": true,
"unlimitedInvites": false,
"hasExpiration": false,
"remainingInvites": 0,
"creationDate": 0,
"expirationDate": 0
}
```
## DELETE /api/v1/invite/{id}
*Requires an authentication header*
Removes an invite with id = {id}
### Response:
```json
{
"id": "string",
"communityId": "string",
}
```

View file

@ -10,3 +10,16 @@ Returns a session with id = {id}
"userId": "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

@ -33,7 +33,7 @@ Returns all sessions for a user with id = {id}
} }
``` ```
## POST /api/v1/user/{id}/email ## PATCH /api/v1/user/{id}/email
*Requires an authentication header* *Requires an authentication header*
### Request: ### Request:
@ -53,7 +53,7 @@ Updates email for a user with id = {id}
} }
``` ```
## POST /api/v1/user/{id}/description ## PATCH /api/v1/user/{id}/description
*Requires an authentication header* *Requires an authentication header*
### Request: ### Request: