logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

admin_api.md (40241B)


  1. # Admin API
  2. Authentication is required and the user must be an admin.
  3. The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/admin/*` (`/api/pleroma/admin/*` will be deprecated in the future).
  4. ## `GET /api/v1/pleroma/admin/users`
  5. ### List users
  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. - `need_approval`: only unapproved users
  13. - `unconfirmed`: only unconfirmed users
  14. - `deactivated`: only deactivated users
  15. - `is_admin`: users with admin role
  16. - `is_moderator`: users with moderator role
  17. - *optional* `page`: **integer** page number
  18. - *optional* `page_size`: **integer** number of users per page (default is `50`)
  19. - *optional* `tags`: **[string]** tags list
  20. - *optional* `actor_types`: **[string]** actor type list (`Person`, `Service`, `Application`)
  21. - *optional* `name`: **string** user display name
  22. - *optional* `email`: **string** user email
  23. - Example: `https://mypleroma.org/api/v1/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`
  24. - Response:
  25. ```json
  26. {
  27. "page_size": integer,
  28. "count": integer,
  29. "users": [
  30. {
  31. "deactivated": bool,
  32. "id": integer,
  33. "nickname": string,
  34. "roles": {
  35. "admin": bool,
  36. "moderator": bool
  37. },
  38. "local": bool,
  39. "tags": array,
  40. "avatar": string,
  41. "display_name": string,
  42. "confirmation_pending": bool,
  43. "approval_pending": bool,
  44. "registration_reason": string,
  45. },
  46. ...
  47. ]
  48. }
  49. ```
  50. ## DEPRECATED `DELETE /api/v1/pleroma/admin/users`
  51. ### Remove a user
  52. - Params:
  53. - `nickname`
  54. - Response: User’s nickname
  55. ## `DELETE /api/v1/pleroma/admin/users`
  56. ### Remove a user
  57. - Params:
  58. - `nicknames`
  59. - Response: Array of user nicknames
  60. ### Create a user
  61. - Method: `POST`
  62. - Params:
  63. `users`: [
  64. {
  65. `nickname`,
  66. `email`,
  67. `password`
  68. }
  69. ]
  70. - Response: User’s nickname
  71. ## `POST /api/v1/pleroma/admin/users/follow`
  72. ### Make a user follow another user
  73. - Params:
  74. - `follower`: The nickname of the follower
  75. - `followed`: The nickname of the followed
  76. - Response:
  77. - "ok"
  78. ## `POST /api/v1/pleroma/admin/users/unfollow`
  79. ### Make a user unfollow another user
  80. - Params:
  81. - `follower`: The nickname of the follower
  82. - `followed`: The nickname of the followed
  83. - Response:
  84. - "ok"
  85. ## `PATCH /api/v1/pleroma/admin/users/:nickname/toggle_activation`
  86. ### Toggle user activation
  87. - Params:
  88. - `nickname`
  89. - Response: User’s object
  90. ```json
  91. {
  92. "deactivated": bool,
  93. "id": integer,
  94. "nickname": string
  95. }
  96. ```
  97. ## `PUT /api/v1/pleroma/admin/users/tag`
  98. ### Tag a list of users
  99. - Params:
  100. - `nicknames` (array)
  101. - `tags` (array)
  102. ## `DELETE /api/v1/pleroma/admin/users/tag`
  103. ### Untag a list of users
  104. - Params:
  105. - `nicknames` (array)
  106. - `tags` (array)
  107. ## `GET /api/v1/pleroma/admin/users/:nickname/permission_group`
  108. ### Get user user permission groups membership
  109. - Params: none
  110. - Response:
  111. ```json
  112. {
  113. "is_moderator": bool,
  114. "is_admin": bool
  115. }
  116. ```
  117. ## `GET /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
  118. Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
  119. ### Get user user permission groups membership per permission group
  120. - Params: none
  121. - Response:
  122. ```json
  123. {
  124. "is_moderator": bool,
  125. "is_admin": bool
  126. }
  127. ```
  128. ## DEPRECATED `POST /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
  129. ### Add user to permission group
  130. - Params: none
  131. - Response:
  132. - On failure: `{"error": "…"}`
  133. - On success: JSON of the user
  134. ## `POST /api/v1/pleroma/admin/users/permission_group/:permission_group`
  135. ### Add users to permission group
  136. - Params:
  137. - `nicknames`: nicknames array
  138. - Response:
  139. - On failure: `{"error": "…"}`
  140. - On success: JSON of the user
  141. ## DEPRECATED `DELETE /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
  142. ## `DELETE /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
  143. ### Remove user from permission group
  144. - Params: none
  145. - Response:
  146. - On failure: `{"error": "…"}`
  147. - On success: JSON of the user
  148. - Note: An admin cannot revoke their own admin status.
  149. ## `DELETE /api/v1/pleroma/admin/users/permission_group/:permission_group`
  150. ### Remove users from permission group
  151. - Params:
  152. - `nicknames`: nicknames array
  153. - Response:
  154. - On failure: `{"error": "…"}`
  155. - On success: JSON of the user
  156. - Note: An admin cannot revoke their own admin status.
  157. ## `PATCH /api/v1/pleroma/admin/users/activate`
  158. ### Activate user
  159. - Params:
  160. - `nicknames`: nicknames array
  161. - Response:
  162. ```json
  163. {
  164. users: [
  165. {
  166. // user object
  167. }
  168. ]
  169. }
  170. ```
  171. ## `PATCH /api/v1/pleroma/admin/users/deactivate`
  172. ### Deactivate user
  173. - Params:
  174. - `nicknames`: nicknames array
  175. - Response:
  176. ```json
  177. {
  178. users: [
  179. {
  180. // user object
  181. }
  182. ]
  183. }
  184. ```
  185. ## `PATCH /api/v1/pleroma/admin/users/approve`
  186. ### Approve user
  187. - Params:
  188. - `nicknames`: nicknames array
  189. - Response:
  190. ```json
  191. {
  192. users: [
  193. {
  194. // user object
  195. }
  196. ]
  197. }
  198. ```
  199. ## `PATCH /api/v1/pleroma/admin/users/suggest`
  200. ### Suggest a user
  201. Adds the user(s) to follower recommendations.
  202. - Params:
  203. - `nicknames`: nicknames array
  204. - Response:
  205. ```json
  206. {
  207. users: [
  208. {
  209. // user object
  210. }
  211. ]
  212. }
  213. ```
  214. ## `PATCH /api/v1/pleroma/admin/users/unsuggest`
  215. ### Unsuggest a user
  216. Removes the user(s) from follower recommendations.
  217. - Params:
  218. - `nicknames`: nicknames array
  219. - Response:
  220. ```json
  221. {
  222. users: [
  223. {
  224. // user object
  225. }
  226. ]
  227. }
  228. ```
  229. ## `GET /api/v1/pleroma/admin/users/:nickname_or_id`
  230. ### Retrieve the details of a user
  231. - Params:
  232. - `nickname` or `id`
  233. - Response:
  234. - On failure: `Not found`
  235. - On success: JSON of the user
  236. ## `GET /api/v1/pleroma/admin/users/:nickname_or_id/statuses`
  237. ### Retrieve user's latest statuses
  238. - Params:
  239. - `nickname` or `id`
  240. - *optional* `page_size`: number of statuses to return (default is `20`)
  241. - *optional* `godmode`: `true`/`false` – allows to see private statuses
  242. - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
  243. - Response:
  244. - On failure: `Not found`
  245. - On success: JSON, where:
  246. - `total`: total count of the statuses for the user
  247. - `activities`: list of the statuses for the user
  248. ```json
  249. {
  250. "total" : 1,
  251. "activities": [
  252. // activities list
  253. ]
  254. }
  255. ```
  256. ## `GET /api/v1/pleroma/admin/instances/:instance/statuses`
  257. ### Retrieve instance's latest statuses
  258. - Params:
  259. - `instance`: instance name
  260. - *optional* `page_size`: number of statuses to return (default is `20`)
  261. - *optional* `godmode`: `true`/`false` – allows to see private statuses
  262. - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
  263. - Response:
  264. - On failure: `Not found`
  265. - On success: JSON, where:
  266. - `total`: total count of the statuses for the instance
  267. - `activities`: list of the statuses for the instance
  268. ```json
  269. {
  270. "total" : 1,
  271. "activities": [
  272. // activities list
  273. ]
  274. }
  275. ```
  276. ## `DELETE /api/v1/pleroma/admin/instances/:instance`
  277. ### Delete all users and activities from a remote instance
  278. Note: this will trigger a job to remove instance content in the background.
  279. It may take some time.
  280. - Params:
  281. - `instance`: remote instance host
  282. - Response:
  283. - The `instance` name as a string
  284. ```json
  285. "lain.com"
  286. ```
  287. ## `GET /api/v1/pleroma/admin/statuses`
  288. ### Retrieves all latest statuses
  289. - Params:
  290. - *optional* `page_size`: number of statuses to return (default is `20`)
  291. - *optional* `local_only`: excludes remote statuses
  292. - *optional* `godmode`: `true`/`false` – allows to see private statuses
  293. - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
  294. - Response:
  295. - On failure: `Not found`
  296. - On success: JSON array of user's latest statuses
  297. ## `GET /api/v1/pleroma/admin/relay`
  298. ### List Relays
  299. Params: none
  300. Response:
  301. * On success: JSON array of relays
  302. ```json
  303. [
  304. {"actor": "https://example.com/relay", "followed_back": true},
  305. {"actor": "https://example2.com/relay", "followed_back": false}
  306. ]
  307. ```
  308. ## `POST /api/v1/pleroma/admin/relay`
  309. ### Follow a Relay
  310. Params:
  311. * `relay_url`
  312. Response:
  313. * On success: relay json object
  314. ```json
  315. {"actor": "https://example.com/relay", "followed_back": true}
  316. ```
  317. ## `DELETE /api/v1/pleroma/admin/relay`
  318. ### Unfollow a Relay
  319. - Params:
  320. - `relay_url`
  321. - *optional* `force`: forcefully unfollow a relay even when the relay is not available. (default is `false`)
  322. Response:
  323. * On success: URL of the unfollowed relay
  324. ```json
  325. "https://example.com/relay"
  326. ```
  327. ## `POST /api/v1/pleroma/admin/users/invite_token`
  328. ### Create an account registration invite token
  329. - Params:
  330. - *optional* `max_use` (integer)
  331. - *optional* `expires_at` (date string e.g. "2019-04-07")
  332. - Response:
  333. ```json
  334. {
  335. "id": integer,
  336. "token": string,
  337. "used": boolean,
  338. "expires_at": date,
  339. "uses": integer,
  340. "max_use": integer,
  341. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  342. }
  343. ```
  344. ## `GET /api/v1/pleroma/admin/users/invites`
  345. ### Get a list of generated invites
  346. - Params: none
  347. - Response:
  348. ```json
  349. {
  350. "invites": [
  351. {
  352. "id": integer,
  353. "token": string,
  354. "used": boolean,
  355. "expires_at": date,
  356. "uses": integer,
  357. "max_use": integer,
  358. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  359. },
  360. ...
  361. ]
  362. }
  363. ```
  364. ## `POST /api/v1/pleroma/admin/users/revoke_invite`
  365. ### Revoke invite by token
  366. - Params:
  367. - `token`
  368. - Response:
  369. ```json
  370. {
  371. "id": integer,
  372. "token": string,
  373. "used": boolean,
  374. "expires_at": date,
  375. "uses": integer,
  376. "max_use": integer,
  377. "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
  378. }
  379. ```
  380. ## `POST /api/v1/pleroma/admin/users/email_invite`
  381. ### Sends registration invite via email
  382. - Params:
  383. - `email`
  384. - `name`, optional
  385. - Response:
  386. - On success: `204`, empty response
  387. - On failure:
  388. - 400 Bad Request, JSON:
  389. ```json
  390. [
  391. {
  392. "error": "Appropriate error message here"
  393. }
  394. ]
  395. ```
  396. ## `GET /api/v1/pleroma/admin/users/:nickname/password_reset`
  397. ### Get a password reset token for a given nickname
  398. - Params: none
  399. - Response:
  400. ```json
  401. {
  402. "token": "base64 reset token",
  403. "link": "https://pleroma.social/api/v1/pleroma/password_reset/url-encoded-base64-token"
  404. }
  405. ```
  406. ## `PATCH /api/v1/pleroma/admin/users/force_password_reset`
  407. ### Force password reset for a user with a given nickname
  408. - Params:
  409. - `nicknames`
  410. - Response: none (code `204`)
  411. ## PUT `/api/v1/pleroma/admin/users/disable_mfa`
  412. ### Disable mfa for user's account.
  413. - Params:
  414. - `nickname`
  415. - Response: User’s nickname
  416. ## `GET /api/v1/pleroma/admin/users/:nickname/credentials`
  417. ### Get the user's email, password, display and settings-related fields
  418. - Params:
  419. - `nickname`
  420. - Response:
  421. ```json
  422. {
  423. "actor_type": "Person",
  424. "allow_following_move": true,
  425. "avatar": "https://pleroma.social/media/7e8e7508fd545ef580549b6881d80ec0ff2c81ed9ad37b9bdbbdf0e0d030159d.jpg",
  426. "background": "https://pleroma.social/media/4de34c0bd10970d02cbdef8972bef0ebbf55f43cadc449554d4396156162fe9a.jpg",
  427. "banner": "https://pleroma.social/media/8d92ba2bd244b613520abf557dd448adcd30f5587022813ee9dd068945986946.jpg",
  428. "bio": "bio",
  429. "default_scope": "public",
  430. "discoverable": false,
  431. "email": "user@example.com",
  432. "fields": [
  433. {
  434. "name": "example",
  435. "value": "<a href=\"https://example.com\" rel=\"ugc\">https://example.com</a>"
  436. }
  437. ],
  438. "hide_favorites": false,
  439. "hide_followers": false,
  440. "hide_followers_count": false,
  441. "hide_follows": false,
  442. "hide_follows_count": false,
  443. "id": "9oouHaEEUR54hls968",
  444. "locked": true,
  445. "name": "user",
  446. "no_rich_text": true,
  447. "pleroma_settings_store": {},
  448. "raw_fields": [
  449. {
  450. "id": 1,
  451. "name": "example",
  452. "value": "https://example.com"
  453. },
  454. ],
  455. "show_role": true,
  456. "skip_thread_containment": false
  457. }
  458. ```
  459. ## `PATCH /api/v1/pleroma/admin/users/:nickname/credentials`
  460. ### Change the user's email, password, display and settings-related fields
  461. * Params:
  462. * `email`
  463. * `password`
  464. * `name`
  465. * `bio`
  466. * `avatar`
  467. * `locked`
  468. * `no_rich_text`
  469. * `default_scope`
  470. * `banner`
  471. * `hide_follows`
  472. * `hide_followers`
  473. * `hide_followers_count`
  474. * `hide_follows_count`
  475. * `hide_favorites`
  476. * `allow_following_move`
  477. * `background`
  478. * `show_role`
  479. * `skip_thread_containment`
  480. * `fields`
  481. * `is_discoverable`
  482. * `actor_type`
  483. * Responses:
  484. Status: 200
  485. ```json
  486. {"status": "success"}
  487. ```
  488. Status: 400
  489. ```json
  490. {"errors":
  491. {"actor_type": "is invalid"},
  492. {"email": "has invalid format"},
  493. ...
  494. }
  495. ```
  496. Status: 404
  497. ```json
  498. {"error": "Not found"}
  499. ```
  500. ## `GET /api/v1/pleroma/admin/reports`
  501. ### Get a list of reports
  502. - Params:
  503. - *optional* `state`: **string** the state of reports. Valid values are `open`, `closed` and `resolved`
  504. - *optional* `limit`: **integer** the number of records to retrieve
  505. - *optional* `page`: **integer** page number
  506. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  507. - Response:
  508. - On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
  509. - On success: JSON, returns a list of reports, where:
  510. - `account`: the user who has been reported
  511. - `actor`: the user who has sent the report
  512. - `statuses`: list of statuses that have been included to the report
  513. ```json
  514. {
  515. "total" : 1,
  516. "reports": [
  517. {
  518. "account": {
  519. "acct": "user",
  520. "avatar": "https://pleroma.example.org/images/avi.png",
  521. "avatar_static": "https://pleroma.example.org/images/avi.png",
  522. "bot": false,
  523. "created_at": "2019-04-23T17:32:04.000Z",
  524. "display_name": "User",
  525. "emojis": [],
  526. "fields": [],
  527. "followers_count": 1,
  528. "following_count": 1,
  529. "header": "https://pleroma.example.org/images/banner.png",
  530. "header_static": "https://pleroma.example.org/images/banner.png",
  531. "id": "9i6dAJqSGSKMzLG2Lo",
  532. "locked": false,
  533. "note": "",
  534. "pleroma": {
  535. "confirmation_pending": false,
  536. "hide_favorites": true,
  537. "hide_followers": false,
  538. "hide_follows": false,
  539. "is_admin": false,
  540. "is_moderator": false,
  541. "relationship": {},
  542. "tags": []
  543. },
  544. "source": {
  545. "note": "",
  546. "pleroma": {},
  547. "sensitive": false
  548. },
  549. "tags": ["force_unlisted"],
  550. "statuses_count": 3,
  551. "url": "https://pleroma.example.org/users/user",
  552. "username": "user"
  553. },
  554. "actor": {
  555. "acct": "lain",
  556. "avatar": "https://pleroma.example.org/images/avi.png",
  557. "avatar_static": "https://pleroma.example.org/images/avi.png",
  558. "bot": false,
  559. "created_at": "2019-03-28T17:36:03.000Z",
  560. "display_name": "Roger Braun",
  561. "emojis": [],
  562. "fields": [],
  563. "followers_count": 1,
  564. "following_count": 1,
  565. "header": "https://pleroma.example.org/images/banner.png",
  566. "header_static": "https://pleroma.example.org/images/banner.png",
  567. "id": "9hEkA5JsvAdlSrocam",
  568. "locked": false,
  569. "note": "",
  570. "pleroma": {
  571. "confirmation_pending": false,
  572. "hide_favorites": false,
  573. "hide_followers": false,
  574. "hide_follows": false,
  575. "is_admin": false,
  576. "is_moderator": false,
  577. "relationship": {},
  578. "tags": []
  579. },
  580. "source": {
  581. "note": "",
  582. "pleroma": {},
  583. "sensitive": false
  584. },
  585. "tags": ["force_unlisted"],
  586. "statuses_count": 1,
  587. "url": "https://pleroma.example.org/users/lain",
  588. "username": "lain"
  589. },
  590. "content": "Please delete it",
  591. "created_at": "2019-04-29T19:48:15.000Z",
  592. "id": "9iJGOv1j8hxuw19bcm",
  593. "state": "open",
  594. "statuses": [
  595. {
  596. "account": { ... },
  597. "application": {
  598. "name": "Web",
  599. "website": null
  600. },
  601. "bookmarked": false,
  602. "card": null,
  603. "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>",
  604. "created_at": "2019-04-23T19:15:47.000Z",
  605. "emojis": [],
  606. "favourited": false,
  607. "favourites_count": 0,
  608. "id": "9i6mQ9uVrrOmOime8m",
  609. "in_reply_to_account_id": null,
  610. "in_reply_to_id": null,
  611. "language": null,
  612. "media_attachments": [],
  613. "mentions": [
  614. {
  615. "acct": "lain",
  616. "id": "9hEkA5JsvAdlSrocam",
  617. "url": "https://pleroma.example.org/users/lain",
  618. "username": "lain"
  619. },
  620. {
  621. "acct": "user",
  622. "id": "9i6dAJqSGSKMzLG2Lo",
  623. "url": "https://pleroma.example.org/users/user",
  624. "username": "user"
  625. }
  626. ],
  627. "muted": false,
  628. "pinned": false,
  629. "pleroma": {
  630. "content": {
  631. "text/plain": "@lain click on my link https://www.google.com/"
  632. },
  633. "conversation_id": 28,
  634. "in_reply_to_account_acct": null,
  635. "local": true,
  636. "spoiler_text": {
  637. "text/plain": ""
  638. }
  639. },
  640. "reblog": null,
  641. "reblogged": false,
  642. "reblogs_count": 0,
  643. "replies_count": 0,
  644. "sensitive": false,
  645. "spoiler_text": "",
  646. "tags": [],
  647. "uri": "https://pleroma.example.org/objects/8717b90f-8e09-4b58-97b0-e3305472b396",
  648. "url": "https://pleroma.example.org/notice/9i6mQ9uVrrOmOime8m",
  649. "visibility": "direct"
  650. }
  651. ]
  652. }
  653. ]
  654. }
  655. ```
  656. ## `GET /api/v1/pleroma/admin/grouped_reports`
  657. ### Get a list of reports, grouped by status
  658. - Params: none
  659. - On success: JSON, returns a list of reports, where:
  660. - `date`: date of the latest report
  661. - `account`: the user who has been reported (see `/api/v1/pleroma/admin/reports` for reference)
  662. - `status`: reported status (see `/api/v1/pleroma/admin/reports` for reference)
  663. - `actors`: users who had reported this status (see `/api/v1/pleroma/admin/reports` for reference)
  664. - `reports`: reports (see `/api/v1/pleroma/admin/reports` for reference)
  665. ```json
  666. "reports": [
  667. {
  668. "date": "2019-10-07T12:31:39.615149Z",
  669. "account": { ... },
  670. "status": { ... },
  671. "actors": [{ ... }, { ... }],
  672. "reports": [{ ... }]
  673. }
  674. ]
  675. ```
  676. ## `GET /api/v1/pleroma/admin/reports/:id`
  677. ### Get an individual report
  678. - Params:
  679. - `id`
  680. - Response:
  681. - On failure:
  682. - 403 Forbidden `{"error": "error_msg"}`
  683. - 404 Not Found `"Not found"`
  684. - On success: JSON, Report object (see above)
  685. ## `PATCH /api/v1/pleroma/admin/reports`
  686. ### Change the state of one or multiple reports
  687. - Params:
  688. ```json
  689. `reports`: [
  690. {
  691. `id`, // required, report id
  692. `state` // required, the new state. Valid values are `open`, `closed` and `resolved`
  693. },
  694. ...
  695. ]
  696. ```
  697. - Response:
  698. - On failure:
  699. - 400 Bad Request, JSON:
  700. ```json
  701. [
  702. {
  703. `id`, // report id
  704. `error` // error message
  705. }
  706. ]
  707. ```
  708. - On success: `204`, empty response
  709. ## `POST /api/v1/pleroma/admin/reports/:id/notes`
  710. ### Create report note
  711. - Params:
  712. - `id`: required, report id
  713. - `content`: required, the message
  714. - Response:
  715. - On failure:
  716. - 400 Bad Request `"Invalid parameters"` when `status` is missing
  717. - On success: `204`, empty response
  718. ## `DELETE /api/v1/pleroma/admin/reports/:report_id/notes/:id`
  719. ### Delete report note
  720. - Params:
  721. - `report_id`: required, report id
  722. - `id`: required, note id
  723. - Response:
  724. - On failure:
  725. - 400 Bad Request `"Invalid parameters"` when `status` is missing
  726. - On success: `204`, empty response
  727. ## `GET /api/v1/pleroma/admin/statuses/:id`
  728. ### Show status by id
  729. - Params:
  730. - `id`: required, status id
  731. - Response:
  732. - On failure:
  733. - 404 Not Found `"Not Found"`
  734. - On success: JSON, Mastodon Status entity
  735. ## `PUT /api/v1/pleroma/admin/statuses/:id`
  736. ### Change the scope of an individual reported status
  737. - Params:
  738. - `id`
  739. - `sensitive`: optional, valid values are `true` or `false`
  740. - `visibility`: optional, valid values are `public`, `private` and `unlisted`
  741. - Response:
  742. - On failure:
  743. - 400 Bad Request `"Unsupported visibility"`
  744. - 403 Forbidden `{"error": "error_msg"}`
  745. - 404 Not Found `"Not found"`
  746. - On success: JSON, Mastodon Status entity
  747. ## `DELETE /api/v1/pleroma/admin/statuses/:id`
  748. ### Delete an individual reported status
  749. - Params:
  750. - `id`
  751. - Response:
  752. - On failure:
  753. - 403 Forbidden `{"error": "error_msg"}`
  754. - 404 Not Found `"Not found"`
  755. - On success: 200 OK `{}`
  756. ## `GET /api/v1/pleroma/admin/restart`
  757. ### Restarts pleroma application
  758. **Only works when configuration from database is enabled.**
  759. - Params: none
  760. - Response:
  761. - On failure:
  762. - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
  763. ```json
  764. {}
  765. ```
  766. ## `GET /api/v1/pleroma/admin/need_reboot`
  767. ### Returns the flag whether the pleroma should be restarted
  768. - Params: none
  769. - Response:
  770. - `need_reboot` - boolean
  771. ```json
  772. {
  773. "need_reboot": false
  774. }
  775. ```
  776. ## `GET /api/v1/pleroma/admin/config`
  777. ### Get list of merged default settings with saved in database.
  778. *If `need_reboot` is `true`, instance must be restarted, so reboot time settings can take effect.*
  779. **Only works when configuration from database is enabled.**
  780. - Params:
  781. - `only_db`: true (*optional*, get only saved in database settings)
  782. - Response:
  783. - On failure:
  784. - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
  785. ```json
  786. {
  787. "configs": [
  788. {
  789. "group": ":pleroma",
  790. "key": "Pleroma.Upload",
  791. "value": []
  792. }
  793. ],
  794. "need_reboot": true
  795. }
  796. ```
  797. ## `POST /api/v1/pleroma/admin/config`
  798. ### Update config settings
  799. *If `need_reboot` is `true`, instance must be restarted, so reboot time settings can take effect.*
  800. **Only works when configuration from database is enabled.**
  801. Some modifications are necessary to save the config settings correctly:
  802. - strings which start with `Pleroma.`, `Phoenix.`, `Tesla.` or strings like `Oban`, `Ueberauth` will be converted to modules;
  803. ```
  804. "Pleroma.Upload" -> Pleroma.Upload
  805. "Oban" -> Oban
  806. ```
  807. - strings starting with `:` will be converted to atoms;
  808. ```
  809. ":pleroma" -> :pleroma
  810. ```
  811. - objects with `tuple` key and array value will be converted to tuples;
  812. ```
  813. {"tuple": ["string", "Pleroma.Upload", []]} -> {"string", Pleroma.Upload, []}
  814. ```
  815. - arrays with *tuple objects* will be converted to keywords;
  816. ```
  817. [{"tuple": [":key1", "value"]}, {"tuple": [":key2", "value"]}] -> [key1: "value", key2: "value"]
  818. ```
  819. 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:
  820. - all settings inside these keys:
  821. - `:hackney_pools`
  822. - `:connections_pool`
  823. - `:pools`
  824. - `:chat`
  825. - partially settings inside these keys:
  826. - `:seconds_valid` in `Pleroma.Captcha`
  827. - `:proxy_remote` in `Pleroma.Upload`
  828. - `:upload_limit` in `:instance`
  829. - Params:
  830. - `configs` - array of config objects
  831. - config object params:
  832. - `group` - string (**required**)
  833. - `key` - string (**required**)
  834. - `value` - string, [], {} or {"tuple": []} (**required**)
  835. - `delete` - true (*optional*, if setting must be deleted)
  836. - `subkeys` - array of strings (*optional*, only works when `delete=true` parameter is passed, otherwise will be ignored)
  837. *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.*
  838. ```
  839. [subkey: val1, subkey2: val2, subkey3: val3] \\ initial value
  840. {"group": ":pleroma", "key": "some_key", "delete": true, "subkeys": [":subkey", ":subkey3"]} \\ passing json for deletion
  841. [subkey2: val2] \\ value after deletion
  842. ```
  843. *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.*
  844. Example of setting without keyword in value:
  845. ```elixir
  846. config :tesla, :adapter, Tesla.Adapter.Hackney
  847. ```
  848. List of settings which support only full update by key:
  849. ```elixir
  850. @full_key_update [
  851. {:pleroma, :ecto_repos},
  852. {:mime, :types},
  853. {:cors_plug, [:max_age, :methods, :expose, :headers]},
  854. {:auto_linker, :opts},
  855. {:swarm, :node_blacklist},
  856. {:logger, :backends}
  857. ]
  858. ```
  859. List of settings which support only full update by subkey:
  860. ```elixir
  861. @full_subkey_update [
  862. {:pleroma, :assets, :mascots},
  863. {:pleroma, :emoji, :groups},
  864. {:pleroma, :workers, :retries},
  865. {:pleroma, :mrf_subchain, :match_actor},
  866. {:pleroma, :mrf_keyword, :replace}
  867. ]
  868. ```
  869. *Settings without explicit key must be sent in separate config object params.*
  870. ```elixir
  871. config :foo,
  872. bar: :baz,
  873. meta: [:data],
  874. ...
  875. ```
  876. ```json
  877. {
  878. "configs": [
  879. {"group": ":foo", "key": ":bar", "value": ":baz"},
  880. {"group": ":foo", "key": ":meta", "value": [":data"]},
  881. ...
  882. ]
  883. }
  884. ```
  885. - Request:
  886. ```json
  887. {
  888. "configs": [
  889. {
  890. "group": ":pleroma",
  891. "key": "Pleroma.Upload",
  892. "value": [
  893. {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
  894. {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
  895. {"tuple": [":link_name", true]},
  896. {"tuple": [":proxy_remote", false]},
  897. {"tuple": [":proxy_opts", [
  898. {"tuple": [":redirect_on_failure", false]},
  899. {"tuple": [":max_body_length", 1048576]},
  900. {"tuple": [":http", [
  901. {"tuple": [":follow_redirect", true]},
  902. {"tuple": [":pool", ":upload"]},
  903. ]]}
  904. ]
  905. ]},
  906. {"tuple": [":dispatch", {
  907. "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
  908. }]}
  909. ]
  910. }
  911. ]
  912. }
  913. ```
  914. - Response:
  915. - On failure:
  916. - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
  917. ```json
  918. {
  919. "configs": [
  920. {
  921. "group": ":pleroma",
  922. "key": "Pleroma.Upload",
  923. "value": [...]
  924. }
  925. ],
  926. "need_reboot": true
  927. }
  928. ```
  929. ## ` GET /api/v1/pleroma/admin/config/descriptions`
  930. ### Get JSON with config descriptions.
  931. Loads json generated from `config/descriptions.exs`.
  932. - Params: none
  933. - Response:
  934. ```json
  935. [{
  936. "group": ":pleroma", // string
  937. "key": "ModuleName", // string
  938. "type": "group", // string or list with possible values,
  939. "description": "Upload general settings", // string
  940. "children": [
  941. {
  942. "key": ":uploader", // string or module name `Pleroma.Upload`
  943. "type": "module",
  944. "description": "Module which will be used for uploads",
  945. "suggestions": ["module1", "module2"]
  946. },
  947. {
  948. "key": ":filters",
  949. "type": ["list", "module"],
  950. "description": "List of filter modules for uploads",
  951. "suggestions": [
  952. "module1", "module2", "module3"
  953. ]
  954. }
  955. ]
  956. }]
  957. ```
  958. ## `GET /api/v1/pleroma/admin/moderation_log`
  959. ### Get moderation log
  960. - Params:
  961. - *optional* `page`: **integer** page number
  962. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  963. - *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`
  964. - *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
  965. - *optional* `user_id`: **integer** filter logs by actor's id
  966. - *optional* `search`: **string** search logs by the log message
  967. - Response:
  968. ```json
  969. {
  970. "items": [
  971. {
  972. "id": 1234,
  973. "data": {
  974. "actor": {
  975. "id": 1,
  976. "nickname": "lain"
  977. },
  978. "action": "relay_follow"
  979. },
  980. "time": 1502812026, // timestamp
  981. "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
  982. }
  983. ],
  984. "total": 1
  985. }
  986. ```
  987. ## `POST /api/v1/pleroma/admin/reload_emoji`
  988. ### Reload the instance's custom emoji
  989. - Authentication: required
  990. - Params: None
  991. - Response: JSON, "ok" and 200 status
  992. ## `PATCH /api/v1/pleroma/admin/users/confirm_email`
  993. ### Confirm users' emails
  994. - Params:
  995. - `nicknames`
  996. - Response: Array of user nicknames
  997. ## `PATCH /api/v1/pleroma/admin/users/resend_confirmation_email`
  998. ### Resend confirmation email
  999. - Params:
  1000. - `nicknames`
  1001. - Response: Array of user nicknames
  1002. ## `GET /api/v1/pleroma/admin/stats`
  1003. ### Stats
  1004. - Query Params:
  1005. - *optional* `instance`: **string** instance hostname (without protocol) to get stats for
  1006. - Example: `https://mypleroma.org/api/v1/pleroma/admin/stats?instance=lain.com`
  1007. - Response:
  1008. ```json
  1009. {
  1010. "status_visibility": {
  1011. "direct": 739,
  1012. "private": 9,
  1013. "public": 17,
  1014. "unlisted": 14
  1015. }
  1016. }
  1017. ```
  1018. ## `GET /api/v1/pleroma/admin/oauth_app`
  1019. ### List OAuth app
  1020. - Params:
  1021. - *optional* `name`
  1022. - *optional* `client_id`
  1023. - *optional* `page`
  1024. - *optional* `page_size`
  1025. - *optional* `trusted`
  1026. - Response:
  1027. ```json
  1028. {
  1029. "apps": [
  1030. {
  1031. "id": 1,
  1032. "name": "App name",
  1033. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1034. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1035. "redirect_uri": "https://example.com/oauth-callback",
  1036. "website": "https://example.com",
  1037. "trusted": true
  1038. }
  1039. ],
  1040. "count": 17,
  1041. "page_size": 50
  1042. }
  1043. ```
  1044. ## `POST /api/v1/pleroma/admin/oauth_app`
  1045. ### Create OAuth App
  1046. - Params:
  1047. - `name`
  1048. - `redirect_uris`
  1049. - `scopes`
  1050. - *optional* `website`
  1051. - *optional* `trusted`
  1052. - Response:
  1053. ```json
  1054. {
  1055. "id": 1,
  1056. "name": "App name",
  1057. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1058. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1059. "redirect_uri": "https://example.com/oauth-callback",
  1060. "website": "https://example.com",
  1061. "trusted": true
  1062. }
  1063. ```
  1064. - On failure:
  1065. ```json
  1066. {
  1067. "redirect_uris": "can't be blank",
  1068. "name": "can't be blank"
  1069. }
  1070. ```
  1071. ## `PATCH /api/v1/pleroma/admin/oauth_app/:id`
  1072. ### Update OAuth App
  1073. - Params:
  1074. - *optional* `name`
  1075. - *optional* `redirect_uris`
  1076. - *optional* `scopes`
  1077. - *optional* `website`
  1078. - *optional* `trusted`
  1079. - Response:
  1080. ```json
  1081. {
  1082. "id": 1,
  1083. "name": "App name",
  1084. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1085. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1086. "redirect_uri": "https://example.com/oauth-callback",
  1087. "website": "https://example.com",
  1088. "trusted": true
  1089. }
  1090. ```
  1091. ## `DELETE /api/v1/pleroma/admin/oauth_app/:id`
  1092. ### Delete OAuth App
  1093. - Params: None
  1094. - Response:
  1095. - On success: `204`, empty response
  1096. - On failure:
  1097. - 400 Bad Request `"Invalid parameters"` when `status` is missing
  1098. ## `GET /api/v1/pleroma/admin/media_proxy_caches`
  1099. ### Get a list of all banned MediaProxy URLs in Cachex
  1100. - Authentication: required
  1101. - Params:
  1102. - *optional* `page`: **integer** page number
  1103. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  1104. - *optional* `query`: **string** search term
  1105. - Response:
  1106. ``` json
  1107. {
  1108. "page_size": integer,
  1109. "count": integer,
  1110. "urls": [
  1111. "http://example.com/media/a688346.jpg",
  1112. "http://example.com/media/fb1f4d.jpg"
  1113. ]
  1114. }
  1115. ```
  1116. ## `POST /api/v1/pleroma/admin/media_proxy_caches/delete`
  1117. ### Remove a banned MediaProxy URL from Cachex
  1118. - Authentication: required
  1119. - Params:
  1120. - `urls` (array)
  1121. - Response:
  1122. ``` json
  1123. { }
  1124. ```
  1125. ## `POST /api/v1/pleroma/admin/media_proxy_caches/purge`
  1126. ### Purge a MediaProxy URL
  1127. - Authentication: required
  1128. - Params:
  1129. - `urls` (array)
  1130. - `ban` (boolean)
  1131. - Response:
  1132. ``` json
  1133. { }
  1134. ```
  1135. ## GET /api/v1/pleroma/admin/users/:nickname/chats
  1136. ### List a user's chats
  1137. - Params: None
  1138. - Response:
  1139. ```json
  1140. [
  1141. {
  1142. "sender": {
  1143. "id": "someflakeid",
  1144. "username": "somenick",
  1145. ...
  1146. },
  1147. "receiver": {
  1148. "id": "someflakeid",
  1149. "username": "somenick",
  1150. ...
  1151. },
  1152. "id" : "1",
  1153. "unread" : 2,
  1154. "last_message" : {...}, // The last message in that chat
  1155. "updated_at": "2020-04-21T15:11:46.000Z"
  1156. }
  1157. ]
  1158. ```
  1159. ## GET /api/v1/pleroma/admin/chats/:chat_id
  1160. ### View a single chat
  1161. - Params: None
  1162. - Response:
  1163. ```json
  1164. {
  1165. "sender": {
  1166. "id": "someflakeid",
  1167. "username": "somenick",
  1168. ...
  1169. },
  1170. "receiver": {
  1171. "id": "someflakeid",
  1172. "username": "somenick",
  1173. ...
  1174. },
  1175. "id" : "1",
  1176. "unread" : 2,
  1177. "last_message" : {...}, // The last message in that chat
  1178. "updated_at": "2020-04-21T15:11:46.000Z"
  1179. }
  1180. ```
  1181. ## GET /api/v1/pleroma/admin/chats/:chat_id/messages
  1182. ### List the messages in a chat
  1183. - Params: `max_id`, `min_id`
  1184. - Response:
  1185. ```json
  1186. [
  1187. {
  1188. "account_id": "someflakeid",
  1189. "chat_id": "1",
  1190. "content": "Check this out :firefox:",
  1191. "created_at": "2020-04-21T15:11:46.000Z",
  1192. "emojis": [
  1193. {
  1194. "shortcode": "firefox",
  1195. "static_url": "https://dontbulling.me/emoji/Firefox.gif",
  1196. "url": "https://dontbulling.me/emoji/Firefox.gif",
  1197. "visible_in_picker": false
  1198. }
  1199. ],
  1200. "id": "13",
  1201. "unread": true
  1202. },
  1203. {
  1204. "account_id": "someflakeid",
  1205. "chat_id": "1",
  1206. "content": "Whats' up?",
  1207. "created_at": "2020-04-21T15:06:45.000Z",
  1208. "emojis": [],
  1209. "id": "12",
  1210. "unread": false
  1211. }
  1212. ]
  1213. ```
  1214. ## DELETE /api/v1/pleroma/admin/chats/:chat_id/messages/:message_id
  1215. ### Delete a single message
  1216. - Params: None
  1217. - Response:
  1218. ```json
  1219. {
  1220. "account_id": "someflakeid",
  1221. "chat_id": "1",
  1222. "content": "Check this out :firefox:",
  1223. "created_at": "2020-04-21T15:11:46.000Z",
  1224. "emojis": [
  1225. {
  1226. "shortcode": "firefox",
  1227. "static_url": "https://dontbulling.me/emoji/Firefox.gif",
  1228. "url": "https://dontbulling.me/emoji/Firefox.gif",
  1229. "visible_in_picker": false
  1230. }
  1231. ],
  1232. "id": "13",
  1233. "unread": false
  1234. }
  1235. ```
  1236. ## `GET /api/v1/pleroma/admin/instance_document/:document_name`
  1237. ### Get an instance document
  1238. - Authentication: required
  1239. - Response:
  1240. Returns the content of the document
  1241. ```html
  1242. <h1>Instance panel</h1>
  1243. ```
  1244. ## `PATCH /api/v1/pleroma/admin/instance_document/:document_name`
  1245. - Params:
  1246. - `file` (the file to be uploaded, using multipart form data.)
  1247. ### Update an instance document
  1248. - Authentication: required
  1249. - Response:
  1250. ``` json
  1251. {
  1252. "url": "https://example.com/instance/panel.html"
  1253. }
  1254. ```
  1255. ## `DELETE /api/v1/pleroma/admin/instance_document/:document_name`
  1256. ### Delete an instance document
  1257. - Response:
  1258. ``` json
  1259. {
  1260. "url": "https://example.com/instance/panel.html"
  1261. }
  1262. ```
  1263. ## `GET /api/v1/pleroma/admin/frontends
  1264. ### List available frontends
  1265. - Response:
  1266. ```json
  1267. [
  1268. {
  1269. "build_url": "https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
  1270. "git": "https://git.pleroma.social/pleroma/fedi-fe",
  1271. "installed": true,
  1272. "installed_refs": ["master"],
  1273. "name": "fedi-fe",
  1274. "ref": "master"
  1275. },
  1276. {
  1277. "build_url": "https://git.pleroma.social/lambadalambda/kenoma/-/jobs/artifacts/${ref}/download?job=build",
  1278. "git": "https://git.pleroma.social/lambadalambda/kenoma",
  1279. "installed": false,
  1280. "installed_refs": [],
  1281. "name": "kenoma",
  1282. "ref": "master"
  1283. }
  1284. ]
  1285. ```
  1286. ## `POST /api/v1/pleroma/admin/frontends/install`
  1287. ### Install a frontend
  1288. - Params:
  1289. - `name`: frontend name, required
  1290. - `ref`: frontend ref
  1291. - `file`: path to a frontend zip file
  1292. - `build_url`: build URL
  1293. - `build_dir`: build directory
  1294. - Response:
  1295. ```json
  1296. [
  1297. {
  1298. "build_url": "https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
  1299. "git": "https://git.pleroma.social/pleroma/fedi-fe",
  1300. "installed": true,
  1301. "name": "fedi-fe",
  1302. "ref": "master"
  1303. },
  1304. {
  1305. "build_url": "https://git.pleroma.social/lambadalambda/kenoma/-/jobs/artifacts/${ref}/download?job=build",
  1306. "git": "https://git.pleroma.social/lambadalambda/kenoma",
  1307. "installed": false,
  1308. "name": "kenoma",
  1309. "ref": "master"
  1310. }
  1311. ]
  1312. ```
  1313. ```json
  1314. {
  1315. "error": "Could not install frontend"
  1316. }
  1317. ```
  1318. ## `GET /api/v1/pleroma/admin/announcements`
  1319. ### List announcements
  1320. - Params: `offset`, `limit`
  1321. - Response: JSON, list of announcements
  1322. ```json
  1323. [
  1324. {
  1325. "id": "AHDp0GBdRn1EPN5HN2",
  1326. "content": "some content",
  1327. "starts_at": null,
  1328. "ends_at": null,
  1329. "all_day": false,
  1330. "published_at": "2022-03-09T02:13:05",
  1331. "reactions": [],
  1332. "statuses": [],
  1333. "tags": [],
  1334. "emojis": [],
  1335. "updated_at": "2022-03-09T02:13:05"
  1336. }
  1337. ]
  1338. ```
  1339. Note that this differs from the Mastodon API variant: Mastodon API only returns *active* announcements, while this returns all.
  1340. ## `GET /api/v1/pleroma/admin/announcements/:id`
  1341. ### Display one announcement
  1342. - Response: JSON, one announcement
  1343. ```json
  1344. {
  1345. "id": "AHDp0GBdRn1EPN5HN2",
  1346. "content": "some content",
  1347. "starts_at": null,
  1348. "ends_at": null,
  1349. "all_day": false,
  1350. "published_at": "2022-03-09T02:13:05",
  1351. "reactions": [],
  1352. "statuses": [],
  1353. "tags": [],
  1354. "emojis": [],
  1355. "updated_at": "2022-03-09T02:13:05"
  1356. }
  1357. ```
  1358. ## `POST /api/v1/pleroma/admin/announcements`
  1359. ### Create an announcement
  1360. - Params:
  1361. - `content`: string, required, announcement content
  1362. - `starts_at`: datetime, optional, default to null, the time when the announcement will become active (displayed to users); if it is null, the announcement will be active immediately
  1363. - `ends_at`: datetime, optional, default to null, the time when the announcement will become inactive (no longer displayed to users); if it is null, the announcement will be active until an admin deletes it
  1364. - `all_day`: boolean, optional, default to false, tells the client whether to only display dates for `starts_at` and `ends_at`
  1365. - Response: JSON, created announcement
  1366. ```json
  1367. {
  1368. "id": "AHDp0GBdRn1EPN5HN2",
  1369. "content": "some content",
  1370. "starts_at": null,
  1371. "ends_at": null,
  1372. "all_day": false,
  1373. "published_at": "2022-03-09T02:13:05",
  1374. "reactions": [],
  1375. "statuses": [],
  1376. "tags": [],
  1377. "emojis": [],
  1378. "updated_at": "2022-03-09T02:13:05"
  1379. }
  1380. ```
  1381. ## `PATCH /api/v1/pleroma/admin/announcements/:id`
  1382. ### Change an announcement
  1383. - Params: same as `POST /api/v1/pleroma/admin/announcements`, except no param is required.
  1384. - Updates the announcement according to params. Missing params are kept as-is.
  1385. - Response: JSON, updated announcement
  1386. ```json
  1387. {
  1388. "id": "AHDp0GBdRn1EPN5HN2",
  1389. "content": "some content",
  1390. "starts_at": null,
  1391. "ends_at": null,
  1392. "all_day": false,
  1393. "published_at": "2022-03-09T02:13:05",
  1394. "reactions": [],
  1395. "statuses": [],
  1396. "tags": [],
  1397. "emojis": [],
  1398. "updated_at": "2022-03-09T02:13:05"
  1399. }
  1400. ```
  1401. ## `DELETE /api/v1/pleroma/admin/announcements/:id`
  1402. ### Delete an announcement
  1403. - Response: JSON, empty object
  1404. ```json
  1405. {}
  1406. ```
  1407. ## `GET /api/v1/pleroma/admin/rules`
  1408. ### List rules
  1409. - Response: JSON, list of rules
  1410. ```json
  1411. [
  1412. {
  1413. "id": "1",
  1414. "priority": 1,
  1415. "text": "There are no rules",
  1416. "hint": null
  1417. }
  1418. ]
  1419. ```
  1420. ## `POST /api/v1/pleroma/admin/rules`
  1421. ### Create a rule
  1422. - Params:
  1423. - `text`: string, required, rule content
  1424. - `hint`: string, optional, rule description
  1425. - `priority`: integer, optional, rule ordering priority
  1426. - Response: JSON, a single rule
  1427. ## `PATCH /api/v1/pleroma/admin/rules/:id`
  1428. ### Update a rule
  1429. - Params:
  1430. - `text`: string, optional, rule content
  1431. - `hint`: string, optional, rule description
  1432. - `priority`: integer, optional, rule ordering priority
  1433. - Response: JSON, a single rule
  1434. ## `DELETE /api/v1/pleroma/admin/rules/:id`
  1435. ### Delete a rule
  1436. - Response: JSON, empty object
  1437. ```json
  1438. {}
  1439. ```