nexlink/docs/api/community.md
2026-01-10 19:26:31 -05:00

190 lines
2.5 KiB
Markdown

## GET /api/v1/community/{id}
Returns a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string",
"ownerId": "string",
"creationDate": "number"
}
```
## 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",
"creationDate": "number"
}
```
## 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",
"ownerId": "string",
"creationDate": "number"
}
```
## DELETE /api/v1/community/{id}
_Requires an authorization header_
Removes a community with id = {id}
### Response:
```json
{
"id": "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"
}
]
}
```
## GET /api/v1/community/{id}/invites
_Requires an authorization header_
Returns invites for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"invites": [
{
"id": "string"
}
]
}
```
## POST /api/v1/community/{id}/invite
_Requires an authorization header_
### Request:
```json
{
"totalInvites": "number?",
"expirationDate": "number?"
}
```
Creates an invite to a community with id = {id}
### Response:
```json
{
"id": "string",
"inviteId": "string"
}
```