3 Authentication is required and the user must be an admin.
5 ## `GET /api/pleroma/admin/users`
10 - *optional* `query`: **string** search term (e.g. nickname, domain, nickname@domain)
11 - *optional* `filters`: **string** comma-separated string of filters:
12 - `local`: only local users
13 - `external`: only external users
14 - `active`: only active users
15 - `deactivated`: only deactivated users
16 - `is_admin`: users with admin role
17 - `is_moderator`: users with moderator role
18 - *optional* `page`: **integer** page number
19 - *optional* `page_size`: **integer** number of users per page (default is `50`)
20 - *optional* `tags`: **[string]** tags list
21 - *optional* `name`: **string** user display name
22 - *optional* `email`: **string** user email
23 - 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`
42 "display_name": string
49 ## DEPRECATED `DELETE /api/pleroma/admin/users`
55 - Response: User’s nickname
57 ## `DELETE /api/pleroma/admin/users`
64 - Response: Array of user nicknames
77 - Response: User’s nickname
79 ## `POST /api/pleroma/admin/users/follow`
81 ### Make a user follow another user
84 - `follower`: The nickname of the follower
85 - `followed`: The nickname of the followed
89 ## `POST /api/pleroma/admin/users/unfollow`
91 ### Make a user unfollow another user
94 - `follower`: The nickname of the follower
95 - `followed`: The nickname of the followed
99 ## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
101 ### Toggle user activation
105 - Response: User’s object
115 ## `PUT /api/pleroma/admin/users/tag`
117 ### Tag a list of users
120 - `nicknames` (array)
123 ## `DELETE /api/pleroma/admin/users/tag`
125 ### Untag a list of users
128 - `nicknames` (array)
131 ## `GET /api/pleroma/admin/users/:nickname/permission_group`
133 ### Get user user permission groups membership
140 "is_moderator": bool,
145 ## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
147 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
149 ### Get user user permission groups membership per permission group
156 "is_moderator": bool,
161 ## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
163 ### Add user to permission group
167 - On failure: `{"error": "…"}`
168 - On success: JSON of the user
170 ## `POST /api/pleroma/admin/users/permission_group/:permission_group`
172 ### Add users to permission group
175 - `nicknames`: nicknames array
177 - On failure: `{"error": "…"}`
178 - On success: JSON of the user
180 ## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
182 ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
184 ### Remove user from permission group
188 - On failure: `{"error": "…"}`
189 - On success: JSON of the user
190 - Note: An admin cannot revoke their own admin status.
192 ## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
194 ### Remove users from permission group
197 - `nicknames`: nicknames array
199 - On failure: `{"error": "…"}`
200 - On success: JSON of the user
201 - Note: An admin cannot revoke their own admin status.
203 ## `PATCH /api/pleroma/admin/users/activate`
208 - `nicknames`: nicknames array
221 ## `PATCH /api/pleroma/admin/users/deactivate`
226 - `nicknames`: nicknames array
239 ## DEPRECATED `PATCH /api/pleroma/admin/users/:nickname/activation_status`
241 ### Active or deactivate a user
245 - `status` BOOLEAN field, false value means deactivation.
247 ## `GET /api/pleroma/admin/users/:nickname_or_id`
249 ### Retrive the details of a user
254 - On failure: `Not found`
255 - On success: JSON of the user
257 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
259 ### Retrive user's latest statuses
263 - *optional* `page_size`: number of statuses to return (default is `20`)
264 - *optional* `godmode`: `true`/`false` – allows to see private statuses
266 - On failure: `Not found`
267 - On success: JSON array of user's latest statuses
269 ## `POST /api/pleroma/admin/relay`
276 - On success: URL of the followed relay
278 ## `DELETE /api/pleroma/admin/relay`
285 - On success: URL of the unfollowed relay
287 ## `GET /api/pleroma/admin/relay`
293 - On success: JSON array of relays
295 ## `POST /api/pleroma/admin/users/invite_token`
297 ### Create an account registration invite token
300 - *optional* `max_use` (integer)
301 - *optional* `expires_at` (date string e.g. "2019-04-07")
312 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
316 ## `GET /api/pleroma/admin/users/invites`
318 ### Get a list of generated invites
334 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
341 ## `POST /api/pleroma/admin/users/revoke_invite`
343 ### Revoke invite by token
357 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
362 ## `POST /api/pleroma/admin/users/email_invite`
364 ### Sends registration invite via email
370 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
372 ### Get a password reset token for a given nickname
379 "token": "base64 reset token",
380 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
384 ## `PATCH /api/pleroma/admin/users/force_password_reset`
386 ### Force passord reset for a user with a given nickname
390 - Response: none (code `204`)
392 ## `GET /api/pleroma/admin/reports`
394 ### Get a list of reports
397 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
398 - *optional* `limit`: **integer** the number of records to retrieve
399 - *optional* `page`: **integer** page number
400 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
402 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
403 - On success: JSON, returns a list of reports, where:
404 - `account`: the user who has been reported
405 - `actor`: the user who has sent the report
406 - `statuses`: list of statuses that have been included to the report
415 "avatar": "https://pleroma.example.org/images/avi.png",
416 "avatar_static": "https://pleroma.example.org/images/avi.png",
418 "created_at": "2019-04-23T17:32:04.000Z",
419 "display_name": "User",
422 "followers_count": 1,
423 "following_count": 1,
424 "header": "https://pleroma.example.org/images/banner.png",
425 "header_static": "https://pleroma.example.org/images/banner.png",
426 "id": "9i6dAJqSGSKMzLG2Lo",
430 "confirmation_pending": false,
431 "hide_favorites": true,
432 "hide_followers": false,
433 "hide_follows": false,
435 "is_moderator": false,
444 "tags": ["force_unlisted"],
446 "url": "https://pleroma.example.org/users/user",
451 "avatar": "https://pleroma.example.org/images/avi.png",
452 "avatar_static": "https://pleroma.example.org/images/avi.png",
454 "created_at": "2019-03-28T17:36:03.000Z",
455 "display_name": "Roger Braun",
458 "followers_count": 1,
459 "following_count": 1,
460 "header": "https://pleroma.example.org/images/banner.png",
461 "header_static": "https://pleroma.example.org/images/banner.png",
462 "id": "9hEkA5JsvAdlSrocam",
466 "confirmation_pending": false,
467 "hide_favorites": false,
468 "hide_followers": false,
469 "hide_follows": false,
471 "is_moderator": false,
480 "tags": ["force_unlisted"],
482 "url": "https://pleroma.example.org/users/lain",
485 "content": "Please delete it",
486 "created_at": "2019-04-29T19:48:15.000Z",
487 "id": "9iJGOv1j8hxuw19bcm",
498 "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>",
499 "created_at": "2019-04-23T19:15:47.000Z",
502 "favourites_count": 0,
503 "id": "9i6mQ9uVrrOmOime8m",
504 "in_reply_to_account_id": null,
505 "in_reply_to_id": null,
507 "media_attachments": [],
511 "id": "9hEkA5JsvAdlSrocam",
512 "url": "https://pleroma.example.org/users/lain",
517 "id": "9i6dAJqSGSKMzLG2Lo",
518 "url": "https://pleroma.example.org/users/user",
526 "text/plain": "@lain click on my link https://www.google.com/"
528 "conversation_id": 28,
529 "in_reply_to_account_acct": null,
542 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
543 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
544 "visibility": "direct"
552 ## `GET /api/pleroma/admin/grouped_reports`
554 ### Get a list of reports, grouped by status
557 - On success: JSON, returns a list of reports, where:
558 - `date`: date of the latest report
559 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
560 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
561 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
562 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
567 "date": "2019-10-07T12:31:39.615149Z",
570 "actors": [{ ... }, { ... }],
576 ## `GET /api/pleroma/admin/reports/:id`
578 ### Get an individual report
584 - 403 Forbidden `{"error": "error_msg"}`
585 - 404 Not Found `"Not found"`
586 - On success: JSON, Report object (see above)
588 ## `PATCH /api/pleroma/admin/reports`
590 ### Change the state of one or multiple reports
597 `id`, // required, report id
598 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
606 - 400 Bad Request, JSON:
612 `error` // error message
617 - On success: `204`, empty response
619 ## `POST /api/pleroma/admin/reports/:id/respond`
621 ### Respond to a report
625 - `status`: required, the message
628 - 400 Bad Request `"Invalid parameters"` when `status` is missing
629 - 403 Forbidden `{"error": "error_msg"}`
630 - 404 Not Found `"Not found"`
631 - On success: JSON, created Mastodon Status entity
642 "content": "Your claim is going to be closed",
643 "created_at": "2019-05-11T17:13:03.000Z",
646 "favourites_count": 0,
647 "id": "9ihuiSL1405I65TmEq",
648 "in_reply_to_account_id": null,
649 "in_reply_to_id": null,
651 "media_attachments": [],
655 "id": "9i6dAJqSGSKMzLG2Lo",
656 "url": "https://pleroma.example.org/users/user",
661 "id": "9hEkA5JsvAdlSrocam",
662 "url": "https://pleroma.example.org/users/admin",
670 "text/plain": "Your claim is going to be closed"
672 "conversation_id": 35,
673 "in_reply_to_account_acct": null,
686 "uri": "https://pleroma.example.org/objects/cab0836d-9814-46cd-a0ea-529da9db5fcb",
687 "url": "https://pleroma.example.org/notice/9ihuiSL1405I65TmEq",
688 "visibility": "direct"
692 ## `PUT /api/pleroma/admin/statuses/:id`
694 ### Change the scope of an individual reported status
698 - `sensitive`: optional, valid values are `true` or `false`
699 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
702 - 400 Bad Request `"Unsupported visibility"`
703 - 403 Forbidden `{"error": "error_msg"}`
704 - 404 Not Found `"Not found"`
705 - On success: JSON, Mastodon Status entity
707 ## `DELETE /api/pleroma/admin/statuses/:id`
709 ### Delete an individual reported status
715 - 403 Forbidden `{"error": "error_msg"}`
716 - 404 Not Found `"Not found"`
717 - On success: 200 OK `{}`
719 ## `GET /api/pleroma/admin/config/migrate_to_db`
721 ### Run mix task pleroma.config migrate_to_db
723 Copy settings on key `:pleroma` to DB.
732 ## `GET /api/pleroma/admin/config/migrate_from_db`
734 ### Run mix task pleroma.config migrate_from_db
736 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
746 ## `GET /api/pleroma/admin/config`
748 ### List config settings
750 List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
760 "key": string or string with leading `:` for atoms,
761 "value": string or {} or [] or {"tuple": []}
767 ## `POST /api/pleroma/admin/config`
769 ### Update config settings
771 Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
772 Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
773 Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
774 Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
775 `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
776 Keywords can be passed as lists with 2 child tuples, e.g.
777 `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
779 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.:
780 {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
782 Compile time settings (need instance reboot):
783 - all settings by this keys:
786 - `Pleroma.Web.Endpoint`
789 - `Pleroma.Captcha` -> `:seconds_valid`
790 - `Pleroma.Upload` -> `:proxy_remote`
791 - `:instance` -> `:upload_limit`
796 - `key` (string or string with leading `:` for atoms)
797 - `value` (string, [], {} or {"tuple": []})
798 - `delete` = true (optional, if parameter must be deleted)
799 - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
809 "key": "Pleroma.Upload",
811 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
812 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
813 {"tuple": [":link_name", true]},
814 {"tuple": [":proxy_remote", false]},
815 {"tuple": [":proxy_opts", [
816 {"tuple": [":redirect_on_failure", false]},
817 {"tuple": [":max_body_length", 1048576]},
818 {"tuple": [":http": [
819 {"tuple": [":follow_redirect", true]},
820 {"tuple": [":pool", ":upload"]},
824 {"tuple": [":dispatch", {
825 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
840 "key": string or string with leading `:` for atoms,
841 "value": string or {} or [] or {"tuple": []}
847 ## `GET /api/pleroma/admin/moderation_log`
849 ### Get moderation log
852 - *optional* `page`: **integer** page number
853 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
854 - *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`
855 - *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
856 - *optional* `user_id`: **integer** filter logs by actor's id
857 - *optional* `search`: **string** search logs by the log message
868 "action": "relay_follow"
870 "time": 1502812026, // timestamp
871 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
876 ## `POST /api/pleroma/admin/reload_emoji`
878 ### Reload the instance's custom emoji
880 - Authentication: required
882 - Response: JSON, "ok" and 200 status