diff --git a/docs/3-api-documentation.md b/docs/3-api-documentation.md index aef985fb..a2700f3a 100644 --- a/docs/3-api-documentation.md +++ b/docs/3-api-documentation.md @@ -19,7 +19,9 @@ on requests that require it. Failure to do so on endpoints that require authenti ## Models The following three models (usually represented in JSON format) represent the various objects in PluralKit's API. A `?` after the column type indicates an optional (nullable) parameter. + ### System model + |Key|Type|Patchable?|Notes| |---|---|---|---| |id|string|No|| @@ -31,6 +33,7 @@ The following three models (usually represented in JSON format) represent the va |created|datetime|No|| ### Member model + |Key|Type|Patchable?|Notes| |---|---|---|---| |id|string|No|| @@ -42,7 +45,9 @@ The following three models (usually represented in JSON format) represent the va |prefix|string?|Yes|| |suffix|string?|Yes|| |created|datetime|No|| + ### Switch model + |Key|Type|Notes| |---|---|---| |timestamp|datetime|| @@ -71,7 +76,7 @@ Returns information about your own system. } ``` -### GET /s/ +### GET /s/\ Queries a system by its 5-character ID, and returns information about it. If the system doesn't exist, returns `404 Not Found`. #### Example request @@ -90,7 +95,7 @@ Queries a system by its 5-character ID, and returns information about it. If the } ``` -### GET /s//members +### GET /s/\/members Queries a system's member list by its 5-character ID. If the system doesn't exist, returns `404 Not Found`. #### Example request @@ -114,7 +119,7 @@ Queries a system's member list by its 5-character ID. If the system doesn't exis ] ``` -### GET /s//switches[?before=] +### GET /s/\/switches[?before=] Returns a system's switch history in newest-first chronological order, with a maximum of 100 switches. If the system doesn't exist, returns `404 Not Found`. Optionally takes a `?before=` query parameter with an ISO-8601-formatted timestamp, and will only return switches that happen before that timestamp. @@ -140,7 +145,7 @@ that happen before that timestamp. ] ``` -### GET /s//fronters +### GET /s/\/fronters Returns a system's current fronter(s), with fully hydrated member objects. If the system doesn't exist, *or* the system has no registered switches, returns `404 Not Found`. #### Example request @@ -215,7 +220,7 @@ Registers a new switch to your own system given a list of member IDs. #### Example response (`204 No Content`) -### GET /m/ +### GET /m/\ Queries a member's information by its 5-character member ID. If the member does not exist, will return `404 Not Found`. #### Example request @@ -237,7 +242,7 @@ Queries a member's information by its 5-character member ID. If the member does } ``` -### PATCH /m/ +### PATCH /m/\ **Requires authentication.** Edits a member's information. Missing fields will be set to `null`. Will return the new member object. Member must (obviously) belong to your own system.