3 Authentication is required and the user must be an admin.
7 * `[:auth, :enforce_oauth_admin_scope_usage]` — OAuth admin scope requirement toggle.
8 If `true`, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token (client app must support admin scopes).
9 If `false` and token doesn't have admin scope(s), `is_admin` user flag grants access to admin-specific actions.
10 Note that client app needs to explicitly support admin scopes and request them when obtaining auth token.
12 ## `GET /api/pleroma/admin/users`
17 - *optional* `query`: **string** search term (e.g. nickname, domain, nickname@domain)
18 - *optional* `filters`: **string** comma-separated string of filters:
19 - `local`: only local users
20 - `external`: only external users
21 - `active`: only active users
22 - `deactivated`: only deactivated users
23 - `is_admin`: users with admin role
24 - `is_moderator`: users with moderator role
25 - *optional* `page`: **integer** page number
26 - *optional* `page_size`: **integer** number of users per page (default is `50`)
27 - *optional* `tags`: **[string]** tags list
28 - *optional* `name`: **string** user display name
29 - *optional* `email`: **string** user email
30 - Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10&tags[]=some_tag&tags[]=another_tag&name=display_name&email=email@example.com`
49 "display_name": string
56 ## DEPRECATED `DELETE /api/pleroma/admin/users`
62 - Response: User’s nickname
64 ## `DELETE /api/pleroma/admin/users`
70 - Response: Array of user nicknames
83 - Response: User’s nickname
85 ## `POST /api/pleroma/admin/users/follow`
87 ### Make a user follow another user
90 - `follower`: The nickname of the follower
91 - `followed`: The nickname of the followed
95 ## `POST /api/pleroma/admin/users/unfollow`
97 ### Make a user unfollow another user
100 - `follower`: The nickname of the follower
101 - `followed`: The nickname of the followed
105 ## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
107 ### Toggle user activation
111 - Response: User’s object
121 ## `PUT /api/pleroma/admin/users/tag`
123 ### Tag a list of users
126 - `nicknames` (array)
129 ## `DELETE /api/pleroma/admin/users/tag`
131 ### Untag a list of users
134 - `nicknames` (array)
137 ## `GET /api/pleroma/admin/users/:nickname/permission_group`
139 ### Get user user permission groups membership
146 "is_moderator": bool,
151 ## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
153 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
155 ### Get user user permission groups membership per permission group
162 "is_moderator": bool,
167 ## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
169 ### Add user to permission group
173 - On failure: `{"error": "…"}`
174 - On success: JSON of the user
176 ## `POST /api/pleroma/admin/users/permission_group/:permission_group`
178 ### Add users to permission group
181 - `nicknames`: nicknames array
183 - On failure: `{"error": "…"}`
184 - On success: JSON of the user
186 ## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
188 ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
190 ### Remove user from permission group
194 - On failure: `{"error": "…"}`
195 - On success: JSON of the user
196 - Note: An admin cannot revoke their own admin status.
198 ## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
200 ### Remove users from permission group
203 - `nicknames`: nicknames array
205 - On failure: `{"error": "…"}`
206 - On success: JSON of the user
207 - Note: An admin cannot revoke their own admin status.
209 ## `PATCH /api/pleroma/admin/users/activate`
214 - `nicknames`: nicknames array
227 ## `PATCH /api/pleroma/admin/users/deactivate`
232 - `nicknames`: nicknames array
245 ## `GET /api/pleroma/admin/users/:nickname_or_id`
247 ### Retrive the details of a user
252 - On failure: `Not found`
253 - On success: JSON of the user
255 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
257 ### Retrive user's latest statuses
261 - *optional* `page_size`: number of statuses to return (default is `20`)
262 - *optional* `godmode`: `true`/`false` – allows to see private statuses
264 - On failure: `Not found`
265 - On success: JSON array of user's latest statuses
267 ## `POST /api/pleroma/admin/relay`
274 - On success: URL of the followed relay
276 ## `DELETE /api/pleroma/admin/relay`
283 - On success: URL of the unfollowed relay
285 ## `GET /api/pleroma/admin/relay`
291 - On success: JSON array of relays
293 ## `POST /api/pleroma/admin/users/invite_token`
295 ### Create an account registration invite token
298 - *optional* `max_use` (integer)
299 - *optional* `expires_at` (date string e.g. "2019-04-07")
310 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
314 ## `GET /api/pleroma/admin/users/invites`
316 ### Get a list of generated invites
332 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
339 ## `POST /api/pleroma/admin/users/revoke_invite`
341 ### Revoke invite by token
355 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
360 ## `POST /api/pleroma/admin/users/email_invite`
362 ### Sends registration invite via email
368 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
370 ### Get a password reset token for a given nickname
377 "token": "base64 reset token",
378 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
382 ## `PATCH /api/pleroma/admin/users/force_password_reset`
384 ### Force passord reset for a user with a given nickname
388 - Response: none (code `204`)
390 ## `GET /api/pleroma/admin/reports`
392 ### Get a list of reports
395 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
396 - *optional* `limit`: **integer** the number of records to retrieve
397 - *optional* `page`: **integer** page number
398 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
400 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
401 - On success: JSON, returns a list of reports, where:
402 - `account`: the user who has been reported
403 - `actor`: the user who has sent the report
404 - `statuses`: list of statuses that have been included to the report
413 "avatar": "https://pleroma.example.org/images/avi.png",
414 "avatar_static": "https://pleroma.example.org/images/avi.png",
416 "created_at": "2019-04-23T17:32:04.000Z",
417 "display_name": "User",
420 "followers_count": 1,
421 "following_count": 1,
422 "header": "https://pleroma.example.org/images/banner.png",
423 "header_static": "https://pleroma.example.org/images/banner.png",
424 "id": "9i6dAJqSGSKMzLG2Lo",
428 "confirmation_pending": false,
429 "hide_favorites": true,
430 "hide_followers": false,
431 "hide_follows": false,
433 "is_moderator": false,
442 "tags": ["force_unlisted"],
444 "url": "https://pleroma.example.org/users/user",
449 "avatar": "https://pleroma.example.org/images/avi.png",
450 "avatar_static": "https://pleroma.example.org/images/avi.png",
452 "created_at": "2019-03-28T17:36:03.000Z",
453 "display_name": "Roger Braun",
456 "followers_count": 1,
457 "following_count": 1,
458 "header": "https://pleroma.example.org/images/banner.png",
459 "header_static": "https://pleroma.example.org/images/banner.png",
460 "id": "9hEkA5JsvAdlSrocam",
464 "confirmation_pending": false,
465 "hide_favorites": false,
466 "hide_followers": false,
467 "hide_follows": false,
469 "is_moderator": false,
478 "tags": ["force_unlisted"],
480 "url": "https://pleroma.example.org/users/lain",
483 "content": "Please delete it",
484 "created_at": "2019-04-29T19:48:15.000Z",
485 "id": "9iJGOv1j8hxuw19bcm",
496 "content": "<span class=\"h-card\"><a data-user=\"9hEkA5JsvAdlSrocam\" class=\"u-url mention\" href=\"https://pleroma.example.org/users/lain\">@<span>lain</span></a></span> click on my link <a href=\"https://www.google.com/\">https://www.google.com/</a>",
497 "created_at": "2019-04-23T19:15:47.000Z",
500 "favourites_count": 0,
501 "id": "9i6mQ9uVrrOmOime8m",
502 "in_reply_to_account_id": null,
503 "in_reply_to_id": null,
505 "media_attachments": [],
509 "id": "9hEkA5JsvAdlSrocam",
510 "url": "https://pleroma.example.org/users/lain",
515 "id": "9i6dAJqSGSKMzLG2Lo",
516 "url": "https://pleroma.example.org/users/user",
524 "text/plain": "@lain click on my link https://www.google.com/"
526 "conversation_id": 28,
527 "in_reply_to_account_acct": null,
540 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
541 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
542 "visibility": "direct"
550 ## `GET /api/pleroma/admin/grouped_reports`
552 ### Get a list of reports, grouped by status
555 - On success: JSON, returns a list of reports, where:
556 - `date`: date of the latest report
557 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
558 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
559 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
560 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
565 "date": "2019-10-07T12:31:39.615149Z",
568 "actors": [{ ... }, { ... }],
574 ## `GET /api/pleroma/admin/reports/:id`
576 ### Get an individual report
582 - 403 Forbidden `{"error": "error_msg"}`
583 - 404 Not Found `"Not found"`
584 - On success: JSON, Report object (see above)
586 ## `PATCH /api/pleroma/admin/reports`
588 ### Change the state of one or multiple reports
595 `id`, // required, report id
596 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
604 - 400 Bad Request, JSON:
610 `error` // error message
615 - On success: `204`, empty response
617 ## `POST /api/pleroma/admin/reports/:id/notes`
619 ### Create report note
622 - `id`: required, report id
623 - `content`: required, the message
626 - 400 Bad Request `"Invalid parameters"` when `status` is missing
627 - On success: `204`, empty response
629 ## `POST /api/pleroma/admin/reports/:report_id/notes/:id`
631 ### Delete report note
634 - `report_id`: required, report id
635 - `id`: required, note id
638 - 400 Bad Request `"Invalid parameters"` when `status` is missing
639 - On success: `204`, empty response
641 ## `PUT /api/pleroma/admin/statuses/:id`
643 ### Change the scope of an individual reported status
647 - `sensitive`: optional, valid values are `true` or `false`
648 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
651 - 400 Bad Request `"Unsupported visibility"`
652 - 403 Forbidden `{"error": "error_msg"}`
653 - 404 Not Found `"Not found"`
654 - On success: JSON, Mastodon Status entity
656 ## `DELETE /api/pleroma/admin/statuses/:id`
658 ### Delete an individual reported status
664 - 403 Forbidden `{"error": "error_msg"}`
665 - 404 Not Found `"Not found"`
666 - On success: 200 OK `{}`
668 ## `GET /api/pleroma/admin/config/migrate_to_db`
670 ### Run mix task pleroma.config migrate_to_db
672 Copy settings on key `:pleroma` to DB.
681 ## `GET /api/pleroma/admin/config/migrate_from_db`
683 ### Run mix task pleroma.config migrate_from_db
685 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
694 ## `GET /api/pleroma/admin/config`
696 ### List config settings
698 List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
708 "key": string or string with leading `:` for atoms,
709 "value": string or {} or [] or {"tuple": []}
715 ## `POST /api/pleroma/admin/config`
717 ### Update config settings
719 Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
720 Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
721 Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
722 Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
723 `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
724 Keywords can be passed as lists with 2 child tuples, e.g.
725 `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
727 If value contains list of settings `[subkey: val1, subkey2: val2, subkey3: val3]`, it's possible to remove only subkeys instead of all settings passing `subkeys` parameter. E.g.:
728 {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
730 Compile time settings (need instance reboot):
731 - all settings by this keys:
734 - `Pleroma.Web.Endpoint`
737 - `Pleroma.Captcha` -> `:seconds_valid`
738 - `Pleroma.Upload` -> `:proxy_remote`
739 - `:instance` -> `:upload_limit`
744 - `key` (string or string with leading `:` for atoms)
745 - `value` (string, [], {} or {"tuple": []})
746 - `delete` = true (optional, if parameter must be deleted)
747 - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
757 "key": "Pleroma.Upload",
759 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
760 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
761 {"tuple": [":link_name", true]},
762 {"tuple": [":proxy_remote", false]},
763 {"tuple": [":proxy_opts", [
764 {"tuple": [":redirect_on_failure", false]},
765 {"tuple": [":max_body_length", 1048576]},
766 {"tuple": [":http": [
767 {"tuple": [":follow_redirect", true]},
768 {"tuple": [":pool", ":upload"]},
772 {"tuple": [":dispatch", {
773 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
788 "key": string or string with leading `:` for atoms,
789 "value": string or {} or [] or {"tuple": []}
795 ## `GET /api/pleroma/admin/moderation_log`
797 ### Get moderation log
800 - *optional* `page`: **integer** page number
801 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
802 - *optional* `start_date`: **datetime (ISO 8601)** filter logs by creation date, start from `start_date`. Accepts datetime in ISO 8601 format (YYYY-MM-DDThh:mm:ss), e.g. `2005-08-09T18:31:42`
803 - *optional* `end_date`: **datetime (ISO 8601)** filter logs by creation date, end by from `end_date`. Accepts datetime in ISO 8601 format (YYYY-MM-DDThh:mm:ss), e.g. 2005-08-09T18:31:42
804 - *optional* `user_id`: **integer** filter logs by actor's id
805 - *optional* `search`: **string** search logs by the log message
816 "action": "relay_follow"
818 "time": 1502812026, // timestamp
819 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
824 ## `POST /api/pleroma/admin/reload_emoji`
826 ### Reload the instance's custom emoji
828 - Authentication: required
830 - Response: JSON, "ok" and 200 status
832 ## `PATCH /api/pleroma/admin/users/confirm_email`
834 ### Confirm users' emails
838 - Response: Array of user nicknames
840 ## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
842 ### Resend confirmation email
846 - Response: Array of user nicknames