diff --git a/PluralKit.API/Controllers/SystemController.cs b/PluralKit.API/Controllers/SystemController.cs index f5fadfff..faecd8e9 100644 --- a/PluralKit.API/Controllers/SystemController.cs +++ b/PluralKit.API/Controllers/SystemController.cs @@ -48,6 +48,13 @@ namespace PluralKit.API.Controllers _auth = auth; } + [HttpGet] + [RequiresSystem] + public async Task> GetOwnSystem() + { + return Ok(_auth.CurrentSystem); + } + [HttpGet("{hid}")] public async Task> GetSystem(string hid) { diff --git a/docs/3-api-documentation.md b/docs/3-api-documentation.md index 350ee408..fb48fe06 100644 --- a/docs/3-api-documentation.md +++ b/docs/3-api-documentation.md @@ -50,6 +50,27 @@ The following three models (usually represented in JSON format) represent the va ## Endpoints +### `GET /s` +**Requires authentication.** + +Returns information about your own system. + +#### Example request + GET https://api.pluralkit.me/v1/s + +#### Example response +```json +{ + "id": "abcde", + "name": "My System", + "description": "This is my system description. Yay.", + "tag": "[MySys]", + "avatar_url": "https://path/to/avatar/image.png", + "tz": "Europe/Copenhagen", + "created": "2019-01-01T14:30:00.987654Z" +} +``` + ### `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`.