Merge branch 'docs_updating' 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 - Response:
264 - On failure: `Not found`
265 - On success: JSON array of user's latest statuses
266
267 ## `POST /api/pleroma/admin/relay`
268
269 ### Follow a Relay
270
271 - Params:
272 - `relay_url`
273 - Response:
274 - On success: URL of the followed relay
275
276 ## `DELETE /api/pleroma/admin/relay`
277
278 ### Unfollow a Relay
279
280 - Params:
281 - `relay_url`
282 - Response:
283 - On success: URL of the unfollowed relay
284
285 ## `GET /api/pleroma/admin/relay`
286
287 ### List Relays
288
289 - Params: none
290 - Response:
291 - On success: JSON array of relays
292
293 ## `POST /api/pleroma/admin/users/invite_token`
294
295 ### Create an account registration invite token
296
297 - Params:
298 - *optional* `max_use` (integer)
299 - *optional* `expires_at` (date string e.g. "2019-04-07")
300 - Response:
301
302 ```json
303 {
304 "id": integer,
305 "token": string,
306 "used": boolean,
307 "expires_at": date,
308 "uses": integer,
309 "max_use": integer,
310 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
311 }
312 ```
313
314 ## `GET /api/pleroma/admin/users/invites`
315
316 ### Get a list of generated invites
317
318 - Params: none
319 - Response:
320
321 ```json
322 {
323
324 "invites": [
325 {
326 "id": integer,
327 "token": string,
328 "used": boolean,
329 "expires_at": date,
330 "uses": integer,
331 "max_use": integer,
332 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
333 },
334 ...
335 ]
336 }
337 ```
338
339 ## `POST /api/pleroma/admin/users/revoke_invite`
340
341 ### Revoke invite by token
342
343 - Params:
344 - `token`
345 - Response:
346
347 ```json
348 {
349 "id": integer,
350 "token": string,
351 "used": boolean,
352 "expires_at": date,
353 "uses": integer,
354 "max_use": integer,
355 "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
356
357 }
358 ```
359
360 ## `POST /api/pleroma/admin/users/email_invite`
361
362 ### Sends registration invite via email
363
364 - Params:
365 - `email`
366 - `name`, optional
367
368 ## `GET /api/pleroma/admin/users/:nickname/password_reset`
369
370 ### Get a password reset token for a given nickname
371
372 - Params: none
373 - Response:
374
375 ```json
376 {
377 "token": "base64 reset token",
378 "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
379 }
380 ```
381
382 ## `PATCH /api/pleroma/admin/users/force_password_reset`
383
384 ### Force passord reset for a user with a given nickname
385
386 - Params:
387 - `nicknames`
388 - Response: none (code `204`)
389
390 ## `GET /api/pleroma/admin/reports`
391
392 ### Get a list of reports
393
394 - Params:
395 - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
396 - *optional* `limit`: **integer** the number of records to retrieve
397 - *optional* `page`: **integer** page number
398 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
399 - Response:
400 - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
401 - On success: JSON, returns a list of reports, where:
402 - `account`: the user who has been reported
403 - `actor`: the user who has sent the report
404 - `statuses`: list of statuses that have been included to the report
405
406 ```json
407 {
408 "totalReports" : 1,
409 "reports": [
410 {
411 "account": {
412 "acct": "user",
413 "avatar": "https://pleroma.example.org/images/avi.png",
414 "avatar_static": "https://pleroma.example.org/images/avi.png",
415 "bot": false,
416 "created_at": "2019-04-23T17:32:04.000Z",
417 "display_name": "User",
418 "emojis": [],
419 "fields": [],
420 "followers_count": 1,
421 "following_count": 1,
422 "header": "https://pleroma.example.org/images/banner.png",
423 "header_static": "https://pleroma.example.org/images/banner.png",
424 "id": "9i6dAJqSGSKMzLG2Lo",
425 "locked": false,
426 "note": "",
427 "pleroma": {
428 "confirmation_pending": false,
429 "hide_favorites": true,
430 "hide_followers": false,
431 "hide_follows": false,
432 "is_admin": false,
433 "is_moderator": false,
434 "relationship": {},
435 "tags": []
436 },
437 "source": {
438 "note": "",
439 "pleroma": {},
440 "sensitive": false
441 },
442 "tags": ["force_unlisted"],
443 "statuses_count": 3,
444 "url": "https://pleroma.example.org/users/user",
445 "username": "user"
446 },
447 "actor": {
448 "acct": "lain",
449 "avatar": "https://pleroma.example.org/images/avi.png",
450 "avatar_static": "https://pleroma.example.org/images/avi.png",
451 "bot": false,
452 "created_at": "2019-03-28T17:36:03.000Z",
453 "display_name": "Roger Braun",
454 "emojis": [],
455 "fields": [],
456 "followers_count": 1,
457 "following_count": 1,
458 "header": "https://pleroma.example.org/images/banner.png",
459 "header_static": "https://pleroma.example.org/images/banner.png",
460 "id": "9hEkA5JsvAdlSrocam",
461 "locked": false,
462 "note": "",
463 "pleroma": {
464 "confirmation_pending": false,
465 "hide_favorites": false,
466 "hide_followers": false,
467 "hide_follows": false,
468 "is_admin": false,
469 "is_moderator": false,
470 "relationship": {},
471 "tags": []
472 },
473 "source": {
474 "note": "",
475 "pleroma": {},
476 "sensitive": false
477 },
478 "tags": ["force_unlisted"],
479 "statuses_count": 1,
480 "url": "https://pleroma.example.org/users/lain",
481 "username": "lain"
482 },
483 "content": "Please delete it",
484 "created_at": "2019-04-29T19:48:15.000Z",
485 "id": "9iJGOv1j8hxuw19bcm",
486 "state": "open",
487 "statuses": [
488 {
489 "account": { ... },
490 "application": {
491 "name": "Web",
492 "website": null
493 },
494 "bookmarked": false,
495 "card": null,
496 "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>",
497 "created_at": "2019-04-23T19:15:47.000Z",
498 "emojis": [],
499 "favourited": false,
500 "favourites_count": 0,
501 "id": "9i6mQ9uVrrOmOime8m",
502 "in_reply_to_account_id": null,
503 "in_reply_to_id": null,
504 "language": null,
505 "media_attachments": [],
506 "mentions": [
507 {
508 "acct": "lain",
509 "id": "9hEkA5JsvAdlSrocam",
510 "url": "https://pleroma.example.org/users/lain",
511 "username": "lain"
512 },
513 {
514 "acct": "user",
515 "id": "9i6dAJqSGSKMzLG2Lo",
516 "url": "https://pleroma.example.org/users/user",
517 "username": "user"
518 }
519 ],
520 "muted": false,
521 "pinned": false,
522 "pleroma": {
523 "content": {
524 "text/plain": "@lain click on my link https://www.google.com/"
525 },
526 "conversation_id": 28,
527 "in_reply_to_account_acct": null,
528 "local": true,
529 "spoiler_text": {
530 "text/plain": ""
531 }
532 },
533 "reblog": null,
534 "reblogged": false,
535 "reblogs_count": 0,
536 "replies_count": 0,
537 "sensitive": false,
538 "spoiler_text": "",
539 "tags": [],
540 "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
541 "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
542 "visibility": "direct"
543 }
544 ]
545 }
546 ]
547 }
548 ```
549
550 ## `GET /api/pleroma/admin/grouped_reports`
551
552 ### Get a list of reports, grouped by status
553
554 - Params: none
555 - On success: JSON, returns a list of reports, where:
556 - `date`: date of the latest report
557 - `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
558 - `status`: reported status (see `/api/pleroma/admin/reports` for reference)
559 - `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
560 - `reports`: reports (see `/api/pleroma/admin/reports` for reference)
561
562 ```json
563 "reports": [
564 {
565 "date": "2019-10-07T12:31:39.615149Z",
566 "account": { ... },
567 "status": { ... },
568 "actors": [{ ... }, { ... }],
569 "reports": [{ ... }]
570 }
571 ]
572 ```
573
574 ## `GET /api/pleroma/admin/reports/:id`
575
576 ### Get an individual report
577
578 - Params:
579 - `id`
580 - Response:
581 - On failure:
582 - 403 Forbidden `{"error": "error_msg"}`
583 - 404 Not Found `"Not found"`
584 - On success: JSON, Report object (see above)
585
586 ## `PATCH /api/pleroma/admin/reports`
587
588 ### Change the state of one or multiple reports
589
590 - Params:
591
592 ```json
593 `reports`: [
594 {
595 `id`, // required, report id
596 `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
597 },
598 ...
599 ]
600 ```
601
602 - Response:
603 - On failure:
604 - 400 Bad Request, JSON:
605
606 ```json
607 [
608 {
609 `id`, // report id
610 `error` // error message
611 }
612 ]
613 ```
614
615 - On success: `204`, empty response
616
617 ## `POST /api/pleroma/admin/reports/:id/notes`
618
619 ### Create report note
620
621 - Params:
622 - `id`: required, report id
623 - `content`: required, the message
624 - Response:
625 - On failure:
626 - 400 Bad Request `"Invalid parameters"` when `status` is missing
627 - On success: `204`, empty response
628
629 ## `POST /api/pleroma/admin/reports/:report_id/notes/:id`
630
631 ### Delete report note
632
633 - Params:
634 - `report_id`: required, report id
635 - `id`: required, note id
636 - Response:
637 - On failure:
638 - 400 Bad Request `"Invalid parameters"` when `status` is missing
639 - On success: `204`, empty response
640
641 ## `PUT /api/pleroma/admin/statuses/:id`
642
643 ### Change the scope of an individual reported status
644
645 - Params:
646 - `id`
647 - `sensitive`: optional, valid values are `true` or `false`
648 - `visibility`: optional, valid values are `public`, `private` and `unlisted`
649 - Response:
650 - On failure:
651 - 400 Bad Request `"Unsupported visibility"`
652 - 403 Forbidden `{"error": "error_msg"}`
653 - 404 Not Found `"Not found"`
654 - On success: JSON, Mastodon Status entity
655
656 ## `DELETE /api/pleroma/admin/statuses/:id`
657
658 ### Delete an individual reported status
659
660 - Params:
661 - `id`
662 - Response:
663 - On failure:
664 - 403 Forbidden `{"error": "error_msg"}`
665 - 404 Not Found `"Not found"`
666 - On success: 200 OK `{}`
667
668 ## `GET /api/pleroma/admin/restart`
669
670 ### Restarts pleroma application
671
672 - Params: none
673 - Response:
674 - On failure:
675 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
676
677 ```json
678 {}
679 ```
680
681 ## `GET /api/pleroma/admin/config`
682
683 ### Get list of merged default settings with saved in database.
684
685 *If `need_reboot` flag exists in response, instance must be restarted, so reboot time settings can take effect.*
686
687 **Only works when configuration from database is enabled.**
688
689 - Params:
690 - `only_db`: true (*optional*, get only saved in database settings)
691 - Response:
692 - On failure:
693 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
694
695 ```json
696 {
697 "configs": [
698 {
699 "group": ":pleroma",
700 "key": "Pleroma.Upload",
701 "value": []
702 }
703 ],
704 "need_reboot": true
705 }
706 ```
707 need_reboot - *optional*, if were changed reboot time settings.
708
709 ## `POST /api/pleroma/admin/config`
710
711 ### Update config settings
712
713 *If `need_reboot` flag exists in response, instance must be restarted, so reboot time settings can take effect.*
714
715 **Only works when configuration from database is enabled.**
716
717 Some modifications are necessary to save the config settings correctly:
718
719 - strings which start with `Pleroma.`, `Phoenix.`, `Tesla.` or strings like `Oban`, `Ueberauth` will be converted to modules;
720 ```
721 "Pleroma.Upload" -> Pleroma.Upload
722 "Oban" -> Oban
723 ```
724 - strings starting with `:` will be converted to atoms;
725 ```
726 ":pleroma" -> :pleroma
727 ```
728 - objects with `tuple` key and array value will be converted to tuples;
729 ```
730 {"tuple": ["string", "Pleroma.Upload", []]} -> {"string", Pleroma.Upload, []}
731 ```
732 - arrays with *tuple objects* will be converted to keywords;
733 ```
734 [{"tuple": [":key1", "value"]}, {"tuple": [":key2", "value"]}] -> [key1: "value", key2: "value"]
735 ```
736
737 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:
738 - all settings inside these keys:
739 - `:hackney_pools`
740 - `:chat`
741 - partially settings inside these keys:
742 - `:seconds_valid` in `Pleroma.Captcha`
743 - `:proxy_remote` in `Pleroma.Upload`
744 - `:upload_limit` in `:instance`
745
746 - Params:
747 - `configs` - array of config objects
748 - config object params:
749 - `group` - string (**required**)
750 - `key` - string (**required**)
751 - `value` - string, [], {} or {"tuple": []} (**required**)
752 - `delete` - true (*optional*, if setting must be deleted)
753 - `subkeys` - array of strings (*optional*, only works when `delete=true` parameter is passed, otherwise will be ignored)
754
755 *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.*
756 ```
757 [subkey: val1, subkey2: val2, subkey3: val3] \\ initial value
758 {"group": ":pleroma", "key": "some_key", "delete": true, "subkeys": [":subkey", ":subkey3"]} \\ passing json for deletion
759 [subkey2: val2] \\ value after deletion
760 ```
761
762 *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.*
763
764 Example of setting without keyword in value:
765 ```elixir
766 config :tesla, :adapter, Tesla.Adapter.Hackney
767 ```
768
769 List of settings which support only full update by key:
770 ```elixir
771 @full_key_update [
772 {:pleroma, :ecto_repos},
773 {:quack, :meta},
774 {:mime, :types},
775 {:cors_plug, [:max_age, :methods, :expose, :headers]},
776 {:auto_linker, :opts},
777 {:swarm, :node_blacklist},
778 {:logger, :backends}
779 ]
780 ```
781
782 List of settings which support only full update by subkey:
783 ```elixir
784 @full_subkey_update [
785 {:pleroma, :assets, :mascots},
786 {:pleroma, :emoji, :groups},
787 {:pleroma, :workers, :retries},
788 {:pleroma, :mrf_subchain, :match_actor},
789 {:pleroma, :mrf_keyword, :replace}
790 ]
791 ```
792
793 *Settings without explicit key must be sended in separate config object params.*
794 ```elixir
795 config :quack,
796 level: :debug,
797 meta: [:all],
798 ...
799 ```
800 ```json
801 {
802 "configs": [
803 {"group": ":quack", "key": ":level", "value": ":debug"},
804 {"group": ":quack", "key": ":meta", "value": [":all"]},
805 ...
806 ]
807 }
808 ```
809 - Request:
810
811 ```json
812 {
813 "configs": [
814 {
815 "group": ":pleroma",
816 "key": "Pleroma.Upload",
817 "value": [
818 {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
819 {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
820 {"tuple": [":link_name", true]},
821 {"tuple": [":proxy_remote", false]},
822 {"tuple": [":proxy_opts", [
823 {"tuple": [":redirect_on_failure", false]},
824 {"tuple": [":max_body_length", 1048576]},
825 {"tuple": [":http", [
826 {"tuple": [":follow_redirect", true]},
827 {"tuple": [":pool", ":upload"]},
828 ]]}
829 ]
830 ]},
831 {"tuple": [":dispatch", {
832 "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
833 }]}
834 ]
835 }
836 ]
837 }
838 ```
839
840 - Response:
841 - On failure:
842 - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
843 ```json
844 {
845 "configs": [
846 {
847 "group": ":pleroma",
848 "key": "Pleroma.Upload",
849 "value": [...]
850 }
851 ],
852 "need_reboot": true
853 }
854 ```
855 need_reboot - *optional*, if were changed reboot time settings.
856
857 ## ` GET /api/pleroma/admin/config/descriptions`
858
859 ### Get JSON with config descriptions.
860 Loads json generated from `config/descriptions.exs`.
861
862 - Params: none
863 - Response:
864
865 ```json
866 [{
867 "group": ":pleroma", // string
868 "key": "ModuleName", // string
869 "type": "group", // string or list with possible values,
870 "description": "Upload general settings", // string
871 "children": [
872 {
873 "key": ":uploader", // string or module name `Pleroma.Upload`
874 "type": "module",
875 "description": "Module which will be used for uploads",
876 "suggestions": ["module1", "module2"]
877 },
878 {
879 "key": ":filters",
880 "type": ["list", "module"],
881 "description": "List of filter modules for uploads",
882 "suggestions": [
883 "module1", "module2", "module3"
884 ]
885 }
886 ]
887 }]
888 ```
889
890 ## `GET /api/pleroma/admin/moderation_log`
891
892 ### Get moderation log
893
894 - Params:
895 - *optional* `page`: **integer** page number
896 - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
897 - *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`
898 - *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
899 - *optional* `user_id`: **integer** filter logs by actor's id
900 - *optional* `search`: **string** search logs by the log message
901 - Response:
902
903 ```json
904 [
905 {
906 "data": {
907 "actor": {
908 "id": 1,
909 "nickname": "lain"
910 },
911 "action": "relay_follow"
912 },
913 "time": 1502812026, // timestamp
914 "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
915 }
916 ]
917 ```
918
919 ## `POST /api/pleroma/admin/reload_emoji`
920
921 ### Reload the instance's custom emoji
922
923 - Authentication: required
924 - Params: None
925 - Response: JSON, "ok" and 200 status
926
927 ## `PATCH /api/pleroma/admin/users/confirm_email`
928
929 ### Confirm users' emails
930
931 - Params:
932 - `nicknames`
933 - Response: Array of user nicknames
934
935 ## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
936
937 ### Resend confirmation email
938
939 - Params:
940 - `nicknames`
941 - Response: Array of user nicknames