From 175829882ddfa41c0bd2854f7f0c3fb083e701bc Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 24 Apr 2024 15:43:49 +0200 Subject: [PATCH] Add documentation for `GET /api/v1/accounts` See https://github.com/mastodon/mastodon/pull/27871 --- content/en/methods/accounts.md | 82 ++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/content/en/methods/accounts.md b/content/en/methods/accounts.md index 3092b3ee..3bae7136 100644 --- a/content/en/methods/accounts.md +++ b/content/en/methods/accounts.md @@ -722,6 +722,88 @@ Account is suspended (since 2.4.0 and until 3.3.0) --- +## Get multiple accounts {#index} + +```http +GET /api/v1/accounts HTTP/1.1 +``` + +View information about multiple profiles. + +**Returns:** Array of [Account]({{< relref "entities/Account">}})\ +**OAuth:** Public\ +**Version history:**\ +4.3.0 - added + +#### Request +##### Headers + +##### Query parameters + +id[] +: Array of String. The IDs of the Accounts in the database. + +##### Headers + +Authorization +: Provide this header with `Bearer ` to gain authorized access to this API method. + +#### Response +##### 200: OK + +[Account]({{< relref "entities/Account">}}) records for the requested confirmed and approved accounts will be returned. There can be fewer records than requested if the accounts do not exist or are not confirmed. + +Sample call with `id[]=1&id[]=2` when no account with `id=2` exists: + +```json +[ + { + "id": "1", + "username": "Gargron", + "acct": "Gargron", + "display_name": "Eugen", + "locked": false, + "bot": false, + "created_at": "2016-03-16T14:34:26.392Z", + "note": "

Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.

", + "url": "https://mastodon.social/@Gargron", + "avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", + "followers_count": 318699, + "following_count": 453, + "statuses_count": 61013, + "last_status_at": "2019-11-30T20:02:08.277Z", + "emojis": [], + "fields": [ + { + "name": "Patreon", + "value": "https://www.patreon.com/mastodon", + "verified_at": null + }, + { + "name": "Homepage", + "value": "https://zeonfederated.com", + "verified_at": "2019-07-15T18:29:57.191+00:00" + } + ] + } +] +``` + +##### 401: Unauthorized + +If the instance is in whitelist mode and the Authorization header is missing or invalid + +```json +{ + "error": "This API requires an authenticated user" +} +``` + +--- + ## Get account's statuses {#statuses} ```http