mirror of
https://codeberg.org/pronounscc/pronouns.cc.git
synced 2024-11-20 08:19:52 +01:00
docs: add other endpoints
This commit is contained in:
parent
bc1948316c
commit
c6195218c5
3 changed files with 48 additions and 1 deletions
|
@ -33,6 +33,7 @@ export default defineConfig({
|
|||
{ text: "Object reference", link: "/api/endpoints/" },
|
||||
{ text: "Users", link: "/api/endpoints/users" },
|
||||
{ text: "Members", link: "/api/endpoints/members" },
|
||||
{ text: "Other", link: "/api/endpoints/other" },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
46
docs/api/endpoints/other.md
Normal file
46
docs/api/endpoints/other.md
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Other endpoints
|
||||
|
||||
There are some endpoints that are neither user or member related:
|
||||
|
||||
### Get statistics
|
||||
|
||||
#### `GET /meta`
|
||||
|
||||
Get aggregate statistics for pronouns.cc.
|
||||
Note: a user is considered active if they have updated their profile, created a member, deleted a member,
|
||||
or updated a member's profile in the given time period.
|
||||
|
||||
#### Response body
|
||||
|
||||
| Field | Type | Description |
|
||||
| -------------- | ----------------- | ------------------------------------------------------------------------- |
|
||||
| git_repository | string | link to the project's Git repository |
|
||||
| git_commit | string | the commit the backend is built from |
|
||||
| users | user count object | the total number of users |
|
||||
| members | int | the total number of non-hidden members |
|
||||
| require_invite | bool | whether invites are required to sign up. _Always `false` for pronouns.cc_ |
|
||||
|
||||
#### User count object
|
||||
|
||||
| Field | Type | Description |
|
||||
| ------------ | ---- | ------------------------------------------- |
|
||||
| total | int | total number of users |
|
||||
| active_month | int | number of users active in the last month |
|
||||
| active_week | int | number of users active in the last week |
|
||||
| active_day | int | number of users active in the last 24 hours |
|
||||
|
||||
### Get warnings
|
||||
|
||||
#### `GET /auth/warnings`
|
||||
|
||||
**Requires authentication.** Returns an array of warnings the currently authenticated user has.
|
||||
Add `?all=true` query parameter to return all warnings, not just unread ones.
|
||||
|
||||
#### Response body
|
||||
|
||||
| Field | Type | Description |
|
||||
| ---------- | -------- | ---------------------------------------------- |
|
||||
| id | int | the warning ID |
|
||||
| reason | string | the reason for the warning |
|
||||
| created_at | datetime | when the warning was created |
|
||||
| read | bool | whether the warning has been read/acknowledged |
|
|
@ -68,7 +68,7 @@ If authenticated and the authenticated user is the requested user, also returns
|
|||
#### `GET /users/@me`
|
||||
|
||||
**Requires authentication.** Gets the currently authenticated [user](./users#user-object),
|
||||
with all [additional user fields](./users/#additional-user-fields).
|
||||
with all [additional user fields](./users#additional-user-fields).
|
||||
|
||||
### Update current user
|
||||
|
||||
|
|
Loading…
Reference in a new issue