From 5249c44d2050384efe12336bc98864cec0b0f82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Thu, 12 Mar 2020 14:02:53 +0100 Subject: [PATCH] Add routes to (un)block a user --- _routes/users.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/_routes/users.md b/_routes/users.md index 74c2157..699138a 100644 --- a/_routes/users.md +++ b/_routes/users.md @@ -293,3 +293,49 @@ GET /api/v1/users/:person_guid/photos | Status code | Error reason | | ----------- | ------------------------------------------ | | 404 | User with provided guid could not be found | + +## Block a user + +Required API scope: `contacts:modify`. + +### Request + +~~~ +POST /api/v1/users/:person_guid/block +~~~ + +### Response + +~~~ +Status: 201 Created +~~~ + +### Errors + +| Status code | Error reason | +| ----------- | ------------------------------------------ | +| 404 | User with provided guid could not be found | +| 409 | Block already exists | + +## Unblock a user + +Required API scope: `contacts:modify`. + +### Request + +~~~ +DELETE /api/v1/users/:person_guid/block +~~~ + +### Response + +~~~ +Status: 204 No Content +~~~ + +### Errors + +| Status code | Error reason | +| ----------- | ------------------------------------------ | +| 404 | User with provided guid could not be found | +| 410 | Block doesn't exist |