logo

pleroma

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

admin_api.md (39373B)


  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. {
  971. "id": 1234,
  972. "data": {
  973. "actor": {
  974. "id": 1,
  975. "nickname": "lain"
  976. },
  977. "action": "relay_follow"
  978. },
  979. "time": 1502812026, // timestamp
  980. "message": "[2017-08-15 15:47:06] @nick0 followed relay: https://example.org/relay" // log message
  981. }
  982. ]
  983. ```
  984. ## `POST /api/v1/pleroma/admin/reload_emoji`
  985. ### Reload the instance's custom emoji
  986. - Authentication: required
  987. - Params: None
  988. - Response: JSON, "ok" and 200 status
  989. ## `PATCH /api/v1/pleroma/admin/users/confirm_email`
  990. ### Confirm users' emails
  991. - Params:
  992. - `nicknames`
  993. - Response: Array of user nicknames
  994. ## `PATCH /api/v1/pleroma/admin/users/resend_confirmation_email`
  995. ### Resend confirmation email
  996. - Params:
  997. - `nicknames`
  998. - Response: Array of user nicknames
  999. ## `GET /api/v1/pleroma/admin/stats`
  1000. ### Stats
  1001. - Query Params:
  1002. - *optional* `instance`: **string** instance hostname (without protocol) to get stats for
  1003. - Example: `https://mypleroma.org/api/v1/pleroma/admin/stats?instance=lain.com`
  1004. - Response:
  1005. ```json
  1006. {
  1007. "status_visibility": {
  1008. "direct": 739,
  1009. "private": 9,
  1010. "public": 17,
  1011. "unlisted": 14
  1012. }
  1013. }
  1014. ```
  1015. ## `GET /api/v1/pleroma/admin/oauth_app`
  1016. ### List OAuth app
  1017. - Params:
  1018. - *optional* `name`
  1019. - *optional* `client_id`
  1020. - *optional* `page`
  1021. - *optional* `page_size`
  1022. - *optional* `trusted`
  1023. - Response:
  1024. ```json
  1025. {
  1026. "apps": [
  1027. {
  1028. "id": 1,
  1029. "name": "App name",
  1030. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1031. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1032. "redirect_uri": "https://example.com/oauth-callback",
  1033. "website": "https://example.com",
  1034. "trusted": true
  1035. }
  1036. ],
  1037. "count": 17,
  1038. "page_size": 50
  1039. }
  1040. ```
  1041. ## `POST /api/v1/pleroma/admin/oauth_app`
  1042. ### Create OAuth App
  1043. - Params:
  1044. - `name`
  1045. - `redirect_uris`
  1046. - `scopes`
  1047. - *optional* `website`
  1048. - *optional* `trusted`
  1049. - Response:
  1050. ```json
  1051. {
  1052. "id": 1,
  1053. "name": "App name",
  1054. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1055. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1056. "redirect_uri": "https://example.com/oauth-callback",
  1057. "website": "https://example.com",
  1058. "trusted": true
  1059. }
  1060. ```
  1061. - On failure:
  1062. ```json
  1063. {
  1064. "redirect_uris": "can't be blank",
  1065. "name": "can't be blank"
  1066. }
  1067. ```
  1068. ## `PATCH /api/v1/pleroma/admin/oauth_app/:id`
  1069. ### Update OAuth App
  1070. - Params:
  1071. - *optional* `name`
  1072. - *optional* `redirect_uris`
  1073. - *optional* `scopes`
  1074. - *optional* `website`
  1075. - *optional* `trusted`
  1076. - Response:
  1077. ```json
  1078. {
  1079. "id": 1,
  1080. "name": "App name",
  1081. "client_id": "yHoDSiWYp5mPV6AfsaVOWjdOyt5PhWRiafi6MRd1lSk",
  1082. "client_secret": "nLmis486Vqrv2o65eM9mLQx_m_4gH-Q6PcDpGIMl6FY",
  1083. "redirect_uri": "https://example.com/oauth-callback",
  1084. "website": "https://example.com",
  1085. "trusted": true
  1086. }
  1087. ```
  1088. ## `DELETE /api/v1/pleroma/admin/oauth_app/:id`
  1089. ### Delete OAuth App
  1090. - Params: None
  1091. - Response:
  1092. - On success: `204`, empty response
  1093. - On failure:
  1094. - 400 Bad Request `"Invalid parameters"` when `status` is missing
  1095. ## `GET /api/v1/pleroma/admin/media_proxy_caches`
  1096. ### Get a list of all banned MediaProxy URLs in Cachex
  1097. - Authentication: required
  1098. - Params:
  1099. - *optional* `page`: **integer** page number
  1100. - *optional* `page_size`: **integer** number of log entries per page (default is `50`)
  1101. - *optional* `query`: **string** search term
  1102. - Response:
  1103. ``` json
  1104. {
  1105. "page_size": integer,
  1106. "count": integer,
  1107. "urls": [
  1108. "http://example.com/media/a688346.jpg",
  1109. "http://example.com/media/fb1f4d.jpg"
  1110. ]
  1111. }
  1112. ```
  1113. ## `POST /api/v1/pleroma/admin/media_proxy_caches/delete`
  1114. ### Remove a banned MediaProxy URL from Cachex
  1115. - Authentication: required
  1116. - Params:
  1117. - `urls` (array)
  1118. - Response:
  1119. ``` json
  1120. { }
  1121. ```
  1122. ## `POST /api/v1/pleroma/admin/media_proxy_caches/purge`
  1123. ### Purge a MediaProxy URL
  1124. - Authentication: required
  1125. - Params:
  1126. - `urls` (array)
  1127. - `ban` (boolean)
  1128. - Response:
  1129. ``` json
  1130. { }
  1131. ```
  1132. ## GET /api/v1/pleroma/admin/users/:nickname/chats
  1133. ### List a user's chats
  1134. - Params: None
  1135. - Response:
  1136. ```json
  1137. [
  1138. {
  1139. "sender": {
  1140. "id": "someflakeid",
  1141. "username": "somenick",
  1142. ...
  1143. },
  1144. "receiver": {
  1145. "id": "someflakeid",
  1146. "username": "somenick",
  1147. ...
  1148. },
  1149. "id" : "1",
  1150. "unread" : 2,
  1151. "last_message" : {...}, // The last message in that chat
  1152. "updated_at": "2020-04-21T15:11:46.000Z"
  1153. }
  1154. ]
  1155. ```
  1156. ## GET /api/v1/pleroma/admin/chats/:chat_id
  1157. ### View a single chat
  1158. - Params: None
  1159. - Response:
  1160. ```json
  1161. {
  1162. "sender": {
  1163. "id": "someflakeid",
  1164. "username": "somenick",
  1165. ...
  1166. },
  1167. "receiver": {
  1168. "id": "someflakeid",
  1169. "username": "somenick",
  1170. ...
  1171. },
  1172. "id" : "1",
  1173. "unread" : 2,
  1174. "last_message" : {...}, // The last message in that chat
  1175. "updated_at": "2020-04-21T15:11:46.000Z"
  1176. }
  1177. ```
  1178. ## GET /api/v1/pleroma/admin/chats/:chat_id/messages
  1179. ### List the messages in a chat
  1180. - Params: `max_id`, `min_id`
  1181. - Response:
  1182. ```json
  1183. [
  1184. {
  1185. "account_id": "someflakeid",
  1186. "chat_id": "1",
  1187. "content": "Check this out :firefox:",
  1188. "created_at": "2020-04-21T15:11:46.000Z",
  1189. "emojis": [
  1190. {
  1191. "shortcode": "firefox",
  1192. "static_url": "https://dontbulling.me/emoji/Firefox.gif",
  1193. "url": "https://dontbulling.me/emoji/Firefox.gif",
  1194. "visible_in_picker": false
  1195. }
  1196. ],
  1197. "id": "13",
  1198. "unread": true
  1199. },
  1200. {
  1201. "account_id": "someflakeid",
  1202. "chat_id": "1",
  1203. "content": "Whats' up?",
  1204. "created_at": "2020-04-21T15:06:45.000Z",
  1205. "emojis": [],
  1206. "id": "12",
  1207. "unread": false
  1208. }
  1209. ]
  1210. ```
  1211. ## DELETE /api/v1/pleroma/admin/chats/:chat_id/messages/:message_id
  1212. ### Delete a single message
  1213. - Params: None
  1214. - Response:
  1215. ```json
  1216. {
  1217. "account_id": "someflakeid",
  1218. "chat_id": "1",
  1219. "content": "Check this out :firefox:",
  1220. "created_at": "2020-04-21T15:11:46.000Z",
  1221. "emojis": [
  1222. {
  1223. "shortcode": "firefox",
  1224. "static_url": "https://dontbulling.me/emoji/Firefox.gif",
  1225. "url": "https://dontbulling.me/emoji/Firefox.gif",
  1226. "visible_in_picker": false
  1227. }
  1228. ],
  1229. "id": "13",
  1230. "unread": false
  1231. }
  1232. ```
  1233. ## `GET /api/v1/pleroma/admin/instance_document/:document_name`
  1234. ### Get an instance document
  1235. - Authentication: required
  1236. - Response:
  1237. Returns the content of the document
  1238. ```html
  1239. <h1>Instance panel</h1>
  1240. ```
  1241. ## `PATCH /api/v1/pleroma/admin/instance_document/:document_name`
  1242. - Params:
  1243. - `file` (the file to be uploaded, using multipart form data.)
  1244. ### Update an instance document
  1245. - Authentication: required
  1246. - Response:
  1247. ``` json
  1248. {
  1249. "url": "https://example.com/instance/panel.html"
  1250. }
  1251. ```
  1252. ## `DELETE /api/v1/pleroma/admin/instance_document/:document_name`
  1253. ### Delete an instance document
  1254. - Response:
  1255. ``` json
  1256. {
  1257. "url": "https://example.com/instance/panel.html"
  1258. }
  1259. ```
  1260. ## `GET /api/v1/pleroma/admin/frontends
  1261. ### List available frontends
  1262. - Response:
  1263. ```json
  1264. [
  1265. {
  1266. "build_url": "https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
  1267. "git": "https://git.pleroma.social/pleroma/fedi-fe",
  1268. "installed": true,
  1269. "installed_refs": ["master"],
  1270. "name": "fedi-fe",
  1271. "ref": "master"
  1272. },
  1273. {
  1274. "build_url": "https://git.pleroma.social/lambadalambda/kenoma/-/jobs/artifacts/${ref}/download?job=build",
  1275. "git": "https://git.pleroma.social/lambadalambda/kenoma",
  1276. "installed": false,
  1277. "installed_refs": [],
  1278. "name": "kenoma",
  1279. "ref": "master"
  1280. }
  1281. ]
  1282. ```
  1283. ## `POST /api/v1/pleroma/admin/frontends/install`
  1284. ### Install a frontend
  1285. - Params:
  1286. - `name`: frontend name, required
  1287. - `ref`: frontend ref
  1288. - `file`: path to a frontend zip file
  1289. - `build_url`: build URL
  1290. - `build_dir`: build directory
  1291. - Response:
  1292. ```json
  1293. [
  1294. {
  1295. "build_url": "https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
  1296. "git": "https://git.pleroma.social/pleroma/fedi-fe",
  1297. "installed": true,
  1298. "name": "fedi-fe",
  1299. "ref": "master"
  1300. },
  1301. {
  1302. "build_url": "https://git.pleroma.social/lambadalambda/kenoma/-/jobs/artifacts/${ref}/download?job=build",
  1303. "git": "https://git.pleroma.social/lambadalambda/kenoma",
  1304. "installed": false,
  1305. "name": "kenoma",
  1306. "ref": "master"
  1307. }
  1308. ]
  1309. ```
  1310. ```json
  1311. {
  1312. "error": "Could not install frontend"
  1313. }
  1314. ```
  1315. ## `GET /api/v1/pleroma/admin/announcements`
  1316. ### List announcements
  1317. - Params: `offset`, `limit`
  1318. - Response: JSON, list of announcements
  1319. ```json
  1320. [
  1321. {
  1322. "id": "AHDp0GBdRn1EPN5HN2",
  1323. "content": "some content",
  1324. "starts_at": null,
  1325. "ends_at": null,
  1326. "all_day": false,
  1327. "published_at": "2022-03-09T02:13:05",
  1328. "reactions": [],
  1329. "statuses": [],
  1330. "tags": [],
  1331. "emojis": [],
  1332. "updated_at": "2022-03-09T02:13:05"
  1333. }
  1334. ]
  1335. ```
  1336. Note that this differs from the Mastodon API variant: Mastodon API only returns *active* announcements, while this returns all.
  1337. ## `GET /api/v1/pleroma/admin/announcements/:id`
  1338. ### Display one announcement
  1339. - Response: JSON, one announcement
  1340. ```json
  1341. {
  1342. "id": "AHDp0GBdRn1EPN5HN2",
  1343. "content": "some content",
  1344. "starts_at": null,
  1345. "ends_at": null,
  1346. "all_day": false,
  1347. "published_at": "2022-03-09T02:13:05",
  1348. "reactions": [],
  1349. "statuses": [],
  1350. "tags": [],
  1351. "emojis": [],
  1352. "updated_at": "2022-03-09T02:13:05"
  1353. }
  1354. ```
  1355. ## `POST /api/v1/pleroma/admin/announcements`
  1356. ### Create an announcement
  1357. - Params:
  1358. - `content`: string, required, announcement content
  1359. - `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
  1360. - `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
  1361. - `all_day`: boolean, optional, default to false, tells the client whether to only display dates for `starts_at` and `ends_at`
  1362. - Response: JSON, created announcement
  1363. ```json
  1364. {
  1365. "id": "AHDp0GBdRn1EPN5HN2",
  1366. "content": "some content",
  1367. "starts_at": null,
  1368. "ends_at": null,
  1369. "all_day": false,
  1370. "published_at": "2022-03-09T02:13:05",
  1371. "reactions": [],
  1372. "statuses": [],
  1373. "tags": [],
  1374. "emojis": [],
  1375. "updated_at": "2022-03-09T02:13:05"
  1376. }
  1377. ```
  1378. ## `PATCH /api/v1/pleroma/admin/announcements/:id`
  1379. ### Change an announcement
  1380. - Params: same as `POST /api/v1/pleroma/admin/announcements`, except no param is required.
  1381. - Updates the announcement according to params. Missing params are kept as-is.
  1382. - Response: JSON, updated announcement
  1383. ```json
  1384. {
  1385. "id": "AHDp0GBdRn1EPN5HN2",
  1386. "content": "some content",
  1387. "starts_at": null,
  1388. "ends_at": null,
  1389. "all_day": false,
  1390. "published_at": "2022-03-09T02:13:05",
  1391. "reactions": [],
  1392. "statuses": [],
  1393. "tags": [],
  1394. "emojis": [],
  1395. "updated_at": "2022-03-09T02:13:05"
  1396. }
  1397. ```
  1398. ## `DELETE /api/v1/pleroma/admin/announcements/:id`
  1399. ### Delete an announcement
  1400. - Response: JSON, empty object
  1401. ```json
  1402. {}
  1403. ```