From 1036355b76e57db7a7f8907d449e36cb83ecb298 Mon Sep 17 00:00:00 2001 From: Daniel M Brasil Date: Fri, 30 Jun 2023 15:10:21 -0300 Subject: [PATCH] document DELETE /api/v1/accounts/picture/:picture --- content/en/methods/accounts.md | 94 ++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/content/en/methods/accounts.md b/content/en/methods/accounts.md index 5e00972f..b14dc336 100644 --- a/content/en/methods/accounts.md +++ b/content/en/methods/accounts.md @@ -2290,6 +2290,100 @@ Token does not have an authorized user } ``` +## Delete profile pictures + +```http +DELETE /api/v1/accounts/pictures/:picture HTTP/1.1 +``` + +**Returns:** [CredentialAccount]({{< relref "entities/Account#CredentialAccount">}})\ +**OAuth**: User token + `write:accounts`\ +**Version history:**\ +x.y.z - added + +Deletes the avatar or header picture associated with the user's profile. + +#### Request + +##### Headers + +Authorization +: {{}} Provide this header with `Bearer ` to gain authorized access to this API method. + +##### Path parameters + +:picture +: {{}} String. The type of picture to be deleted. Valid options are `avatar` and `header`. + +#### Response + +##### 200: OK + +The picture was successfully deleted from the user's profile. If there were no picture associated with the profile, the response will still indicate a successful deletion. + +```json +{ + "id": "110357222516183152", + "username": "rob", + "acct": "rob", + "display_name": "", + "locked": false, + "bot": false, + "discoverable": false, + "group": false, + "created_at": "2023-05-12T00:00:00.000Z", + "note": "", + "url": "http://localhost:3000/@rob", + "avatar": "http://localhost:3000/avatars/original/missing.png", + "avatar_static": "http://localhost:3000/avatars/original/missing.png", + "header": "http://localhost:3000/headers/original/missing.png", + "header_static": "http://localhost:3000/headers/original/missing.png", + "followers_count": 15, + "following_count": 2, + "statuses_count": 10, + "last_status_at": "2023-06-26", + "noindex": false, + "source": { + "privacy": "public", + "sensitive": false, + "language": null, + "note": "", + "fields": [], + "follow_requests_count": 0 + }, + "emojis": [], + "roles": [], + "fields": [], + "role": { + "id": "-99", + "name": "", + "permissions": "65536", + "color": "", + "highlighted": false + } +} +``` + +### 400: Bad request + +The provided `:picture` parameter's value is invalid. + +```json +{ + "error": "Picture must be either \"avatar\" or \"header\"" +} +``` + +### 401: Unauthorized + +Invalid or missing Authorization header. + +```json +{ + "error": "The access token is invalid" +} +``` + --- ## See also