Endpoints
The API exposes the following endpoints:
Endpoint | Summary |
---|---|
/api/pronouns | Get or update the pronouns. |
/api/gender | Get or update the gender. |
/api/summary | Get a summary of the current state. |
/api/kill | Trigger lockdown mode. |
Previous version of this API made no guarantees about the formatting of the response bodies. This version makes the the following guarantees:
- String values are always stripped of leading and trailing whitespace.
- String values are always fully lowercase, unless the value is a name.
# /api/pronouns
Returns/updates the set of pronouns currently in use.
Method | Auth | Summary |
---|---|---|
POST | Basic | Update current pronouns. |
GET | None | Return current pronouns. |
All payloads will be lowercased and stripped of both trailing and leading whitespace. This endpoint is guaranteed to return all values lowercased and without any leading or trailing whitespace.
# /api/gender
Returns/updates the current gender.
Method | Auth | Summary |
---|---|---|
POST | Basic | Update current gender. |
GET | None | Return current gender. |
For some POST bodies, the gender will be matched to a set of pronouns that I commonly use when I am of that gender. These special cases are boy
, girl
and enby
.
All payloads will be lowercased and stripped of both trailing and leading whitespace. This endpoint is guaranteed to return all values lowercased and without any leading or trailing whitespace.
# /api/summary
Combines the values produced by /api/pronouns
and /api/gender
into a single response, in JSON format.
Method | Auth | Summary |
---|---|---|
GET | None | Return both the gender and the pronouns as a JSON object. |
Response
The response is in JSON-format. The endpoint returns an object with the following structure:
{"gender":"enby","pronouns":"they/them"}
The values for "gender" and "pronouns" are guaranteed to be lowercased strings. Both leading and trailing whitespace are stripped from those values.
Adding new keys to this response is considered backwards compatible. Treating the current set of keys as exhaustive is discouraged.
# /api/kill
Activate the kill switch built into the website. After this, a manual reset has to be done in order to restore the full site. This kill switch restricts access to a number of pages when triggered. The API will not be affected by this action.
Method | Auth | Summary |
---|---|---|
POST | Basic | Activate the website's kill switch. |