docs: add other endpoints

This commit is contained in:
sam 2023-09-02 03:52:38 +02:00
parent bc1948316c
commit c6195218c5
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
3 changed files with 48 additions and 1 deletions

View File

@ -33,6 +33,7 @@ export default defineConfig({
{ text: "Object reference", link: "/api/endpoints/" }, { text: "Object reference", link: "/api/endpoints/" },
{ text: "Users", link: "/api/endpoints/users" }, { text: "Users", link: "/api/endpoints/users" },
{ text: "Members", link: "/api/endpoints/members" }, { text: "Members", link: "/api/endpoints/members" },
{ text: "Other", link: "/api/endpoints/other" },
], ],
}, },
], ],

View 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 |

View File

@ -68,7 +68,7 @@ If authenticated and the authenticated user is the requested user, also returns
#### `GET /users/@me` #### `GET /users/@me`
**Requires authentication.** Gets the currently authenticated [user](./users#user-object), **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 ### Update current user