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 ## `DELETE /api/pleroma/admin/users`
55 - Response: User’s nickname
68 - Response: User’s nickname
70 ## `POST /api/pleroma/admin/users/follow`
72 ### Make a user follow another user
75 - `follower`: The nickname of the follower
76 - `followed`: The nickname of the followed
80 ## `POST /api/pleroma/admin/users/unfollow`
82 ### Make a user unfollow another user
85 - `follower`: The nickname of the follower
86 - `followed`: The nickname of the followed
90 ## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
92 ### Toggle user activation
96 - Response: User’s object
106 ## `PUT /api/pleroma/admin/users/tag`
108 ### Tag a list of users
111 - `nicknames` (array)
114 ## `DELETE /api/pleroma/admin/users/tag`
116 ### Untag a list of users
119 - `nicknames` (array)
122 ## `GET /api/pleroma/admin/users/:nickname/permission_group`
124 ### Get user user permission groups membership
131 "is_moderator": bool,
136 ## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
138 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
140 ### Get user user permission groups membership per permission group
147 "is_moderator": bool,
152 ## `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
154 ### Add user in permission group
158 - On failure: `{"error": "…"}`
159 - On success: JSON of the `user.info`
161 ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
163 ### Remove user from permission group
167 - On failure: `{"error": "…"}`
168 - On success: JSON of the `user.info`
169 - Note: An admin cannot revoke their own admin status.
171 ## `PUT /api/pleroma/admin/users/:nickname/activation_status`
173 ### Active or deactivate a user
177 - `status` BOOLEAN field, false value means deactivation.
179 ## `GET /api/pleroma/admin/users/:nickname_or_id`
181 ### Retrive the details of a user
186 - On failure: `Not found`
187 - On success: JSON of the user
189 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
191 ### Retrive user's latest statuses
195 - *optional* `page_size`: number of statuses to return (default is `20`)
196 - *optional* `godmode`: `true`/`false` – allows to see private statuses
198 - On failure: `Not found`
199 - On success: JSON array of user's latest statuses
201 ## `POST /api/pleroma/admin/relay`
208 - On success: URL of the followed relay
210 ## `DELETE /api/pleroma/admin/relay`
217 - On success: URL of the unfollowed relay
219 ## `POST /api/pleroma/admin/users/invite_token`
221 ### Create an account registration invite token
224 - *optional* `max_use` (integer)
225 - *optional* `expires_at` (date string e.g. "2019-04-07")
236 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
240 ## `GET /api/pleroma/admin/users/invites`
242 ### Get a list of generated invites
258 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
265 ## `POST /api/pleroma/admin/users/revoke_invite`
267 ### Revoke invite by token
281 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
286 ## `POST /api/pleroma/admin/users/email_invite`
288 ### Sends registration invite via email
294 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
296 ### Get a password reset token for a given nickname
303 "token": "base64 reset token",
304 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
308 ## `PATCH /api/pleroma/admin/users/:nickname/force_password_reset`
310 ### Force passord reset for a user with a given nickname
313 - Response: none (code `204`)
315 ## `GET /api/pleroma/admin/reports`
317 ### Get a list of reports
320 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
321 - *optional* `limit`: **integer** the number of records to retrieve
322 - *optional* `page`: **integer** page number
323 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
325 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
326 - On success: JSON, returns a list of reports, where:
327 - `account`: the user who has been reported
328 - `actor`: the user who has sent the report
329 - `statuses`: list of statuses that have been included to the report
338 "avatar": "https://pleroma.example.org/images/avi.png",
339 "avatar_static": "https://pleroma.example.org/images/avi.png",
341 "created_at": "2019-04-23T17:32:04.000Z",
342 "display_name": "User",
345 "followers_count": 1,
346 "following_count": 1,
347 "header": "https://pleroma.example.org/images/banner.png",
348 "header_static": "https://pleroma.example.org/images/banner.png",
349 "id": "9i6dAJqSGSKMzLG2Lo",
353 "confirmation_pending": false,
354 "hide_favorites": true,
355 "hide_followers": false,
356 "hide_follows": false,
358 "is_moderator": false,
367 "tags": ["force_unlisted"],
369 "url": "https://pleroma.example.org/users/user",
374 "avatar": "https://pleroma.example.org/images/avi.png",
375 "avatar_static": "https://pleroma.example.org/images/avi.png",
377 "created_at": "2019-03-28T17:36:03.000Z",
378 "display_name": "Roger Braun",
381 "followers_count": 1,
382 "following_count": 1,
383 "header": "https://pleroma.example.org/images/banner.png",
384 "header_static": "https://pleroma.example.org/images/banner.png",
385 "id": "9hEkA5JsvAdlSrocam",
389 "confirmation_pending": false,
390 "hide_favorites": false,
391 "hide_followers": false,
392 "hide_follows": false,
394 "is_moderator": false,
403 "tags": ["force_unlisted"],
405 "url": "https://pleroma.example.org/users/lain",
408 "content": "Please delete it",
409 "created_at": "2019-04-29T19:48:15.000Z",
410 "id": "9iJGOv1j8hxuw19bcm",
421 "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>",
422 "created_at": "2019-04-23T19:15:47.000Z",
425 "favourites_count": 0,
426 "id": "9i6mQ9uVrrOmOime8m",
427 "in_reply_to_account_id": null,
428 "in_reply_to_id": null,
430 "media_attachments": [],
434 "id": "9hEkA5JsvAdlSrocam",
435 "url": "https://pleroma.example.org/users/lain",
440 "id": "9i6dAJqSGSKMzLG2Lo",
441 "url": "https://pleroma.example.org/users/user",
449 "text/plain": "@lain click on my link https://www.google.com/"
451 "conversation_id": 28,
452 "in_reply_to_account_acct": null,
465 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
466 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
467 "visibility": "direct"
475 ## `GET /api/pleroma/admin/grouped_reports`
477 ### Get a list of reports, grouped by status
480 - On success: JSON, returns a list of reports, where:
481 - `date`: date of the latest report
482 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
483 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
484 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
485 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
490 "date": "2019-10-07T12:31:39.615149Z",
493 "actors": [{ ... }, { ... }],
499 ## `GET /api/pleroma/admin/reports/:id`
501 ### Get an individual report
507 - 403 Forbidden `{"error": "error_msg"}`
508 - 404 Not Found `"Not found"`
509 - On success: JSON, Report object (see above)
511 ## `PATCH /api/pleroma/admin/reports`
513 ### Change the state of one or multiple reports
520 `id`, // required, report id
521 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
529 - 400 Bad Request, JSON:
535 `error` // error message
540 - On success: `204`, empty response
542 ## `POST /api/pleroma/admin/reports/:id/respond`
544 ### Respond to a report
548 - `status`: required, the message
551 - 400 Bad Request `"Invalid parameters"` when `status` is missing
552 - 403 Forbidden `{"error": "error_msg"}`
553 - 404 Not Found `"Not found"`
554 - On success: JSON, created Mastodon Status entity
565 "content": "Your claim is going to be closed",
566 "created_at": "2019-05-11T17:13:03.000Z",
569 "favourites_count": 0,
570 "id": "9ihuiSL1405I65TmEq",
571 "in_reply_to_account_id": null,
572 "in_reply_to_id": null,
574 "media_attachments": [],
578 "id": "9i6dAJqSGSKMzLG2Lo",
579 "url": "https://pleroma.example.org/users/user",
584 "id": "9hEkA5JsvAdlSrocam",
585 "url": "https://pleroma.example.org/users/admin",
593 "text/plain": "Your claim is going to be closed"
595 "conversation_id": 35,
596 "in_reply_to_account_acct": null,
609 "uri": "https://pleroma.example.org/objects/cab0836d-9814-46cd-a0ea-529da9db5fcb",
610 "url": "https://pleroma.example.org/notice/9ihuiSL1405I65TmEq",
611 "visibility": "direct"
615 ## `PUT /api/pleroma/admin/statuses/:id`
617 ### Change the scope of an individual reported status
621 - `sensitive`: optional, valid values are `true` or `false`
622 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
625 - 400 Bad Request `"Unsupported visibility"`
626 - 403 Forbidden `{"error": "error_msg"}`
627 - 404 Not Found `"Not found"`
628 - On success: JSON, Mastodon Status entity
630 ## `DELETE /api/pleroma/admin/statuses/:id`
632 ### Delete an individual reported status
638 - 403 Forbidden `{"error": "error_msg"}`
639 - 404 Not Found `"Not found"`
640 - On success: 200 OK `{}`
642 ## `GET /api/pleroma/admin/config/migrate_to_db`
644 ### Run mix task pleroma.config migrate_to_db
646 Copy settings on key `:pleroma` to DB.
655 ## `GET /api/pleroma/admin/config/migrate_from_db`
657 ### Run mix task pleroma.config migrate_from_db
659 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
669 ## `GET /api/pleroma/admin/config`
671 ### List config settings
673 List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
683 "key": string or string with leading `:` for atoms,
684 "value": string or {} or [] or {"tuple": []}
690 ## `POST /api/pleroma/admin/config`
692 ### Update config settings
694 Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
695 Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
696 Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
697 Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
698 `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
699 Keywords can be passed as lists with 2 child tuples, e.g.
700 `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
702 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.:
703 {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
705 Compile time settings (need instance reboot):
706 - all settings by this keys:
709 - `Pleroma.Web.Endpoint`
712 - `Pleroma.Captcha` -> `:seconds_valid`
713 - `Pleroma.Upload` -> `:proxy_remote`
714 - `:instance` -> `:upload_limit`
719 - `key` (string or string with leading `:` for atoms)
720 - `value` (string, [], {} or {"tuple": []})
721 - `delete` = true (optional, if parameter must be deleted)
722 - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
732 "key": "Pleroma.Upload",
734 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
735 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
736 {"tuple": [":link_name", true]},
737 {"tuple": [":proxy_remote", false]},
738 {"tuple": [":proxy_opts", [
739 {"tuple": [":redirect_on_failure", false]},
740 {"tuple": [":max_body_length", 1048576]},
741 {"tuple": [":http": [
742 {"tuple": [":follow_redirect", true]},
743 {"tuple": [":pool", ":upload"]},
747 {"tuple": [":dispatch", {
748 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
763 "key": string or string with leading `:` for atoms,
764 "value": string or {} or [] or {"tuple": []}
770 ## `GET /api/pleroma/admin/moderation_log`
772 ### Get moderation log
775 - *optional* `page`: **integer** page number
776 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
777 - *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`
778 - *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
779 - *optional* `user_id`: **integer** filter logs by actor's id
780 - *optional* `search`: **string** search logs by the log message
791 "action": "relay_follow"
793 "time": 1502812026, // timestamp
794 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
799 ## `POST /api/pleroma/admin/reload_emoji`
801 ### Reload the instance's custom emoji
803 - Authentication: required
805 - Response: JSON, "ok" and 200 status