Merge branch 'chore/update-copyrights' into 'develop'
[akkoma] / docs / API / admin_api.md
1 # Admin API
2
3 Authentication is required and the user must be an admin.
4
5 Configuration options:
6
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.
11
12 ## `GET /api/pleroma/admin/users`
13
14 ### List users
15
16 - Query Params:
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`
31 - Response:
32
33 ```json
34 {
35 "page_size": integer,
36 "count": integer,
37 "users": [
38 {
39 "deactivated": bool,
40 "id": integer,
41 "nickname": string,
42 "roles": {
43 "admin": bool,
44 "moderator": bool
45 },
46 "local": bool,
47 "tags": array,
48 "avatar": string,
49 "display_name": string
50 },
51 ...
52 ]
53 }
54 ```
55
56 ## DEPRECATED `DELETE /api/pleroma/admin/users`
57
58 ### Remove a user
59
60 - Params:
61 - `nickname`
62 - Response: User’s nickname
63
64 ## `DELETE /api/pleroma/admin/users`
65
66 ### Remove a user
67
68 - Params:
69 - `nicknames`
70 - Response: Array of user nicknames
71
72 ### Create a user
73
74 - Method: `POST`
75 - Params:
76 `users`: [
77 {
78 `nickname`,
79 `email`,
80 `password`
81 }
82 ]
83 - Response: User’s nickname
84
85 ## `POST /api/pleroma/admin/users/follow`
86
87 ### Make a user follow another user
88
89 - Params:
90 - `follower`: The nickname of the follower
91 - `followed`: The nickname of the followed
92 - Response:
93 - "ok"
94
95 ## `POST /api/pleroma/admin/users/unfollow`
96
97 ### Make a user unfollow another user
98
99 - Params:
100 - `follower`: The nickname of the follower
101 - `followed`: The nickname of the followed
102 - Response:
103 - "ok"
104
105 ## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
106
107 ### Toggle user activation
108
109 - Params:
110 - `nickname`
111 - Response: User’s object
112
113 ```json
114 {
115 "deactivated": bool,
116 "id": integer,
117 "nickname": string
118 }
119 ```
120
121 ## `PUT /api/pleroma/admin/users/tag`
122
123 ### Tag a list of users
124
125 - Params:
126 - `nicknames` (array)
127 - `tags` (array)
128
129 ## `DELETE /api/pleroma/admin/users/tag`
130
131 ### Untag a list of users
132
133 - Params:
134 - `nicknames` (array)
135 - `tags` (array)
136
137 ## `GET /api/pleroma/admin/users/:nickname/permission_group`
138
139 ### Get user user permission groups membership
140
141 - Params: none
142 - Response:
143
144 ```json
145 {
146 "is_moderator": bool,
147 "is_admin": bool
148 }
149 ```
150
151 ## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
152
153 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
154
155 ### Get user user permission groups membership per permission group
156
157 - Params: none
158 - Response:
159
160 ```json
161 {
162 "is_moderator": bool,
163 "is_admin": bool
164 }
165 ```
166
167 ## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
168
169 ### Add user to permission group
170
171 - Params: none
172 - Response:
173 - On failure: `{"error": "…"}`
174 - On success: JSON of the user
175
176 ## `POST /api/pleroma/admin/users/permission_group/:permission_group`
177
178 ### Add users to permission group
179
180 - Params:
181 - `nicknames`: nicknames array
182 - Response:
183 - On failure: `{"error": "…"}`
184 - On success: JSON of the user
185
186 ## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
187
188 ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
189
190 ### Remove user from permission group
191
192 - Params: none
193 - Response:
194 - On failure: `{"error": "…"}`
195 - On success: JSON of the user
196 - Note: An admin cannot revoke their own admin status.
197
198 ## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
199
200 ### Remove users from permission group
201
202 - Params:
203 - `nicknames`: nicknames array
204 - Response:
205 - On failure: `{"error": "…"}`
206 - On success: JSON of the user
207 - Note: An admin cannot revoke their own admin status.
208
209 ## `PATCH /api/pleroma/admin/users/activate`
210
211 ### Activate user
212
213 - Params:
214 - `nicknames`: nicknames array
215 - Response:
216
217 ```json
218 {
219 users: [
220 {
221 // user object
222 }
223 ]
224 }
225 ```
226
227 ## `PATCH /api/pleroma/admin/users/deactivate`
228
229 ### Deactivate user
230
231 - Params:
232 - `nicknames`: nicknames array
233 - Response:
234
235 ```json
236 {
237 users: [
238 {
239 // user object
240 }
241 ]
242 }
243 ```
244
245 ## `GET /api/pleroma/admin/users/:nickname_or_id`
246
247 ### Retrive the details of a user
248
249 - Params:
250 - `nickname` or `id`
251 - Response:
252 - On failure: `Not found`
253 - On success: JSON of the user
254
255 ## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
256
257 ### Retrive user's latest statuses
258
259 - Params:
260 - `nickname` or `id`
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)
264 - Response:
265 - On failure: `Not found`
266 - On success: JSON array of user's latest statuses
267
268 ## `GET /api/pleroma/admin/instances/:instance/statuses`
269
270 ### Retrive instance's latest statuses
271
272 - Params:
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)
277 - Response:
278 - On failure: `Not found`
279 - On success: JSON array of instance's latest statuses
280
281 ## `POST /api/pleroma/admin/relay`
282
283 ### Follow a Relay
284
285 - Params:
286 - `relay_url`
287 - Response:
288 - On success: URL of the followed relay
289
290 ## `DELETE /api/pleroma/admin/relay`
291
292 ### Unfollow a Relay
293
294 - Params:
295 - `relay_url`
296 - Response:
297 - On success: URL of the unfollowed relay
298
299 ## `GET /api/pleroma/admin/relay`
300
301 ### List Relays
302
303 - Params: none
304 - Response:
305 - On success: JSON array of relays
306
307 ## `POST /api/pleroma/admin/users/invite_token`
308
309 ### Create an account registration invite token
310
311 - Params:
312 - *optional* `max_use` (integer)
313 - *optional* `expires_at` (date string e.g. "2019-04-07")
314 - Response:
315
316 ```json
317 {
318 "id": integer,
319 "token": string,
320 "used": boolean,
321 "expires_at": date,
322 "uses": integer,
323 "max_use": integer,
324 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
325 }
326 ```
327
328 ## `GET /api/pleroma/admin/users/invites`
329
330 ### Get a list of generated invites
331
332 - Params: none
333 - Response:
334
335 ```json
336 {
337
338 "invites": [
339 {
340 "id": integer,
341 "token": string,
342 "used": boolean,
343 "expires_at": date,
344 "uses": integer,
345 "max_use": integer,
346 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
347 },
348 ...
349 ]
350 }
351 ```
352
353 ## `POST /api/pleroma/admin/users/revoke_invite`
354
355 ### Revoke invite by token
356
357 - Params:
358 - `token`
359 - Response:
360
361 ```json
362 {
363 "id": integer,
364 "token": string,
365 "used": boolean,
366 "expires_at": date,
367 "uses": integer,
368 "max_use": integer,
369 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
370
371 }
372 ```
373
374 ## `POST /api/pleroma/admin/users/email_invite`
375
376 ### Sends registration invite via email
377
378 - Params:
379 - `email`
380 - `name`, optional
381
382 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
383
384 ### Get a password reset token for a given nickname
385
386 - Params: none
387 - Response:
388
389 ```json
390 {
391 "token": "base64 reset token",
392 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
393 }
394 ```
395
396 ## `PATCH /api/pleroma/admin/users/force_password_reset`
397
398 ### Force passord reset for a user with a given nickname
399
400 - Params:
401 - `nicknames`
402 - Response: none (code `204`)
403
404 ## `GET /api/pleroma/admin/reports`
405
406 ### Get a list of reports
407
408 - Params:
409 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
410 - *optional* `limit`: **integer** the number of records to retrieve
411 - *optional* `page`: **integer** page number
412 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
413 - Response:
414 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
415 - On success: JSON, returns a list of reports, where:
416 - `account`: the user who has been reported
417 - `actor`: the user who has sent the report
418 - `statuses`: list of statuses that have been included to the report
419
420 ```json
421 {
422 "totalReports" : 1,
423 "reports": [
424 {
425 "account": {
426 "acct": "user",
427 "avatar": "https://pleroma.example.org/images/avi.png",
428 "avatar_static": "https://pleroma.example.org/images/avi.png",
429 "bot": false,
430 "created_at": "2019-04-23T17:32:04.000Z",
431 "display_name": "User",
432 "emojis": [],
433 "fields": [],
434 "followers_count": 1,
435 "following_count": 1,
436 "header": "https://pleroma.example.org/images/banner.png",
437 "header_static": "https://pleroma.example.org/images/banner.png",
438 "id": "9i6dAJqSGSKMzLG2Lo",
439 "locked": false,
440 "note": "",
441 "pleroma": {
442 "confirmation_pending": false,
443 "hide_favorites": true,
444 "hide_followers": false,
445 "hide_follows": false,
446 "is_admin": false,
447 "is_moderator": false,
448 "relationship": {},
449 "tags": []
450 },
451 "source": {
452 "note": "",
453 "pleroma": {},
454 "sensitive": false
455 },
456 "tags": ["force_unlisted"],
457 "statuses_count": 3,
458 "url": "https://pleroma.example.org/users/user",
459 "username": "user"
460 },
461 "actor": {
462 "acct": "lain",
463 "avatar": "https://pleroma.example.org/images/avi.png",
464 "avatar_static": "https://pleroma.example.org/images/avi.png",
465 "bot": false,
466 "created_at": "2019-03-28T17:36:03.000Z",
467 "display_name": "Roger Braun",
468 "emojis": [],
469 "fields": [],
470 "followers_count": 1,
471 "following_count": 1,
472 "header": "https://pleroma.example.org/images/banner.png",
473 "header_static": "https://pleroma.example.org/images/banner.png",
474 "id": "9hEkA5JsvAdlSrocam",
475 "locked": false,
476 "note": "",
477 "pleroma": {
478 "confirmation_pending": false,
479 "hide_favorites": false,
480 "hide_followers": false,
481 "hide_follows": false,
482 "is_admin": false,
483 "is_moderator": false,
484 "relationship": {},
485 "tags": []
486 },
487 "source": {
488 "note": "",
489 "pleroma": {},
490 "sensitive": false
491 },
492 "tags": ["force_unlisted"],
493 "statuses_count": 1,
494 "url": "https://pleroma.example.org/users/lain",
495 "username": "lain"
496 },
497 "content": "Please delete it",
498 "created_at": "2019-04-29T19:48:15.000Z",
499 "id": "9iJGOv1j8hxuw19bcm",
500 "state": "open",
501 "statuses": [
502 {
503 "account": { ... },
504 "application": {
505 "name": "Web",
506 "website": null
507 },
508 "bookmarked": false,
509 "card": null,
510 "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>",
511 "created_at": "2019-04-23T19:15:47.000Z",
512 "emojis": [],
513 "favourited": false,
514 "favourites_count": 0,
515 "id": "9i6mQ9uVrrOmOime8m",
516 "in_reply_to_account_id": null,
517 "in_reply_to_id": null,
518 "language": null,
519 "media_attachments": [],
520 "mentions": [
521 {
522 "acct": "lain",
523 "id": "9hEkA5JsvAdlSrocam",
524 "url": "https://pleroma.example.org/users/lain",
525 "username": "lain"
526 },
527 {
528 "acct": "user",
529 "id": "9i6dAJqSGSKMzLG2Lo",
530 "url": "https://pleroma.example.org/users/user",
531 "username": "user"
532 }
533 ],
534 "muted": false,
535 "pinned": false,
536 "pleroma": {
537 "content": {
538 "text/plain": "@lain click on my link https://www.google.com/"
539 },
540 "conversation_id": 28,
541 "in_reply_to_account_acct": null,
542 "local": true,
543 "spoiler_text": {
544 "text/plain": ""
545 }
546 },
547 "reblog": null,
548 "reblogged": false,
549 "reblogs_count": 0,
550 "replies_count": 0,
551 "sensitive": false,
552 "spoiler_text": "",
553 "tags": [],
554 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
555 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
556 "visibility": "direct"
557 }
558 ]
559 }
560 ]
561 }
562 ```
563
564 ## `GET /api/pleroma/admin/grouped_reports`
565
566 ### Get a list of reports, grouped by status
567
568 - Params: none
569 - On success: JSON, returns a list of reports, where:
570 - `date`: date of the latest report
571 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
572 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
573 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
574 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
575
576 ```json
577 "reports": [
578 {
579 "date": "2019-10-07T12:31:39.615149Z",
580 "account": { ... },
581 "status": { ... },
582 "actors": [{ ... }, { ... }],
583 "reports": [{ ... }]
584 }
585 ]
586 ```
587
588 ## `GET /api/pleroma/admin/reports/:id`
589
590 ### Get an individual report
591
592 - Params:
593 - `id`
594 - Response:
595 - On failure:
596 - 403 Forbidden `{"error": "error_msg"}`
597 - 404 Not Found `"Not found"`
598 - On success: JSON, Report object (see above)
599
600 ## `PATCH /api/pleroma/admin/reports`
601
602 ### Change the state of one or multiple reports
603
604 - Params:
605
606 ```json
607 `reports`: [
608 {
609 `id`, // required, report id
610 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
611 },
612 ...
613 ]
614 ```
615
616 - Response:
617 - On failure:
618 - 400 Bad Request, JSON:
619
620 ```json
621 [
622 {
623 `id`, // report id
624 `error` // error message
625 }
626 ]
627 ```
628
629 - On success: `204`, empty response
630
631 ## `POST /api/pleroma/admin/reports/:id/notes`
632
633 ### Create report note
634
635 - Params:
636 - `id`: required, report id
637 - `content`: required, the message
638 - Response:
639 - On failure:
640 - 400 Bad Request `"Invalid parameters"` when `status` is missing
641 - On success: `204`, empty response
642
643 ## `POST /api/pleroma/admin/reports/:report_id/notes/:id`
644
645 ### Delete report note
646
647 - Params:
648 - `report_id`: required, report id
649 - `id`: required, note id
650 - Response:
651 - On failure:
652 - 400 Bad Request `"Invalid parameters"` when `status` is missing
653 - On success: `204`, empty response
654
655 ## `PUT /api/pleroma/admin/statuses/:id`
656
657 ### Change the scope of an individual reported status
658
659 - Params:
660 - `id`
661 - `sensitive`: optional, valid values are `true` or `false`
662 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
663 - Response:
664 - On failure:
665 - 400 Bad Request `"Unsupported visibility"`
666 - 403 Forbidden `{"error": "error_msg"}`
667 - 404 Not Found `"Not found"`
668 - On success: JSON, Mastodon Status entity
669
670 ## `DELETE /api/pleroma/admin/statuses/:id`
671
672 ### Delete an individual reported status
673
674 - Params:
675 - `id`
676 - Response:
677 - On failure:
678 - 403 Forbidden `{"error": "error_msg"}`
679 - 404 Not Found `"Not found"`
680 - On success: 200 OK `{}`
681
682 ## `GET /api/pleroma/admin/restart`
683
684 ### Restarts pleroma application
685
686 - Params: none
687 - Response:
688 - On failure:
689 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
690
691 ```json
692 {}
693 ```
694
695 ## `GET /api/pleroma/admin/config`
696
697 ### Get list of merged default settings with saved in database.
698
699 *If `need_reboot` flag exists in response, instance must be restarted, so reboot time settings can take effect.*
700
701 **Only works when configuration from database is enabled.**
702
703 - Params:
704 - `only_db`: true (*optional*, get only saved in database settings)
705 - Response:
706 - On failure:
707 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
708
709 ```json
710 {
711 "configs": [
712 {
713 "group": ":pleroma",
714 "key": "Pleroma.Upload",
715 "value": []
716 }
717 ],
718 "need_reboot": true
719 }
720 ```
721 need_reboot - *optional*, if were changed reboot time settings.
722
723 ## `POST /api/pleroma/admin/config`
724
725 ### Update config settings
726
727 *If `need_reboot` flag exists in response, instance must be restarted, so reboot time settings can take effect.*
728
729 **Only works when configuration from database is enabled.**
730
731 Some modifications are necessary to save the config settings correctly:
732
733 - strings which start with `Pleroma.`, `Phoenix.`, `Tesla.` or strings like `Oban`, `Ueberauth` will be converted to modules;
734 ```
735 "Pleroma.Upload" -> Pleroma.Upload
736 "Oban" -> Oban
737 ```
738 - strings starting with `:` will be converted to atoms;
739 ```
740 ":pleroma" -> :pleroma
741 ```
742 - objects with `tuple` key and array value will be converted to tuples;
743 ```
744 {"tuple": ["string", "Pleroma.Upload", []]} -> {"string", Pleroma.Upload, []}
745 ```
746 - arrays with *tuple objects* will be converted to keywords;
747 ```
748 [{"tuple": [":key1", "value"]}, {"tuple": [":key2", "value"]}] -> [key1: "value", key2: "value"]
749 ```
750
751 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:
752 - all settings inside these keys:
753 - `:hackney_pools`
754 - `:chat`
755 - partially settings inside these keys:
756 - `:seconds_valid` in `Pleroma.Captcha`
757 - `:proxy_remote` in `Pleroma.Upload`
758 - `:upload_limit` in `:instance`
759
760 - Params:
761 - `configs` - array of config objects
762 - config object params:
763 - `group` - string (**required**)
764 - `key` - string (**required**)
765 - `value` - string, [], {} or {"tuple": []} (**required**)
766 - `delete` - true (*optional*, if setting must be deleted)
767 - `subkeys` - array of strings (*optional*, only works when `delete=true` parameter is passed, otherwise will be ignored)
768
769 *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.*
770 ```
771 [subkey: val1, subkey2: val2, subkey3: val3] \\ initial value
772 {"group": ":pleroma", "key": "some_key", "delete": true, "subkeys": [":subkey", ":subkey3"]} \\ passing json for deletion
773 [subkey2: val2] \\ value after deletion
774 ```
775
776 *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.*
777
778 Example of setting without keyword in value:
779 ```elixir
780 config :tesla, :adapter, Tesla.Adapter.Hackney
781 ```
782
783 List of settings which support only full update by key:
784 ```elixir
785 @full_key_update [
786 {:pleroma, :ecto_repos},
787 {:quack, :meta},
788 {:mime, :types},
789 {:cors_plug, [:max_age, :methods, :expose, :headers]},
790 {:auto_linker, :opts},
791 {:swarm, :node_blacklist},
792 {:logger, :backends}
793 ]
794 ```
795
796 List of settings which support only full update by subkey:
797 ```elixir
798 @full_subkey_update [
799 {:pleroma, :assets, :mascots},
800 {:pleroma, :emoji, :groups},
801 {:pleroma, :workers, :retries},
802 {:pleroma, :mrf_subchain, :match_actor},
803 {:pleroma, :mrf_keyword, :replace}
804 ]
805 ```
806
807 *Settings without explicit key must be sended in separate config object params.*
808 ```elixir
809 config :quack,
810 level: :debug,
811 meta: [:all],
812 ...
813 ```
814 ```json
815 {
816 "configs": [
817 {"group": ":quack", "key": ":level", "value": ":debug"},
818 {"group": ":quack", "key": ":meta", "value": [":all"]},
819 ...
820 ]
821 }
822 ```
823 - Request:
824
825 ```json
826 {
827 "configs": [
828 {
829 "group": ":pleroma",
830 "key": "Pleroma.Upload",
831 "value": [
832 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
833 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
834 {"tuple": [":link_name", true]},
835 {"tuple": [":proxy_remote", false]},
836 {"tuple": [":proxy_opts", [
837 {"tuple": [":redirect_on_failure", false]},
838 {"tuple": [":max_body_length", 1048576]},
839 {"tuple": [":http", [
840 {"tuple": [":follow_redirect", true]},
841 {"tuple": [":pool", ":upload"]},
842 ]]}
843 ]
844 ]},
845 {"tuple": [":dispatch", {
846 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
847 }]}
848 ]
849 }
850 ]
851 }
852 ```
853
854 - Response:
855 - On failure:
856 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
857 ```json
858 {
859 "configs": [
860 {
861 "group": ":pleroma",
862 "key": "Pleroma.Upload",
863 "value": [...]
864 }
865 ],
866 "need_reboot": true
867 }
868 ```
869 need_reboot - *optional*, if were changed reboot time settings.
870
871 ## ` GET /api/pleroma/admin/config/descriptions`
872
873 ### Get JSON with config descriptions.
874 Loads json generated from `config/descriptions.exs`.
875
876 - Params: none
877 - Response:
878
879 ```json
880 [{
881 "group": ":pleroma", // string
882 "key": "ModuleName", // string
883 "type": "group", // string or list with possible values,
884 "description": "Upload general settings", // string
885 "children": [
886 {
887 "key": ":uploader", // string or module name `Pleroma.Upload`
888 "type": "module",
889 "description": "Module which will be used for uploads",
890 "suggestions": ["module1", "module2"]
891 },
892 {
893 "key": ":filters",
894 "type": ["list", "module"],
895 "description": "List of filter modules for uploads",
896 "suggestions": [
897 "module1", "module2", "module3"
898 ]
899 }
900 ]
901 }]
902 ```
903
904 ## `GET /api/pleroma/admin/moderation_log`
905
906 ### Get moderation log
907
908 - Params:
909 - *optional* `page`: **integer** page number
910 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
911 - *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`
912 - *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
913 - *optional* `user_id`: **integer** filter logs by actor's id
914 - *optional* `search`: **string** search logs by the log message
915 - Response:
916
917 ```json
918 [
919 {
920 "data": {
921 "actor": {
922 "id": 1,
923 "nickname": "lain"
924 },
925 "action": "relay_follow"
926 },
927 "time": 1502812026, // timestamp
928 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
929 }
930 ]
931 ```
932
933 ## `POST /api/pleroma/admin/reload_emoji`
934
935 ### Reload the instance's custom emoji
936
937 - Authentication: required
938 - Params: None
939 - Response: JSON, "ok" and 200 status
940
941 ## `PATCH /api/pleroma/admin/users/confirm_email`
942
943 ### Confirm users' emails
944
945 - Params:
946 - `nicknames`
947 - Response: Array of user nicknames
948
949 ## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
950
951 ### Resend confirmation email
952
953 - Params:
954 - `nicknames`
955 - Response: Array of user nicknames
956
957 ## `GET /api/pleroma/admin/stats`
958
959 ### Stats
960
961 - Response:
962
963 ```json
964 {
965 "status_visibility": {
966 "direct": 739,
967 "private": 9,
968 "public": 17,
969 "unlisted": 14
970 }
971 }
972 ```