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
263 - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
265 - On failure: `Not found`
266 - On success: JSON array of user's latest statuses
268 ## `GET /api/pleroma/admin/instances/:instance/statuses`
270 ### Retrive instance's latest statuses
273 - `instance`: instance name
274 - *optional* `page_size`: number of statuses to return (default is `20`)
275 - *optional* `godmode`: `true`/`false` – allows to see private statuses
276 - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
278 - On failure: `Not found`
279 - On success: JSON array of instance's latest statuses
281 ## `GET /api/pleroma/admin/statuses`
283 ### Retrives all latest statuses
286 - *optional* `page_size`: number of statuses to return (default is `20`)
287 - *optional* `local_only`: excludes remote statuses
288 - *optional* `godmode`: `true`/`false` – allows to see private statuses
289 - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
291 - On failure: `Not found`
292 - On success: JSON array of user's latest statuses
294 ## `POST /api/pleroma/admin/relay`
301 - On success: URL of the followed relay
303 ## `DELETE /api/pleroma/admin/relay`
310 - On success: URL of the unfollowed relay
312 ## `GET /api/pleroma/admin/relay`
318 - On success: JSON array of relays
320 ## `POST /api/pleroma/admin/users/invite_token`
322 ### Create an account registration invite token
325 - *optional* `max_use` (integer)
326 - *optional* `expires_at` (date string e.g. "2019-04-07")
337 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
341 ## `GET /api/pleroma/admin/users/invites`
343 ### Get a list of generated invites
359 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
366 ## `POST /api/pleroma/admin/users/revoke_invite`
368 ### Revoke invite by token
382 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
387 ## `POST /api/pleroma/admin/users/email_invite`
389 ### Sends registration invite via email
396 - On success: `204`, empty response
398 - 400 Bad Request, JSON:
403 "error": "Appropriate error message here"
408 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
410 ### Get a password reset token for a given nickname
417 "token": "base64 reset token",
418 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
422 ## `PATCH /api/pleroma/admin/users/force_password_reset`
424 ### Force passord reset for a user with a given nickname
428 - Response: none (code `204`)
430 ## `GET /api/pleroma/admin/users/:nickname/credentials`
432 ### Get the user's email, password, display and settings-related fields
441 "actor_type": "Person",
442 "allow_following_move": true,
443 "avatar": "https://pleroma.social/media/7e8e7508fd545ef580549b6881d80ec0ff2c81ed9ad37b9bdbbdf0e0d030159d.jpg",
444 "background": "https://pleroma.social/media/4de34c0bd10970d02cbdef8972bef0ebbf55f43cadc449554d4396156162fe9a.jpg",
445 "banner": "https://pleroma.social/media/8d92ba2bd244b613520abf557dd448adcd30f5587022813ee9dd068945986946.jpg",
447 "default_scope": "public",
448 "discoverable": false,
449 "email": "user@example.com",
453 "value": "<a href=\"https://example.com\" rel=\"ugc\">https://example.com</a>"
456 "hide_favorites": false,
457 "hide_followers": false,
458 "hide_followers_count": false,
459 "hide_follows": false,
460 "hide_follows_count": false,
461 "id": "9oouHaEEUR54hls968",
464 "no_rich_text": true,
465 "pleroma_settings_store": {},
470 "value": "https://example.com"
474 "skip_thread_containment": false
478 ## `PATCH /api/pleroma/admin/users/:nickname/credentials`
480 ### Change the user's email, password, display and settings-related fields
494 - `hide_followers_count`
495 - `hide_follows_count`
497 - `allow_following_move`
500 - `skip_thread_containment`
505 - Response: none (code `200`)
507 ## `GET /api/pleroma/admin/reports`
509 ### Get a list of reports
512 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
513 - *optional* `limit`: **integer** the number of records to retrieve
514 - *optional* `page`: **integer** page number
515 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
517 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
518 - On success: JSON, returns a list of reports, where:
519 - `account`: the user who has been reported
520 - `actor`: the user who has sent the report
521 - `statuses`: list of statuses that have been included to the report
530 "avatar": "https://pleroma.example.org/images/avi.png",
531 "avatar_static": "https://pleroma.example.org/images/avi.png",
533 "created_at": "2019-04-23T17:32:04.000Z",
534 "display_name": "User",
537 "followers_count": 1,
538 "following_count": 1,
539 "header": "https://pleroma.example.org/images/banner.png",
540 "header_static": "https://pleroma.example.org/images/banner.png",
541 "id": "9i6dAJqSGSKMzLG2Lo",
545 "confirmation_pending": false,
546 "hide_favorites": true,
547 "hide_followers": false,
548 "hide_follows": false,
550 "is_moderator": false,
559 "tags": ["force_unlisted"],
561 "url": "https://pleroma.example.org/users/user",
566 "avatar": "https://pleroma.example.org/images/avi.png",
567 "avatar_static": "https://pleroma.example.org/images/avi.png",
569 "created_at": "2019-03-28T17:36:03.000Z",
570 "display_name": "Roger Braun",
573 "followers_count": 1,
574 "following_count": 1,
575 "header": "https://pleroma.example.org/images/banner.png",
576 "header_static": "https://pleroma.example.org/images/banner.png",
577 "id": "9hEkA5JsvAdlSrocam",
581 "confirmation_pending": false,
582 "hide_favorites": false,
583 "hide_followers": false,
584 "hide_follows": false,
586 "is_moderator": false,
595 "tags": ["force_unlisted"],
597 "url": "https://pleroma.example.org/users/lain",
600 "content": "Please delete it",
601 "created_at": "2019-04-29T19:48:15.000Z",
602 "id": "9iJGOv1j8hxuw19bcm",
613 "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>",
614 "created_at": "2019-04-23T19:15:47.000Z",
617 "favourites_count": 0,
618 "id": "9i6mQ9uVrrOmOime8m",
619 "in_reply_to_account_id": null,
620 "in_reply_to_id": null,
622 "media_attachments": [],
626 "id": "9hEkA5JsvAdlSrocam",
627 "url": "https://pleroma.example.org/users/lain",
632 "id": "9i6dAJqSGSKMzLG2Lo",
633 "url": "https://pleroma.example.org/users/user",
641 "text/plain": "@lain click on my link https://www.google.com/"
643 "conversation_id": 28,
644 "in_reply_to_account_acct": null,
657 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
658 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
659 "visibility": "direct"
667 ## `GET /api/pleroma/admin/grouped_reports`
669 ### Get a list of reports, grouped by status
672 - On success: JSON, returns a list of reports, where:
673 - `date`: date of the latest report
674 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
675 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
676 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
677 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
682 "date": "2019-10-07T12:31:39.615149Z",
685 "actors": [{ ... }, { ... }],
691 ## `GET /api/pleroma/admin/reports/:id`
693 ### Get an individual report
699 - 403 Forbidden `{"error": "error_msg"}`
700 - 404 Not Found `"Not found"`
701 - On success: JSON, Report object (see above)
703 ## `PATCH /api/pleroma/admin/reports`
705 ### Change the state of one or multiple reports
712 `id`, // required, report id
713 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
721 - 400 Bad Request, JSON:
727 `error` // error message
732 - On success: `204`, empty response
734 ## `POST /api/pleroma/admin/reports/:id/notes`
736 ### Create report note
739 - `id`: required, report id
740 - `content`: required, the message
743 - 400 Bad Request `"Invalid parameters"` when `status` is missing
744 - On success: `204`, empty response
746 ## `POST /api/pleroma/admin/reports/:report_id/notes/:id`
748 ### Delete report note
751 - `report_id`: required, report id
752 - `id`: required, note id
755 - 400 Bad Request `"Invalid parameters"` when `status` is missing
756 - On success: `204`, empty response
758 ## `GET /api/pleroma/admin/statuses/:id`
760 ### Show status by id
763 - `id`: required, status id
766 - 404 Not Found `"Not Found"`
767 - On success: JSON, Mastodon Status entity
769 ## `PUT /api/pleroma/admin/statuses/:id`
771 ### Change the scope of an individual reported status
775 - `sensitive`: optional, valid values are `true` or `false`
776 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
779 - 400 Bad Request `"Unsupported visibility"`
780 - 403 Forbidden `{"error": "error_msg"}`
781 - 404 Not Found `"Not found"`
782 - On success: JSON, Mastodon Status entity
784 ## `DELETE /api/pleroma/admin/statuses/:id`
786 ### Delete an individual reported status
792 - 403 Forbidden `{"error": "error_msg"}`
793 - 404 Not Found `"Not found"`
794 - On success: 200 OK `{}`
796 ## `GET /api/pleroma/admin/restart`
798 ### Restarts pleroma application
800 **Only works when configuration from database is enabled.**
805 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
811 ## `GET /api/pleroma/admin/need_reboot`
813 ### Returns the flag whether the pleroma should be restarted
817 - `need_reboot` - boolean
824 ## `GET /api/pleroma/admin/config`
826 ### Get list of merged default settings with saved in database.
828 *If `need_reboot` is `true`, instance must be restarted, so reboot time settings can take effect.*
830 **Only works when configuration from database is enabled.**
833 - `only_db`: true (*optional*, get only saved in database settings)
836 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
843 "key": "Pleroma.Upload",
851 ## `POST /api/pleroma/admin/config`
853 ### Update config settings
855 *If `need_reboot` is `true`, instance must be restarted, so reboot time settings can take effect.*
857 **Only works when configuration from database is enabled.**
859 Some modifications are necessary to save the config settings correctly:
861 - strings which start with `Pleroma.`, `Phoenix.`, `Tesla.` or strings like `Oban`, `Ueberauth` will be converted to modules;
863 "Pleroma.Upload" -> Pleroma.Upload
866 - strings starting with `:` will be converted to atoms;
868 ":pleroma" -> :pleroma
870 - objects with `tuple` key and array value will be converted to tuples;
872 {"tuple": ["string", "Pleroma.Upload", []]} -> {"string", Pleroma.Upload, []}
874 - arrays with *tuple objects* will be converted to keywords;
876 [{"tuple": [":key1", "value"]}, {"tuple": [":key2", "value"]}] -> [key1: "value", key2: "value"]
879 Most of the settings will be applied in `runtime`, this means that you don't need to restart the instance. But some settings are applied in `compile time` and require a reboot of the instance, such as:
880 - all settings inside these keys:
882 - `:connections_pool`
885 - partially settings inside these keys:
886 - `:seconds_valid` in `Pleroma.Captcha`
887 - `:proxy_remote` in `Pleroma.Upload`
888 - `:upload_limit` in `:instance`
891 - `configs` - array of config objects
892 - config object params:
893 - `group` - string (**required**)
894 - `key` - string (**required**)
895 - `value` - string, [], {} or {"tuple": []} (**required**)
896 - `delete` - true (*optional*, if setting must be deleted)
897 - `subkeys` - array of strings (*optional*, only works when `delete=true` parameter is passed, otherwise will be ignored)
899 *When a value have several nested settings, you can delete only some nested settings by passing a parameter `subkeys`, without deleting all settings by key.*
901 [subkey: val1, subkey2: val2, subkey3: val3] \\ initial value
902 {"group": ":pleroma", "key": "some_key", "delete": true, "subkeys": [":subkey", ":subkey3"]} \\ passing json for deletion
903 [subkey2: val2] \\ value after deletion
906 *Most of the settings can be partially updated through merge old values with new values, except settings value of which is list or is not keyword.*
908 Example of setting without keyword in value:
910 config :tesla, :adapter, Tesla.Adapter.Hackney
913 List of settings which support only full update by key:
916 {:pleroma, :ecto_repos},
919 {:cors_plug, [:max_age, :methods, :expose, :headers]},
920 {:auto_linker, :opts},
921 {:swarm, :node_blacklist},
926 List of settings which support only full update by subkey:
928 @full_subkey_update [
929 {:pleroma, :assets, :mascots},
930 {:pleroma, :emoji, :groups},
931 {:pleroma, :workers, :retries},
932 {:pleroma, :mrf_subchain, :match_actor},
933 {:pleroma, :mrf_keyword, :replace}
937 *Settings without explicit key must be sended in separate config object params.*
947 {"group": ":quack", "key": ":level", "value": ":debug"},
948 {"group": ":quack", "key": ":meta", "value": [":all"]},
960 "key": "Pleroma.Upload",
962 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
963 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
964 {"tuple": [":link_name", true]},
965 {"tuple": [":proxy_remote", false]},
966 {"tuple": [":proxy_opts", [
967 {"tuple": [":redirect_on_failure", false]},
968 {"tuple": [":max_body_length", 1048576]},
969 {"tuple": [":http", [
970 {"tuple": [":follow_redirect", true]},
971 {"tuple": [":pool", ":upload"]},
975 {"tuple": [":dispatch", {
976 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
986 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
992 "key": "Pleroma.Upload",
1000 ## ` GET /api/pleroma/admin/config/descriptions`
1002 ### Get JSON with config descriptions.
1003 Loads json generated from `config/descriptions.exs`.
1010 "group": ":pleroma", // string
1011 "key": "ModuleName", // string
1012 "type": "group", // string or list with possible values,
1013 "description": "Upload general settings", // string
1016 "key": ":uploader", // string or module name `Pleroma.Upload`
1018 "description": "Module which will be used for uploads",
1019 "suggestions": ["module1", "module2"]
1023 "type": ["list", "module"],
1024 "description": "List of filter modules for uploads",
1026 "module1", "module2", "module3"
1033 ## `GET /api/pleroma/admin/moderation_log`
1035 ### Get moderation log
1038 - *optional* `page`: **integer** page number
1039 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
1040 - *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`
1041 - *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
1042 - *optional* `user_id`: **integer** filter logs by actor's id
1043 - *optional* `search`: **string** search logs by the log message
1054 "action": "relay_follow"
1056 "time": 1502812026, // timestamp
1057 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
1062 ## `POST /api/pleroma/admin/reload_emoji`
1064 ### Reload the instance's custom emoji
1066 - Authentication: required
1068 - Response: JSON, "ok" and 200 status
1070 ## `PATCH /api/pleroma/admin/users/confirm_email`
1072 ### Confirm users' emails
1076 - Response: Array of user nicknames
1078 ## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
1080 ### Resend confirmation email
1084 - Response: Array of user nicknames
1086 ## `GET /api/pleroma/admin/stats`
1094 "status_visibility": {
1103 ## `GET /api/pleroma/admin/oauth_app`
1109 - *optional* `client_id`
1111 - *optional* `page_size`
1112 - *optional* `trusted`
1122 "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
1123 "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
1124 "redirect_uri": "https://example.com/oauth-callback",
1125 "website": "https://example.com",
1135 ## `POST /api/pleroma/admin/oauth_app`
1137 ### Create OAuth App
1143 - *optional* `website`
1144 - *optional* `trusted`
1152 "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
1153 "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
1154 "redirect_uri": "https://example.com/oauth-callback",
1155 "website": "https://example.com",
1163 "redirect_uris": "can't be blank",
1164 "name": "can't be blank"
1168 ## `PATCH /api/pleroma/admin/oauth_app/:id`
1170 ### Update OAuth App
1174 - *optional* `redirect_uris`
1175 - *optional* `scopes`
1176 - *optional* `website`
1177 - *optional* `trusted`
1185 "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
1186 "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
1187 "redirect_uri": "https://example.com/oauth-callback",
1188 "website": "https://example.com",
1193 ## `DELETE /api/pleroma/admin/oauth_app/:id`
1195 ### Delete OAuth App
1200 - On success: `204`, empty response
1202 - 400 Bad Request `"Invalid parameters"` when `status` is missing