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 ## `GET /api/pleroma/admin/users/:nickname_or_id`
240 ### Retrive the details of a user
245 - On failure: `Not found`
246 - On success: JSON of the user
248 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
250 ### Retrive user's latest statuses
254 - *optional* `page_size`: number of statuses to return (default is `20`)
255 - *optional* `godmode`: `true`/`false` – allows to see private statuses
257 - On failure: `Not found`
258 - On success: JSON array of user's latest statuses
260 ## `POST /api/pleroma/admin/relay`
267 - On success: URL of the followed relay
269 ## `DELETE /api/pleroma/admin/relay`
276 - On success: URL of the unfollowed relay
278 ## `GET /api/pleroma/admin/relay`
284 - On success: JSON array of relays
286 ## `POST /api/pleroma/admin/users/invite_token`
288 ### Create an account registration invite token
291 - *optional* `max_use` (integer)
292 - *optional* `expires_at` (date string e.g. "2019-04-07")
303 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
307 ## `GET /api/pleroma/admin/users/invites`
309 ### Get a list of generated invites
325 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
332 ## `POST /api/pleroma/admin/users/revoke_invite`
334 ### Revoke invite by token
348 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
353 ## `POST /api/pleroma/admin/users/email_invite`
355 ### Sends registration invite via email
361 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
363 ### Get a password reset token for a given nickname
370 "token": "base64 reset token",
371 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
375 ## `PATCH /api/pleroma/admin/users/force_password_reset`
377 ### Force passord reset for a user with a given nickname
381 - Response: none (code `204`)
383 ## `GET /api/pleroma/admin/reports`
385 ### Get a list of reports
388 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
389 - *optional* `limit`: **integer** the number of records to retrieve
390 - *optional* `page`: **integer** page number
391 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
393 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
394 - On success: JSON, returns a list of reports, where:
395 - `account`: the user who has been reported
396 - `actor`: the user who has sent the report
397 - `statuses`: list of statuses that have been included to the report
406 "avatar": "https://pleroma.example.org/images/avi.png",
407 "avatar_static": "https://pleroma.example.org/images/avi.png",
409 "created_at": "2019-04-23T17:32:04.000Z",
410 "display_name": "User",
413 "followers_count": 1,
414 "following_count": 1,
415 "header": "https://pleroma.example.org/images/banner.png",
416 "header_static": "https://pleroma.example.org/images/banner.png",
417 "id": "9i6dAJqSGSKMzLG2Lo",
421 "confirmation_pending": false,
422 "hide_favorites": true,
423 "hide_followers": false,
424 "hide_follows": false,
426 "is_moderator": false,
435 "tags": ["force_unlisted"],
437 "url": "https://pleroma.example.org/users/user",
442 "avatar": "https://pleroma.example.org/images/avi.png",
443 "avatar_static": "https://pleroma.example.org/images/avi.png",
445 "created_at": "2019-03-28T17:36:03.000Z",
446 "display_name": "Roger Braun",
449 "followers_count": 1,
450 "following_count": 1,
451 "header": "https://pleroma.example.org/images/banner.png",
452 "header_static": "https://pleroma.example.org/images/banner.png",
453 "id": "9hEkA5JsvAdlSrocam",
457 "confirmation_pending": false,
458 "hide_favorites": false,
459 "hide_followers": false,
460 "hide_follows": false,
462 "is_moderator": false,
471 "tags": ["force_unlisted"],
473 "url": "https://pleroma.example.org/users/lain",
476 "content": "Please delete it",
477 "created_at": "2019-04-29T19:48:15.000Z",
478 "id": "9iJGOv1j8hxuw19bcm",
489 "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>",
490 "created_at": "2019-04-23T19:15:47.000Z",
493 "favourites_count": 0,
494 "id": "9i6mQ9uVrrOmOime8m",
495 "in_reply_to_account_id": null,
496 "in_reply_to_id": null,
498 "media_attachments": [],
502 "id": "9hEkA5JsvAdlSrocam",
503 "url": "https://pleroma.example.org/users/lain",
508 "id": "9i6dAJqSGSKMzLG2Lo",
509 "url": "https://pleroma.example.org/users/user",
517 "text/plain": "@lain click on my link https://www.google.com/"
519 "conversation_id": 28,
520 "in_reply_to_account_acct": null,
533 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
534 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
535 "visibility": "direct"
543 ## `GET /api/pleroma/admin/grouped_reports`
545 ### Get a list of reports, grouped by status
548 - On success: JSON, returns a list of reports, where:
549 - `date`: date of the latest report
550 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
551 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
552 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
553 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
558 "date": "2019-10-07T12:31:39.615149Z",
561 "actors": [{ ... }, { ... }],
567 ## `GET /api/pleroma/admin/reports/:id`
569 ### Get an individual report
575 - 403 Forbidden `{"error": "error_msg"}`
576 - 404 Not Found `"Not found"`
577 - On success: JSON, Report object (see above)
579 ## `PATCH /api/pleroma/admin/reports`
581 ### Change the state of one or multiple reports
588 `id`, // required, report id
589 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
597 - 400 Bad Request, JSON:
603 `error` // error message
608 - On success: `204`, empty response
610 ## `POST /api/pleroma/admin/reports/:id/respond`
612 ### Respond to a report
616 - `status`: required, the message
619 - 400 Bad Request `"Invalid parameters"` when `status` is missing
620 - 403 Forbidden `{"error": "error_msg"}`
621 - 404 Not Found `"Not found"`
622 - On success: JSON, created Mastodon Status entity
633 "content": "Your claim is going to be closed",
634 "created_at": "2019-05-11T17:13:03.000Z",
637 "favourites_count": 0,
638 "id": "9ihuiSL1405I65TmEq",
639 "in_reply_to_account_id": null,
640 "in_reply_to_id": null,
642 "media_attachments": [],
646 "id": "9i6dAJqSGSKMzLG2Lo",
647 "url": "https://pleroma.example.org/users/user",
652 "id": "9hEkA5JsvAdlSrocam",
653 "url": "https://pleroma.example.org/users/admin",
661 "text/plain": "Your claim is going to be closed"
663 "conversation_id": 35,
664 "in_reply_to_account_acct": null,
677 "uri": "https://pleroma.example.org/objects/cab0836d-9814-46cd-a0ea-529da9db5fcb",
678 "url": "https://pleroma.example.org/notice/9ihuiSL1405I65TmEq",
679 "visibility": "direct"
683 ## `PUT /api/pleroma/admin/statuses/:id`
685 ### Change the scope of an individual reported status
689 - `sensitive`: optional, valid values are `true` or `false`
690 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
693 - 400 Bad Request `"Unsupported visibility"`
694 - 403 Forbidden `{"error": "error_msg"}`
695 - 404 Not Found `"Not found"`
696 - On success: JSON, Mastodon Status entity
698 ## `DELETE /api/pleroma/admin/statuses/:id`
700 ### Delete an individual reported status
706 - 403 Forbidden `{"error": "error_msg"}`
707 - 404 Not Found `"Not found"`
708 - On success: 200 OK `{}`
710 ## `GET /api/pleroma/admin/config/migrate_to_db`
712 ### Run mix task pleroma.config migrate_to_db
714 Copy settings on key `:pleroma` to DB.
723 ## `GET /api/pleroma/admin/config/migrate_from_db`
725 ### Run mix task pleroma.config migrate_from_db
727 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
736 ## `GET /api/pleroma/admin/config`
738 ### List config settings
740 List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
750 "key": string or string with leading `:` for atoms,
751 "value": string or {} or [] or {"tuple": []}
757 ## `POST /api/pleroma/admin/config`
759 ### Update config settings
761 Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
762 Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
763 Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
764 Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
765 `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
766 Keywords can be passed as lists with 2 child tuples, e.g.
767 `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
769 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.:
770 {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
772 Compile time settings (need instance reboot):
773 - all settings by this keys:
776 - `Pleroma.Web.Endpoint`
779 - `Pleroma.Captcha` -> `:seconds_valid`
780 - `Pleroma.Upload` -> `:proxy_remote`
781 - `:instance` -> `:upload_limit`
786 - `key` (string or string with leading `:` for atoms)
787 - `value` (string, [], {} or {"tuple": []})
788 - `delete` = true (optional, if parameter must be deleted)
789 - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
799 "key": "Pleroma.Upload",
801 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
802 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
803 {"tuple": [":link_name", true]},
804 {"tuple": [":proxy_remote", false]},
805 {"tuple": [":proxy_opts", [
806 {"tuple": [":redirect_on_failure", false]},
807 {"tuple": [":max_body_length", 1048576]},
808 {"tuple": [":http": [
809 {"tuple": [":follow_redirect", true]},
810 {"tuple": [":pool", ":upload"]},
814 {"tuple": [":dispatch", {
815 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
830 "key": string or string with leading `:` for atoms,
831 "value": string or {} or [] or {"tuple": []}
837 ## `GET /api/pleroma/admin/moderation_log`
839 ### Get moderation log
842 - *optional* `page`: **integer** page number
843 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
844 - *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`
845 - *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
846 - *optional* `user_id`: **integer** filter logs by actor's id
847 - *optional* `search`: **string** search logs by the log message
858 "action": "relay_follow"
860 "time": 1502812026, // timestamp
861 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
866 ## `POST /api/pleroma/admin/reload_emoji`
868 ### Reload the instance's custom emoji
870 - Authentication: required
872 - Response: JSON, "ok" and 200 status