nexlink/docs/api/community.md
2025-12-27 01:38:06 +01:00

129 lines
1.7 KiB
Markdown

## GET /api/v1/community/{id}
Returns a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string",
"creationDate": 0
}
```
## PATCH /api/v1/community/{id}
_Requires an authorization header_
### Request:
```json
{
"name": "string?",
"description": "string?"
}
```
Updates a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string"
}
```
## GET /api/v1/community/{id}/members
_Requires an authorization header_
Returns users for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"members": [
{
"id": "string",
"username": "string"
}
]
}
```
## GET /api/v1/community/{id}/channels
_Requires an authorization header_
Returns channels for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"channels": [
{
"id": "string",
"name": "string"
}
]
}
```
## GET /api/v1/community/{id}/roles
_Requires an authorization header_
Returns roles for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"roles": [
{
"id": "string",
"name": "string"
}
]
}
```
## POST /api/v1/community/{id}/invite
_Requires an authorization header_
### Request:
```json
{
"creatorId": "string",
"totalInvites": "number?",
"remainingInvites": "number?",
"expirationDate": "number?"
}
```
Creates an invite to a community with id = {id}
### Response:
```json
{
"id": "string",
"communityId": "string",
"communityName": "string"
}
```