Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin_api.md 20KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. # Admin API
  2. Authentication is required and the user must be an admin.
  3. ## `/api/pleroma/admin/users`
  4. ### List users
  5. - Method `GET`
  6. - Query Params:
  7. - *optional* `query`: **string** search term (e.g. nickname, domain, nickname@domain)
  8. - *optional* `filters`: **string** comma-separated string of filters:
  9. - `local`: only local users
  10. - `external`: only external users
  11. - `active`: only active users
  12. - `deactivated`: only deactivated users
  13. - `is_admin`: users with admin role
  14. - `is_moderator`: users with moderator role
  15. - *optional* `page`: **integer** page number
  16. - *optional* `page_size`: **integer** number of users per page (default is `50`)
  17. - *optional* `tags`: **[string]** tags list
  18. - *optional* `name`: **string** user display name
  19. - *optional* `email`: **string** user email
  20. - 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`
  21. - Response:
  22. ```json
  23. {
  24. "page_size": integer,
  25. "count": integer,
  26. "users": [
  27. {
  28. "deactivated": bool,
  29. "id": integer,
  30. "nickname": string,
  31. "roles": {
  32. "admin": bool,
  33. "moderator": bool
  34. },
  35. "local": bool,
  36. "tags": array,
  37. "avatar": string,
  38. "display_name": string
  39. },
  40. ...
  41. ]
  42. }
  43. ```
  44. ## DEPRECATED `DELETE /api/pleroma/admin/users`
  45. ### Remove a user
  46. - Method `DELETE`
  47. - Params:
  48. - `nickname`
  49. - Response: User’s nickname
  50. ## `DELETE /api/pleroma/admin/users`
  51. ### Remove a user
  52. - Method `DELETE`
  53. - Params:
  54. - `nicknames`
  55. - Response: Array of user nicknames
  56. ### Create a user
  57. - Method: `POST`
  58. - Params:
  59. `users`: [
  60. {
  61. `nickname`,
  62. `email`,
  63. `password`
  64. }
  65. ]
  66. - Response: User’s nickname
  67. ## `/api/pleroma/admin/users/follow`
  68. ### Make a user follow another user
  69. - Methods: `POST`
  70. - Params:
  71. - `follower`: The nickname of the follower
  72. - `followed`: The nickname of the followed
  73. - Response:
  74. - "ok"
  75. ## `/api/pleroma/admin/users/unfollow`
  76. ### Make a user unfollow another user
  77. - Methods: `POST`
  78. - Params:
  79. - `follower`: The nickname of the follower
  80. - `followed`: The nickname of the followed
  81. - Response:
  82. - "ok"
  83. ## `/api/pleroma/admin/users/:nickname/toggle_activation`
  84. ### Toggle user activation
  85. - Method: `PATCH`
  86. - Params:
  87. - `nickname`
  88. - Response: User’s object
  89. ```json
  90. {
  91. "deactivated": bool,
  92. "id": integer,
  93. "nickname": string
  94. }
  95. ```
  96. ## `/api/pleroma/admin/users/tag`
  97. ### Tag a list of users
  98. - Method: `PUT`
  99. - Params:
  100. - `nicknames` (array)
  101. - `tags` (array)
  102. ### Untag a list of users
  103. - Method: `DELETE`
  104. - Params:
  105. - `nicknames` (array)
  106. - `tags` (array)
  107. ## `/api/pleroma/admin/users/:nickname/permission_group`
  108. ### Get user user permission groups membership
  109. - Method: `GET`
  110. - Params: none
  111. - Response:
  112. ```json
  113. {
  114. "is_moderator": bool,
  115. "is_admin": bool
  116. }
  117. ```
  118. ## `/api/pleroma/admin/users/:nickname/permission_group/:permission_group`
  119. Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
  120. ### Get user user permission groups membership per permission group
  121. - Method: `GET`
  122. - Params: none
  123. - Response:
  124. ```json
  125. {
  126. "is_moderator": bool,
  127. "is_admin": bool
  128. }
  129. ```
  130. ## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
  131. ### Add user to permission group
  132. - Params: none
  133. - Response:
  134. - On failure: `{"error": "…"}`
  135. - On success: JSON of the user
  136. ## `POST /api/pleroma/admin/users/permission_group/:permission_group`
  137. ### Add users to permission group
  138. - Params:
  139. - `nicknames`: nicknames array
  140. - Response:
  141. - On failure: `{"error": "…"}`
  142. - On success: JSON of the user
  143. ## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
  144. ### Remove user from permission group
  145. - Params: none
  146. - Response:
  147. - On failure: `{"error": "…"}`
  148. - On success: JSON of the user
  149. - Note: An admin cannot revoke their own admin status.
  150. ## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
  151. ### Remove users from permission group
  152. - Params:
  153. - `nicknames`: nicknames array
  154. - Response:
  155. - On failure: `{"error": "…"}`
  156. - On success: JSON of the user
  157. - Note: An admin cannot revoke their own admin status.
  158. ## `PATCH /api/pleroma/admin/users/activate`
  159. ### Activate user
  160. - Params:
  161. - `nicknames`: nicknames array
  162. - Response:
  163. ```json
  164. {
  165. users: [
  166. {
  167. // user object
  168. }
  169. ]
  170. }
  171. ```
  172. ## `PATCH /api/pleroma/admin/users/deactivate`
  173. ### Deactivate user
  174. - Params:
  175. - `nicknames`: nicknames array
  176. - Response:
  177. ```json
  178. {
  179. users: [
  180. {
  181. // user object
  182. }
  183. ]
  184. }
  185. ```
  186. ## DEPRECATED `PATCH /api/pleroma/admin/users/:nickname/activation_status`
  187. ### Active or deactivate a user
  188. - Params:
  189. - `nickname`
  190. - `status` BOOLEAN field, false value means deactivation.
  191. ## `/api/pleroma/admin/users/:nickname_or_id`
  192. ### Retrive the details of a user
  193. - Method: `GET`
  194. - Params:
  195. - `nickname` or `id`
  196. - Response:
  197. - On failure: `Not found`
  198. - On success: JSON of the user
  199. ## `/api/pleroma/admin/users/:nickname_or_id/statuses`
  200. ### Retrive user's latest statuses
  201. - Method: `GET`
  202. - Params:
  203. - `nickname` or `id`
  204. - *optional* `page_size`: number of statuses to return (default is `20`)
  205. - *optional* `godmode`: `true`/`false` – allows to see private statuses
  206. - Response:
  207. - On failure: `Not found`
  208. - On success: JSON array of user's latest statuses
  209. ## `/api/pleroma/admin/relay`
  210. ### Follow a Relay
  211. - Methods: `POST`
  212. - Params:
  213. - `relay_url`
  214. - Response:
  215. - On success: URL of the followed relay
  216. ### Unfollow a Relay
  217. - Methods: `DELETE`
  218. - Params:
  219. - `relay_url`
  220. - Response:
  221. - On success: URL of the unfollowed relay
  222. ## `GET /api/pleroma/admin/relay`
  223. ### List Relays
  224. - Params: none
  225. - Response:
  226. - On success: JSON array of relays
  227. ## `/api/pleroma/admin/users/invite_token`
  228. ### Create an account registration invite token
  229. - Methods: `POST`
  230. - Params:
  231. - *optional* `max_use` (integer)
  232. - *optional* `expires_at` (date string e.g. "2019-04-07")
  233. - Response:
  234. ```json
  235. {
  236. "id": integer,
  237. "token": string,
  238. "used": boolean,
  239. "expires_at": date,
  240. "uses": integer,
  241. "max_use": integer,
  242. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  243. }
  244. ```
  245. ## `/api/pleroma/admin/users/invites`
  246. ### Get a list of generated invites
  247. - Methods: `GET`
  248. - Params: none
  249. - Response:
  250. ```json
  251. {
  252. "invites": [
  253. {
  254. "id": integer,
  255. "token": string,
  256. "used": boolean,
  257. "expires_at": date,
  258. "uses": integer,
  259. "max_use": integer,
  260. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  261. },
  262. ...
  263. ]
  264. }
  265. ```
  266. ## `/api/pleroma/admin/users/revoke_invite`
  267. ### Revoke invite by token
  268. - Methods: `POST`
  269. - Params:
  270. - `token`
  271. - Response:
  272. ```json
  273. {
  274. "id": integer,
  275. "token": string,
  276. "used": boolean,
  277. "expires_at": date,
  278. "uses": integer,
  279. "max_use": integer,
  280. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  281. }
  282. ```
  283. ## `/api/pleroma/admin/users/email_invite`
  284. ### Sends registration invite via email
  285. - Methods: `POST`
  286. - Params:
  287. - `email`
  288. - `name`, optional
  289. ## `/api/pleroma/admin/users/:nickname/password_reset`
  290. ### Get a password reset token for a given nickname
  291. - Methods: `GET`
  292. - Params: none
  293. - Response:
  294. ```json
  295. {
  296. "token": "base64 reset token",
  297. "link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
  298. }
  299. ```
  300. ## `/api/pleroma/admin/users/:nickname/force_password_reset`
  301. ### Force passord reset for a user with a given nickname
  302. - Methods: `PATCH`
  303. - Params: none
  304. - Response: none (code `204`)
  305. ## `/api/pleroma/admin/reports`
  306. ### Get a list of reports
  307. - Method `GET`
  308. - Params:
  309. - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
  310. - *optional* `limit`: **integer** the number of records to retrieve
  311. - *optional* `page`: **integer** page number
  312. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  313. - Response:
  314. - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
  315. - On success: JSON, returns a list of reports, where:
  316. - `account`: the user who has been reported
  317. - `actor`: the user who has sent the report
  318. - `statuses`: list of statuses that have been included to the report
  319. ```json
  320. {
  321. "total" : 1,
  322. "reports": [
  323. {
  324. "account": {
  325. "acct": "user",
  326. "avatar": "https://pleroma.example.org/images/avi.png",
  327. "avatar_static": "https://pleroma.example.org/images/avi.png",
  328. "bot": false,
  329. "created_at": "2019-04-23T17:32:04.000Z",
  330. "display_name": "User",
  331. "emojis": [],
  332. "fields": [],
  333. "followers_count": 1,
  334. "following_count": 1,
  335. "header": "https://pleroma.example.org/images/banner.png",
  336. "header_static": "https://pleroma.example.org/images/banner.png",
  337. "id": "9i6dAJqSGSKMzLG2Lo",
  338. "locked": false,
  339. "note": "",
  340. "pleroma": {
  341. "confirmation_pending": false,
  342. "hide_favorites": true,
  343. "hide_followers": false,
  344. "hide_follows": false,
  345. "is_admin": false,
  346. "is_moderator": false,
  347. "relationship": {},
  348. "tags": []
  349. },
  350. "source": {
  351. "note": "",
  352. "pleroma": {},
  353. "sensitive": false
  354. },
  355. "tags": ["force_unlisted"],
  356. "statuses_count": 3,
  357. "url": "https://pleroma.example.org/users/user",
  358. "username": "user"
  359. },
  360. "actor": {
  361. "acct": "lain",
  362. "avatar": "https://pleroma.example.org/images/avi.png",
  363. "avatar_static": "https://pleroma.example.org/images/avi.png",
  364. "bot": false,
  365. "created_at": "2019-03-28T17:36:03.000Z",
  366. "display_name": "Roger Braun",
  367. "emojis": [],
  368. "fields": [],
  369. "followers_count": 1,
  370. "following_count": 1,
  371. "header": "https://pleroma.example.org/images/banner.png",
  372. "header_static": "https://pleroma.example.org/images/banner.png",
  373. "id": "9hEkA5JsvAdlSrocam",
  374. "locked": false,
  375. "note": "",
  376. "pleroma": {
  377. "confirmation_pending": false,
  378. "hide_favorites": false,
  379. "hide_followers": false,
  380. "hide_follows": false,
  381. "is_admin": false,
  382. "is_moderator": false,
  383. "relationship": {},
  384. "tags": []
  385. },
  386. "source": {
  387. "note": "",
  388. "pleroma": {},
  389. "sensitive": false
  390. },
  391. "tags": ["force_unlisted"],
  392. "statuses_count": 1,
  393. "url": "https://pleroma.example.org/users/lain",
  394. "username": "lain"
  395. },
  396. "content": "Please delete it",
  397. "created_at": "2019-04-29T19:48:15.000Z",
  398. "id": "9iJGOv1j8hxuw19bcm",
  399. "state": "open",
  400. "statuses": [
  401. {
  402. "account": { ... },
  403. "application": {
  404. "name": "Web",
  405. "website": null
  406. },
  407. "bookmarked": false,
  408. "card": null,
  409. "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>",
  410. "created_at": "2019-04-23T19:15:47.000Z",
  411. "emojis": [],
  412. "favourited": false,
  413. "favourites_count": 0,
  414. "id": "9i6mQ9uVrrOmOime8m",
  415. "in_reply_to_account_id": null,
  416. "in_reply_to_id": null,
  417. "language": null,
  418. "media_attachments": [],
  419. "mentions": [
  420. {
  421. "acct": "lain",
  422. "id": "9hEkA5JsvAdlSrocam",
  423. "url": "https://pleroma.example.org/users/lain",
  424. "username": "lain"
  425. },
  426. {
  427. "acct": "user",
  428. "id": "9i6dAJqSGSKMzLG2Lo",
  429. "url": "https://pleroma.example.org/users/user",
  430. "username": "user"
  431. }
  432. ],
  433. "muted": false,
  434. "pinned": false,
  435. "pleroma": {
  436. "content": {
  437. "text/plain": "@lain click on my link https://www.google.com/"
  438. },
  439. "conversation_id": 28,
  440. "in_reply_to_account_acct": null,
  441. "local": true,
  442. "spoiler_text": {
  443. "text/plain": ""
  444. }
  445. },
  446. "reblog": null,
  447. "reblogged": false,
  448. "reblogs_count": 0,
  449. "replies_count": 0,
  450. "sensitive": false,
  451. "spoiler_text": "",
  452. "tags": [],
  453. "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
  454. "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
  455. "visibility": "direct"
  456. }
  457. ]
  458. }
  459. ]
  460. }
  461. ```
  462. ## `/api/pleroma/admin/reports/:id`
  463. ### Get an individual report
  464. - Method `GET`
  465. - Params:
  466. - `id`
  467. - Response:
  468. - On failure:
  469. - 403 Forbidden `{"error": "error_msg"}`
  470. - 404 Not Found `"Not found"`
  471. - On success: JSON, Report object (see above)
  472. ## `/api/pleroma/admin/reports/:id`
  473. ### Change the state of the report
  474. - Method `PUT`
  475. - Params:
  476. - `id`
  477. - `state`: required, the new state. Valid values are `open`, `closed` and `resolved`
  478. - Response:
  479. - On failure:
  480. - 400 Bad Request `"Unsupported state"`
  481. - 403 Forbidden `{"error": "error_msg"}`
  482. - 404 Not Found `"Not found"`
  483. - On success: JSON, Report object (see above)
  484. ## `/api/pleroma/admin/reports/:id/respond`
  485. ### Respond to a report
  486. - Method `POST`
  487. - Params:
  488. - `id`
  489. - `status`: required, the message
  490. - Response:
  491. - On failure:
  492. - 400 Bad Request `"Invalid parameters"` when `status` is missing
  493. - 403 Forbidden `{"error": "error_msg"}`
  494. - 404 Not Found `"Not found"`
  495. - On success: JSON, created Mastodon Status entity
  496. ```json
  497. {
  498. "account": { ... },
  499. "application": {
  500. "name": "Web",
  501. "website": null
  502. },
  503. "bookmarked": false,
  504. "card": null,
  505. "content": "Your claim is going to be closed",
  506. "created_at": "2019-05-11T17:13:03.000Z",
  507. "emojis": [],
  508. "favourited": false,
  509. "favourites_count": 0,
  510. "id": "9ihuiSL1405I65TmEq",
  511. "in_reply_to_account_id": null,
  512. "in_reply_to_id": null,
  513. "language": null,
  514. "media_attachments": [],
  515. "mentions": [
  516. {
  517. "acct": "user",
  518. "id": "9i6dAJqSGSKMzLG2Lo",
  519. "url": "https://pleroma.example.org/users/user",
  520. "username": "user"
  521. },
  522. {
  523. "acct": "admin",
  524. "id": "9hEkA5JsvAdlSrocam",
  525. "url": "https://pleroma.example.org/users/admin",
  526. "username": "admin"
  527. }
  528. ],
  529. "muted": false,
  530. "pinned": false,
  531. "pleroma": {
  532. "content": {
  533. "text/plain": "Your claim is going to be closed"
  534. },
  535. "conversation_id": 35,
  536. "in_reply_to_account_acct": null,
  537. "local": true,
  538. "spoiler_text": {
  539. "text/plain": ""
  540. }
  541. },
  542. "reblog": null,
  543. "reblogged": false,
  544. "reblogs_count": 0,
  545. "replies_count": 0,
  546. "sensitive": false,
  547. "spoiler_text": "",
  548. "tags": [],
  549. "uri": "https://pleroma.example.org/objects/cab0836d-9814-46cd-a0ea-529da9db5fcb",
  550. "url": "https://pleroma.example.org/notice/9ihuiSL1405I65TmEq",
  551. "visibility": "direct"
  552. }
  553. ```
  554. ## `/api/pleroma/admin/statuses/:id`
  555. ### Change the scope of an individual reported status
  556. - Method `PUT`
  557. - Params:
  558. - `id`
  559. - `sensitive`: optional, valid values are `true` or `false`
  560. - `visibility`: optional, valid values are `public`, `private` and `unlisted`
  561. - Response:
  562. - On failure:
  563. - 400 Bad Request `"Unsupported visibility"`
  564. - 403 Forbidden `{"error": "error_msg"}`
  565. - 404 Not Found `"Not found"`
  566. - On success: JSON, Mastodon Status entity
  567. ## `/api/pleroma/admin/statuses/:id`
  568. ### Delete an individual reported status
  569. - Method `DELETE`
  570. - Params:
  571. - `id`
  572. - Response:
  573. - On failure:
  574. - 403 Forbidden `{"error": "error_msg"}`
  575. - 404 Not Found `"Not found"`
  576. - On success: 200 OK `{}`
  577. ## `/api/pleroma/admin/config/migrate_to_db`
  578. ### Run mix task pleroma.config migrate_to_db
  579. Copy settings on key `:pleroma` to DB.
  580. - Method `GET`
  581. - Params: none
  582. - Response:
  583. ```json
  584. {}
  585. ```
  586. ## `/api/pleroma/admin/config/migrate_from_db`
  587. ### Run mix task pleroma.config migrate_from_db
  588. Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
  589. - Method `GET`
  590. - Params: none
  591. - Response:
  592. ```json
  593. {}
  594. ```
  595. ## `/api/pleroma/admin/config`
  596. ### List config settings
  597. List config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
  598. - Method `GET`
  599. - Params: none
  600. - Response:
  601. ```json
  602. {
  603. configs: [
  604. {
  605. "group": string,
  606. "key": string or string with leading `:` for atoms,
  607. "value": string or {} or [] or {"tuple": []}
  608. }
  609. ]
  610. }
  611. ```
  612. ## `/api/pleroma/admin/config`
  613. ### Update config settings
  614. Updating config settings only works with `:pleroma => :instance => :dynamic_configuration` setting to `true`.
  615. Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
  616. Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
  617. Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
  618. `{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
  619. Keywords can be passed as lists with 2 child tuples, e.g.
  620. `[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
  621. 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.:
  622. {"group": "pleroma", "key": "some_key", "delete": "true", "subkeys": [":subkey", ":subkey3"]}.
  623. Compile time settings (need instance reboot):
  624. - all settings by this keys:
  625. - `:hackney_pools`
  626. - `:chat`
  627. - `Pleroma.Web.Endpoint`
  628. - `Pleroma.Repo`
  629. - part settings:
  630. - `Pleroma.Captcha` -> `:seconds_valid`
  631. - `Pleroma.Upload` -> `:proxy_remote`
  632. - `:instance` -> `:upload_limit`
  633. - Method `POST`
  634. - Params:
  635. - `configs` => [
  636. - `group` (string)
  637. - `key` (string or string with leading `:` for atoms)
  638. - `value` (string, [], {} or {"tuple": []})
  639. - `delete` = true (optional, if parameter must be deleted)
  640. - `subkeys` [(string with leading `:` for atoms)] (optional, works only if `delete=true` parameter is passed, otherwise will be ignored)
  641. ]
  642. - Request (example):
  643. ```json
  644. {
  645. configs: [
  646. {
  647. "group": "pleroma",
  648. "key": "Pleroma.Upload",
  649. "value": [
  650. {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
  651. {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
  652. {"tuple": [":link_name", true]},
  653. {"tuple": [":proxy_remote", false]},
  654. {"tuple": [":proxy_opts", [
  655. {"tuple": [":redirect_on_failure", false]},
  656. {"tuple": [":max_body_length", 1048576]},
  657. {"tuple": [":http": [
  658. {"tuple": [":follow_redirect", true]},
  659. {"tuple": [":pool", ":upload"]},
  660. ]]}
  661. ]
  662. ]},
  663. {"tuple": [":dispatch", {
  664. "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
  665. }]}
  666. ]
  667. }
  668. ]
  669. }
  670. ```
  671. - Response:
  672. ```json
  673. {
  674. configs: [
  675. {
  676. "group": string,
  677. "key": string or string with leading `:` for atoms,
  678. "value": string or {} or [] or {"tuple": []}
  679. }
  680. ]
  681. }
  682. ```
  683. ## `/api/pleroma/admin/moderation_log`
  684. ### Get moderation log
  685. - Method `GET`
  686. - Params:
  687. - *optional* `page`: **integer** page number
  688. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  689. - *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`
  690. - *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
  691. - *optional* `user_id`: **integer** filter logs by actor's id
  692. - *optional* `search`: **string** search logs by the log message
  693. - Response:
  694. ```json
  695. [
  696. {
  697. "data": {
  698. "actor": {
  699. "id": 1,
  700. "nickname": "lain"
  701. },
  702. "action": "relay_follow"
  703. },
  704. "time": 1502812026, // timestamp
  705. "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
  706. }
  707. ]
  708. ```
  709. ## `POST /api/pleroma/admin/reload_emoji`
  710. ### Reload the instance's custom emoji
  711. * Method `POST`
  712. * Authentication: required
  713. * Params: None
  714. * Response: JSON, "ok" and 200 status