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`
63 - Response: Array of user nicknames
76 - Response: User’s nickname
78 ## `POST /api/pleroma/admin/users/follow`
80 ### Make a user follow another user
83 - `follower`: The nickname of the follower
84 - `followed`: The nickname of the followed
88 ## `POST /api/pleroma/admin/users/unfollow`
90 ### Make a user unfollow another user
93 - `follower`: The nickname of the follower
94 - `followed`: The nickname of the followed
98 ## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
100 ### Toggle user activation
104 - Response: User’s object
114 ## `PUT /api/pleroma/admin/users/tag`
116 ### Tag a list of users
119 - `nicknames` (array)
122 ## `DELETE /api/pleroma/admin/users/tag`
124 ### Untag a list of users
127 - `nicknames` (array)
130 ## `GET /api/pleroma/admin/users/:nickname/permission_group`
132 ### Get user user permission groups membership
139 "is_moderator": bool,
144 ## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
146 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
148 ### Get user user permission groups membership per permission group
155 "is_moderator": bool,
160 ## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
162 ### Add user to permission group
166 - On failure: `{"error": "…"}`
167 - On success: JSON of the user
169 ## `POST /api/pleroma/admin/users/permission_group/:permission_group`
171 ### Add users to permission group
174 - `nicknames`: nicknames array
176 - On failure: `{"error": "…"}`
177 - On success: JSON of the user
179 ## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
181 ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
183 ### Remove user from permission group
187 - On failure: `{"error": "…"}`
188 - On success: JSON of the user
189 - Note: An admin cannot revoke their own admin status.
191 ## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
193 ### Remove users from permission group
196 - `nicknames`: nicknames array
198 - On failure: `{"error": "…"}`
199 - On success: JSON of the user
200 - Note: An admin cannot revoke their own admin status.
202 ## `PATCH /api/pleroma/admin/users/activate`
207 - `nicknames`: nicknames array
220 ## `PATCH /api/pleroma/admin/users/deactivate`
225 - `nicknames`: nicknames array
238 ## DEPRECATED `PATCH /api/pleroma/admin/users/:nickname/activation_status`
240 ### Active or deactivate a user
244 - `status` BOOLEAN field, false value means deactivation.
246 ## `GET /api/pleroma/admin/users/:nickname_or_id`
248 ### Retrive the details of a user
253 - On failure: `Not found`
254 - On success: JSON of the user
256 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
258 ### Retrive user's latest statuses
262 - *optional* `page_size`: number of statuses to return (default is `20`)
263 - *optional* `godmode`: `true`/`false` – allows to see private statuses
265 - On failure: `Not found`
266 - On success: JSON array of user's latest statuses
268 ## `POST /api/pleroma/admin/relay`
275 - On success: URL of the followed relay
277 ## `DELETE /api/pleroma/admin/relay`
284 - On success: URL of the unfollowed relay
286 ## `GET /api/pleroma/admin/relay`
292 - On success: JSON array of relays
294 ## `POST /api/pleroma/admin/users/invite_token`
296 ### Create an account registration invite token
299 - *optional* `max_use` (integer)
300 - *optional* `expires_at` (date string e.g. "2019-04-07")
311 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
315 ## `GET /api/pleroma/admin/users/invites`
317 ### Get a list of generated invites
333 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
340 ## `POST /api/pleroma/admin/users/revoke_invite`
342 ### Revoke invite by token
356 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
361 ## `POST /api/pleroma/admin/users/email_invite`
363 ### Sends registration invite via email
369 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
371 ### Get a password reset token for a given nickname
378 "token": "base64 reset token",
379 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
383 ## `PATCH /api/pleroma/admin/users/force_password_reset`
385 ### Force passord reset for a user with a given nickname
389 - Response: none (code `204`)
391 ## `GET /api/pleroma/admin/reports`
393 ### Get a list of reports
396 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
397 - *optional* `limit`: **integer** the number of records to retrieve
398 - *optional* `page`: **integer** page number
399 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
401 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
402 - On success: JSON, returns a list of reports, where:
403 - `account`: the user who has been reported
404 - `actor`: the user who has sent the report
405 - `statuses`: list of statuses that have been included to the report
414 "avatar": "https://pleroma.example.org/images/avi.png",
415 "avatar_static": "https://pleroma.example.org/images/avi.png",
417 "created_at": "2019-04-23T17:32:04.000Z",
418 "display_name": "User",
421 "followers_count": 1,
422 "following_count": 1,
423 "header": "https://pleroma.example.org/images/banner.png",
424 "header_static": "https://pleroma.example.org/images/banner.png",
425 "id": "9i6dAJqSGSKMzLG2Lo",
429 "confirmation_pending": false,
430 "hide_favorites": true,
431 "hide_followers": false,
432 "hide_follows": false,
434 "is_moderator": false,
443 "tags": ["force_unlisted"],
445 "url": "https://pleroma.example.org/users/user",
450 "avatar": "https://pleroma.example.org/images/avi.png",
451 "avatar_static": "https://pleroma.example.org/images/avi.png",
453 "created_at": "2019-03-28T17:36:03.000Z",
454 "display_name": "Roger Braun",
457 "followers_count": 1,
458 "following_count": 1,
459 "header": "https://pleroma.example.org/images/banner.png",
460 "header_static": "https://pleroma.example.org/images/banner.png",
461 "id": "9hEkA5JsvAdlSrocam",
465 "confirmation_pending": false,
466 "hide_favorites": false,
467 "hide_followers": false,
468 "hide_follows": false,
470 "is_moderator": false,
479 "tags": ["force_unlisted"],
481 "url": "https://pleroma.example.org/users/lain",
484 "content": "Please delete it",
485 "created_at": "2019-04-29T19:48:15.000Z",
486 "id": "9iJGOv1j8hxuw19bcm",
497 "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>",
498 "created_at": "2019-04-23T19:15:47.000Z",
501 "favourites_count": 0,
502 "id": "9i6mQ9uVrrOmOime8m",
503 "in_reply_to_account_id": null,
504 "in_reply_to_id": null,
506 "media_attachments": [],
510 "id": "9hEkA5JsvAdlSrocam",
511 "url": "https://pleroma.example.org/users/lain",
516 "id": "9i6dAJqSGSKMzLG2Lo",
517 "url": "https://pleroma.example.org/users/user",
525 "text/plain": "@lain click on my link https://www.google.com/"
527 "conversation_id": 28,
528 "in_reply_to_account_acct": null,
541 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
542 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
543 "visibility": "direct"
551 ## `GET /api/pleroma/admin/grouped_reports`
553 ### Get a list of reports, grouped by status
556 - On success: JSON, returns a list of reports, where:
557 - `date`: date of the latest report
558 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
559 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
560 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
561 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
566 "date": "2019-10-07T12:31:39.615149Z",
569 "actors": [{ ... }, { ... }],
575 ## `GET /api/pleroma/admin/reports/:id`
577 ### Get an individual report
583 - 403 Forbidden `{"error": "error_msg"}`
584 - 404 Not Found `"Not found"`
585 - On success: JSON, Report object (see above)
587 ## `PATCH /api/pleroma/admin/reports`
589 ### Change the state of one or multiple reports
596 `id`, // required, report id
597 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
605 - 400 Bad Request, JSON:
611 `error` // error message
616 - On success: `204`, empty response
618 ## `POST /api/pleroma/admin/reports/:id/respond`
620 ### Respond to a report
624 - `status`: required, the message
627 - 400 Bad Request `"Invalid parameters"` when `status` is missing
628 - 403 Forbidden `{"error": "error_msg"}`
629 - 404 Not Found `"Not found"`
630 - On success: JSON, created Mastodon Status entity
641 "content": "Your claim is going to be closed",
642 "created_at": "2019-05-11T17:13:03.000Z",
645 "favourites_count": 0,
646 "id": "9ihuiSL1405I65TmEq",
647 "in_reply_to_account_id": null,
648 "in_reply_to_id": null,
650 "media_attachments": [],
654 "id": "9i6dAJqSGSKMzLG2Lo",
655 "url": "https://pleroma.example.org/users/user",
660 "id": "9hEkA5JsvAdlSrocam",
661 "url": "https://pleroma.example.org/users/admin",
669 "text/plain": "Your claim is going to be closed"
671 "conversation_id": 35,
672 "in_reply_to_account_acct": null,
685 "uri": "https://pleroma.example.org/objects/cab0836d-9814-46cd-a0ea-529da9db5fcb",
686 "url": "https://pleroma.example.org/notice/9ihuiSL1405I65TmEq",
687 "visibility": "direct"
691 ## `PUT /api/pleroma/admin/statuses/:id`
693 ### Change the scope of an individual reported status
697 - `sensitive`: optional, valid values are `true` or `false`
698 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
701 - 400 Bad Request `"Unsupported visibility"`
702 - 403 Forbidden `{"error": "error_msg"}`
703 - 404 Not Found `"Not found"`
704 - On success: JSON, Mastodon Status entity
706 ## `DELETE /api/pleroma/admin/statuses/:id`
708 ### Delete an individual reported status
714 - 403 Forbidden `{"error": "error_msg"}`
715 - 404 Not Found `"Not found"`
716 - On success: 200 OK `{}`
718 ## `GET /api/pleroma/admin/config/migrate_to_db`
720 ### Run mix task pleroma.config migrate_to_db
722 Copy settings on key `:pleroma` to DB.
731 ## `GET /api/pleroma/admin/config/migrate_from_db`
733 ### Run mix task pleroma.config migrate_from_db
735 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
744 ## `GET /api/pleroma/admin/config`
746 ### List config settings
748 List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
758 "key": string or string with leading `:` for atoms,
759 "value": string or {} or [] or {"tuple": []}
765 ## `POST /api/pleroma/admin/config`
767 ### Update config settings
769 Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
770 Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
771 Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
772 Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
773 `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
774 Keywords can be passed as lists with 2 child tuples, e.g.
775 `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
777 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.:
778 {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
780 Compile time settings (need instance reboot):
781 - all settings by this keys:
784 - `Pleroma.Web.Endpoint`
787 - `Pleroma.Captcha` -> `:seconds_valid`
788 - `Pleroma.Upload` -> `:proxy_remote`
789 - `:instance` -> `:upload_limit`
794 - `key` (string or string with leading `:` for atoms)
795 - `value` (string, [], {} or {"tuple": []})
796 - `delete` = true (optional, if parameter must be deleted)
797 - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
807 "key": "Pleroma.Upload",
809 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
810 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
811 {"tuple": [":link_name", true]},
812 {"tuple": [":proxy_remote", false]},
813 {"tuple": [":proxy_opts", [
814 {"tuple": [":redirect_on_failure", false]},
815 {"tuple": [":max_body_length", 1048576]},
816 {"tuple": [":http": [
817 {"tuple": [":follow_redirect", true]},
818 {"tuple": [":pool", ":upload"]},
822 {"tuple": [":dispatch", {
823 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
838 "key": string or string with leading `:` for atoms,
839 "value": string or {} or [] or {"tuple": []}
845 ## `GET /api/pleroma/admin/moderation_log`
847 ### Get moderation log
850 - *optional* `page`: **integer** page number
851 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
852 - *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`
853 - *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
854 - *optional* `user_id`: **integer** filter logs by actor's id
855 - *optional* `search`: **string** search logs by the log message
866 "action": "relay_follow"
868 "time": 1502812026, // timestamp
869 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
874 ## `POST /api/pleroma/admin/reload_emoji`
876 ### Reload the instance's custom emoji
878 - Authentication: required
880 - Response: JSON, "ok" and 200 status