logo

pleroma

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

pleroma_api.md (25796B)


  1. # Pleroma API
  2. Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization).
  3. Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`.
  4. The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/api/pleroma/*` will be deprecated in the future).
  5. ## `/api/v1/pleroma/emoji`
  6. ### Lists the custom emoji on that server.
  7. * Method: `GET`
  8. * Authentication: not required
  9. * Params: none
  10. * Response: JSON
  11. * Example response:
  12. ```json
  13. {
  14. "girlpower": {
  15. "tags": [
  16. "Finmoji"
  17. ],
  18. "image_url": "/finmoji/128px/girlpower-128.png"
  19. },
  20. "education": {
  21. "tags": [
  22. "Finmoji"
  23. ],
  24. "image_url": "/finmoji/128px/education-128.png"
  25. },
  26. "finnishlove": {
  27. "tags": [
  28. "Finmoji"
  29. ],
  30. "image_url": "/finmoji/128px/finnishlove-128.png"
  31. }
  32. }
  33. ```
  34. * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format
  35. ## `/api/pleroma/follow_import`
  36. ### Imports your follows, for example from a Mastodon CSV file.
  37. * Method: `POST`
  38. * Authentication: required
  39. * Params:
  40. * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow
  41. * Response: HTTP 200 on success, 500 on error
  42. * Note: Users that can't be followed are silently skipped.
  43. ## `/api/pleroma/blocks_import`
  44. ### Imports your blocks.
  45. * Method: `POST`
  46. * Authentication: required
  47. * Params:
  48. * `list`: STRING or FILE containing a whitespace-separated list of accounts to block
  49. * Response: HTTP 200 on success, 500 on error
  50. ## `/api/pleroma/mutes_import`
  51. ### Imports your mutes.
  52. * Method: `POST`
  53. * Authentication: required
  54. * Params:
  55. * `list`: STRING or FILE containing a whitespace-separated list of accounts to mute
  56. * Response: HTTP 200 on success, 500 on error
  57. ## `/api/v1/pleroma/captcha`
  58. ### Get a new captcha
  59. * Method: `GET`
  60. * Authentication: not required
  61. * Params: none
  62. * Response: Provider specific JSON, the only guaranteed parameter is `type`
  63. * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint", "seconds_valid": 300}`
  64. ## `/api/pleroma/delete_account`
  65. ### Delete an account
  66. * Method `POST`
  67. * Authentication: required
  68. * Params:
  69. * `password`: user's password
  70. * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise
  71. * Example response: `{"error": "Invalid password."}`
  72. ## `/api/pleroma/disable_account`
  73. ### Disable an account
  74. * Method `POST`
  75. * Authentication: required
  76. * Params:
  77. * `password`: user's password
  78. * Response: JSON. Returns `{"status": "success"}` if the account was successfully disabled, `{"error": "[error message]"}` otherwise
  79. * Example response: `{"error": "Invalid password."}`
  80. ## `/api/pleroma/accounts/mfa`
  81. #### Gets current MFA settings
  82. * method: `GET`
  83. * Authentication: required
  84. * OAuth scope: `read:security`
  85. * Response: JSON. Returns `{"settings": {"enabled": "false", "totp": false }}`
  86. * Note: `enabled` is whether multi-factor auth is enabled for the user in general, while `totp` is one type of MFA.
  87. ## `/api/pleroma/accounts/mfa/setup/totp`
  88. #### Pre-setup the MFA/TOTP method
  89. * method: `GET`
  90. * Authentication: required
  91. * OAuth scope: `write:security`
  92. * Response: JSON. Returns `{"key": [secret_key], "provisioning_uri": "[qr code uri]" }` when successful, otherwise returns HTTP 422 `{"error": "error_msg"}`
  93. ## `/api/pleroma/accounts/mfa/confirm/totp`
  94. #### Confirms & enables MFA/TOTP support for user account.
  95. * method: `POST`
  96. * Authentication: required
  97. * OAuth scope: `write:security`
  98. * Params:
  99. * `password`: user's password
  100. * `code`: token from TOTP App
  101. * Response: JSON. Returns `{}` if the enable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
  102. ## `/api/pleroma/accounts/mfa/totp`
  103. #### Disables MFA/TOTP method for user account.
  104. * method: `DELETE`
  105. * Authentication: required
  106. * OAuth scope: `write:security`
  107. * Params:
  108. * `password`: user's password
  109. * Response: JSON. Returns `{}` if the disable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
  110. * Example response: `{"error": "Invalid password."}`
  111. ## `/api/pleroma/accounts/mfa/backup_codes`
  112. #### Generstes backup codes MFA for user account.
  113. * method: `GET`
  114. * Authentication: required
  115. * OAuth scope: `write:security`
  116. * Response: JSON. Returns `{"codes": codes}` when successful, otherwise HTTP 422 `{"error": "[error message]"}`
  117. ## `/api/v1/pleroma/admin/`
  118. See [Admin-API](admin_api.md)
  119. ## `/api/v1/pleroma/notifications/read`
  120. ### Mark notifications as read
  121. * Method `POST`
  122. * Authentication: required
  123. * Params (mutually exclusive):
  124. * `id`: a single notification id to read
  125. * `max_id`: read all notifications up to this id
  126. * Response: Notification entity/Array of Notification entities that were read. In case of `max_id`, only the first 80 read notifications will be returned.
  127. ## `/api/v1/pleroma/accounts/:id/subscribe`
  128. ### Subscribe to receive notifications for all statuses posted by a user
  129. * Method `POST`
  130. * Authentication: required
  131. * Params:
  132. * `id`: account id to subscribe to
  133. * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
  134. * Example response:
  135. ```json
  136. {
  137. "id": "abcdefg",
  138. "following": true,
  139. "followed_by": false,
  140. "blocking": false,
  141. "muting": false,
  142. "muting_notifications": false,
  143. "subscribing": true,
  144. "notifying": true,
  145. "requested": false,
  146. "domain_blocking": false,
  147. "showing_reblogs": true,
  148. "endorsed": false,
  149. "note": ""
  150. }
  151. ```
  152. ## `/api/v1/pleroma/accounts/:id/unsubscribe`
  153. ### Unsubscribe to stop receiving notifications from user statuses
  154. * Method `POST`
  155. * Authentication: required
  156. * Params:
  157. * `id`: account id to unsubscribe from
  158. * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
  159. * Example response:
  160. ```json
  161. {
  162. "id": "abcdefg",
  163. "following": true,
  164. "followed_by": false,
  165. "blocking": false,
  166. "muting": false,
  167. "muting_notifications": false,
  168. "subscribing": false,
  169. "notifying": false,
  170. "requested": false,
  171. "domain_blocking": false,
  172. "showing_reblogs": true,
  173. "endorsed": false,
  174. "note": ""
  175. }
  176. ```
  177. ## `/api/v1/pleroma/accounts/:id/favourites`
  178. ### Returns favorites timeline of any user
  179. * Method `GET`
  180. * Authentication: not required
  181. * Params:
  182. * `id`: the id of the account for whom to return results
  183. * `limit`: optional, the number of records to retrieve
  184. * `since_id`: optional, returns results that are more recent than the specified id
  185. * `max_id`: optional, returns results that are older than the specified id
  186. * Response: JSON, returns a list of Mastodon Status entities on success, otherwise returns `{"error": "error_msg"}`
  187. * Example response:
  188. ```json
  189. [
  190. {
  191. "account": {
  192. "id": "9hptFmUF3ztxYh3Svg",
  193. "url": "https://pleroma.example.org/users/nick2",
  194. "username": "nick2",
  195. ...
  196. },
  197. "application": {"name": "Web", "website": null},
  198. "bookmarked": false,
  199. "card": null,
  200. "content": "This is :moominmamma: note 0",
  201. "created_at": "2019-04-15T15:42:15.000Z",
  202. "emojis": [],
  203. "favourited": false,
  204. "favourites_count": 1,
  205. "id": "9hptFmVJ02khbzYJaS",
  206. "in_reply_to_account_id": null,
  207. "in_reply_to_id": null,
  208. "language": null,
  209. "media_attachments": [],
  210. "mentions": [],
  211. "muted": false,
  212. "pinned": false,
  213. "pleroma": {
  214. "content": {"text/plain": "This is :moominmamma: note 0"},
  215. "conversation_id": 13679,
  216. "local": true,
  217. "spoiler_text": {"text/plain": "2hu"}
  218. },
  219. "reblog": null,
  220. "reblogged": false,
  221. "reblogs_count": 0,
  222. "replies_count": 0,
  223. "sensitive": false,
  224. "spoiler_text": "2hu",
  225. "tags": [{"name": "2hu", "url": "/tag/2hu"}],
  226. "uri": "https://pleroma.example.org/objects/198ed2a1-7912-4482-b559-244a0369e984",
  227. "url": "https://pleroma.example.org/notice/9hptFmVJ02khbzYJaS",
  228. "visibility": "public"
  229. }
  230. ]
  231. ```
  232. ## `/api/v1/pleroma/accounts/:id/endorsements`
  233. ### Returns users endorsed by a user
  234. * Method `GET`
  235. * Authentication: not required
  236. * Params:
  237. * `id`: the id of the account for whom to return results
  238. * Response: JSON, returns a list of Mastodon Account entities
  239. ## `/api/v1/pleroma/accounts/update_*`
  240. ### Set and clear account avatar, banner, and background
  241. - PATCH `/api/v1/pleroma/accounts/update_avatar`: Set/clear user avatar image
  242. - PATCH `/api/v1/pleroma/accounts/update_banner`: Set/clear user banner image
  243. - PATCH `/api/v1/pleroma/accounts/update_background`: Set/clear user background image
  244. ## `/api/v1/pleroma/accounts/confirmation_resend`
  245. ### Resend confirmation email
  246. * Method `POST`
  247. * Params:
  248. * `email`: email of that needs to be verified
  249. * Authentication: not required
  250. * Response: 204 No Content
  251. ## `/api/v1/pleroma/statuses/:id/quotes`
  252. ### Gets quotes for a given status
  253. * Method `GET`
  254. * Authentication: not required
  255. * Params:
  256. * `id`: the id of the status
  257. * Response: JSON, returns a list of Mastodon Status entities
  258. ## `/api/v1/pleroma/mascot`
  259. ### Gets user mascot image
  260. * Method `GET`
  261. * Authentication: required
  262. * Response: JSON. Returns a mastodon media attachment entity.
  263. * Example response:
  264. ```json
  265. {
  266. "id": "abcdefg",
  267. "url": "https://pleroma.example.org/media/abcdefg.png",
  268. "type": "image",
  269. "pleroma": {
  270. "mime_type": "image/png"
  271. }
  272. }
  273. ```
  274. ### Updates user mascot image
  275. * Method `PUT`
  276. * Authentication: required
  277. * Params:
  278. * `file`: Multipart image
  279. * Response: JSON. Returns a mastodon media attachment entity
  280. when successful, otherwise returns HTTP 415 `{"error": "error_msg"}`
  281. * Example response:
  282. ```json
  283. {
  284. "id": "abcdefg",
  285. "url": "https://pleroma.example.org/media/abcdefg.png",
  286. "type": "image",
  287. "pleroma": {
  288. "mime_type": "image/png"
  289. }
  290. }
  291. ```
  292. * Note: Behaves exactly the same as `POST /api/v1/upload`.
  293. Can only accept images - any attempt to upload non-image files will be met with `HTTP 415 Unsupported Media Type`.
  294. ## `/api/pleroma/notification_settings`
  295. ### Updates user notification settings
  296. * Method `PUT`
  297. * Authentication: required
  298. * Params:
  299. * `block_from_strangers`: BOOLEAN field, blocks notifications from accounts you do not follow
  300. * `hide_notification_contents`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
  301. * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
  302. ## `/api/v1/pleroma/healthcheck`
  303. ### Healthcheck endpoint with additional system data.
  304. * Method `GET`
  305. * Authentication: not required
  306. * Params: none
  307. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  308. * Example response:
  309. ```json
  310. {
  311. "pool_size": 0, # database connection pool
  312. "active": 0, # active processes
  313. "idle": 0, # idle processes
  314. "memory_used": 0.00, # Memory used
  315. "healthy": true, # Instance state
  316. "job_queue_stats": {} # Job queue stats
  317. }
  318. ```
  319. ## `/api/pleroma/change_email`
  320. ### Change account email
  321. * Method `POST`
  322. * Authentication: required
  323. * Params:
  324. * `password`: user's password
  325. * `email`: new email
  326. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  327. * Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
  328. ## `/api/pleroma/move_account`
  329. ### Move account
  330. * Method `POST`
  331. * Authentication: required
  332. * Params:
  333. * `password`: user's password
  334. * `target_account`: the nickname of the target account (e.g. `foo@example.org`)
  335. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  336. * Note: This endpoint emits a `Move` activity to all followers of the current account. Some remote servers will automatically unfollow the current account and follow the target account upon seeing this, but this depends on the remote server implementation and cannot be guaranteed. For local followers , they will automatically unfollow and follow if and only if they have set the `allow_following_move` preference ("Allow auto-follow when following account moves").
  337. ## `/api/pleroma/aliases`
  338. ### Get aliases of the current account
  339. * Method `GET`
  340. * Authentication: required
  341. * Response: JSON. Returns `{"aliases": [alias, ...]}`, where `alias` is the nickname of an alias, e.g. `foo@example.org`.
  342. ### Add alias to the current account
  343. * Method `PUT`
  344. * Authentication: required
  345. * Params:
  346. * `alias`: the nickname of the alias to add, e.g. `foo@example.org`.
  347. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  348. ### Delete alias from the current account
  349. * Method `DELETE`
  350. * Authentication: required
  351. * Params:
  352. * `alias`: the nickname of the alias to delete, e.g. `foo@example.org`.
  353. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  354. ## `/api/v1/pleroma/remote_interaction`
  355. ## Interact with profile or status from remote account
  356. * Metod `POST`
  357. * Authentication: not required
  358. * Params:
  359. * `ap_id`: Profile or status ActivityPub ID
  360. * `profile`: Remote profile webfinger
  361. * Response: JSON. Returns `{"url": "[redirect url]"}` on success, `{"error": "[error message]"}` otherwise
  362. # Pleroma Conversations
  363. Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
  364. 1. Pleroma Conversations never add or remove recipients, unless explicitly changed by the user.
  365. 2. Pleroma Conversations statuses can be requested by Conversation id.
  366. 3. Pleroma Conversations can be replied to.
  367. Conversations have the additional field `recipients` under the `pleroma` key. This holds a list of all the accounts that will receive a message in this conversation.
  368. The status posting endpoint takes an additional parameter, `in_reply_to_conversation_id`, which, when set, will set the visibility to direct and address only the people who are the recipients of that Conversation.
  369. âš  Conversation IDs can be found in direct messages with the `pleroma.direct_conversation_id` key, do not confuse it with `pleroma.conversation_id`.
  370. ## `GET /api/v1/pleroma/conversations/:id/statuses`
  371. ### Timeline for a given conversation
  372. * Method `GET`
  373. * Authentication: required
  374. * Params: Like other timelines
  375. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  376. ## `GET /api/v1/pleroma/conversations/:id`
  377. ### The conversation with the given ID.
  378. * Method `GET`
  379. * Authentication: required
  380. * Params: None
  381. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  382. ## `PATCH /api/v1/pleroma/conversations/:id`
  383. ### Update a conversation. Used to change the set of recipients.
  384. * Method `PATCH`
  385. * Authentication: required
  386. * Params:
  387. * `recipients`: A list of ids of users that should receive posts to this conversation. This will replace the current list of recipients, so submit the full list. The owner of owner of the conversation will always be part of the set of recipients, though.
  388. * Response: JSON, statuses (200 - healthy, 503 unhealthy)
  389. ## `POST /api/v1/pleroma/conversations/read`
  390. ### Marks all user's conversations as read.
  391. * Method `POST`
  392. * Authentication: required
  393. * Params: None
  394. * Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
  395. ## `GET /api/v1/pleroma/emoji/pack?name=:name`
  396. ### Get pack.json for the pack
  397. * Method `GET`
  398. * Authentication: not required
  399. * Params:
  400. * `page`: page number for files (default 1)
  401. * `page_size`: page size for files (default 30)
  402. * Response: JSON, pack json with `files`, `files_count` and `pack` keys with 200 status or 404 if the pack does not exist.
  403. ```json
  404. {
  405. "files": {...},
  406. "files_count": 0, // emoji count in pack
  407. "pack": {...}
  408. }
  409. ```
  410. ## `POST /api/v1/pleroma/emoji/pack?name=:name`
  411. ### Creates an empty pack
  412. * Method `POST`
  413. * Authentication: required (admin)
  414. * Params:
  415. * `name`: pack name
  416. * Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
  417. ## `PATCH /api/v1/pleroma/emoji/pack?name=:name`
  418. ### Updates (replaces) pack metadata
  419. * Method `PATCH`
  420. * Authentication: required (admin)
  421. * Params:
  422. * `name`: pack name
  423. * `metadata`: metadata to replace the old one
  424. * `license`: Pack license
  425. * `homepage`: Pack home page url
  426. * `description`: Pack description
  427. * `fallback-src`: Fallback url to download pack from
  428. * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
  429. * `share-files`: is pack allowed for sharing (boolean)
  430. * Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
  431. problem with the new metadata (the error is specified in the "error" part of the response JSON)
  432. ## `DELETE /api/v1/pleroma/emoji/pack?name=:name`
  433. ### Delete a custom emoji pack
  434. * Method `DELETE`
  435. * Authentication: required (admin)
  436. * Params:
  437. * `name`: pack name
  438. * Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
  439. ## `GET /api/v1/pleroma/emoji/packs/import`
  440. ### Imports packs from filesystem
  441. * Method `GET`
  442. * Authentication: required (admin)
  443. * Params: None
  444. * Response: JSON, returns a list of imported packs.
  445. ## `GET /api/v1/pleroma/emoji/packs/remote`
  446. ### Make request to another instance for packs list
  447. * Method `GET`
  448. * Authentication: required (admin)
  449. * Params:
  450. * `url`: url of the instance to get packs from
  451. * `page`: page number for packs (default 1)
  452. * `page_size`: page size for packs (default 50)
  453. * Response: JSON with the pack list, hashmap with pack name and pack contents
  454. ## `POST /api/v1/pleroma/emoji/packs/download`
  455. ### Download pack from another instance
  456. * Method `POST`
  457. * Authentication: required (admin)
  458. * Params:
  459. * `url`: url of the instance to download from
  460. * `name`: pack to download from that instance
  461. * `as`: (*optional*) name how to save pack
  462. * Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
  463. errors downloading the pack
  464. ## `POST /api/v1/pleroma/emoji/packs/files?name=:name`
  465. ### Add new file to the pack
  466. * Method `POST`
  467. * Authentication: required (admin)
  468. * Params:
  469. * `name`: pack name
  470. * `file`: file needs to be uploaded with the multipart request or link to remote file.
  471. * `shortcode`: (*optional*) shortcode for new emoji, must be unique for all emoji. If not sended, shortcode will be taken from original filename.
  472. * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
  473. * Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  474. ## `PATCH /api/v1/pleroma/emoji/packs/files?name=:name`
  475. ### Update emoji file from pack
  476. * Method `PATCH`
  477. * Authentication: required (admin)
  478. * Params:
  479. * `name`: pack name
  480. * `shortcode`: emoji file shortcode
  481. * `new_shortcode`: new emoji file shortcode
  482. * `new_filename`: new filename for emoji file
  483. * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
  484. * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  485. ## `DELETE /api/v1/pleroma/emoji/packs/files?name=:name`
  486. ### Delete emoji file from pack
  487. * Method `DELETE`
  488. * Authentication: required (admin)
  489. * Params:
  490. * `name`: pack name
  491. * `shortcode`: emoji file shortcode
  492. * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  493. ## `GET /api/v1/pleroma/emoji/packs`
  494. ### Lists local custom emoji packs
  495. * Method `GET`
  496. * Authentication: not required
  497. * Params:
  498. * `page`: page number for packs (default 1)
  499. * `page_size`: page size for packs (default 50)
  500. * Response: `packs` key with JSON hashmap of pack name to pack contents and `count` key for count of packs.
  501. ```json
  502. {
  503. "packs": {
  504. "pack_name": {...}, // pack contents
  505. ...
  506. },
  507. "count": 0 // packs count
  508. }
  509. ```
  510. ## `GET /api/v1/pleroma/emoji/packs/archive?name=:name`
  511. ### Requests a local pack archive from the instance
  512. * Method `GET`
  513. * Authentication: not required
  514. * Params:
  515. * `name`: pack name
  516. * Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
  517. 404 if the pack does not exist
  518. ## `GET /api/v1/pleroma/accounts/:id/scrobbles`
  519. Audio scrobbling in Pleroma is **deprecated**.
  520. ### Requests a list of current and recent Listen activities for an account
  521. * Method `GET`
  522. * Authentication: not required
  523. * Params: None
  524. * Response: An array of media metadata entities.
  525. * Example response:
  526. ```json
  527. [
  528. {
  529. "account": {...},
  530. "id": "1234",
  531. "title": "Some Title",
  532. "artist": "Some Artist",
  533. "album": "Some Album",
  534. "length": 180000,
  535. "created_at": "2019-09-28T12:40:45.000Z"
  536. }
  537. ]
  538. ```
  539. ## `POST /api/v1/pleroma/scrobble`
  540. Audio scrobbling in Pleroma is **deprecated**.
  541. ### Creates a new Listen activity for an account
  542. * Method `POST`
  543. * Authentication: required
  544. * Params:
  545. * `title`: the title of the media playing
  546. * `album`: the album of the media playing [optional]
  547. * `artist`: the artist of the media playing [optional]
  548. * `length`: the length of the media playing [optional]
  549. * Response: the newly created media metadata entity representing the Listen activity
  550. # Emoji Reactions
  551. Emoji reactions work a lot like favourites do. They make it possible to react to a post with a single emoji character. To detect the presence of this feature, you can check `pleroma_emoji_reactions` entry in the features list of nodeinfo.
  552. ## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
  553. ### React to a post with a unicode emoji
  554. * Method: `PUT`
  555. * Authentication: required
  556. * Params: `emoji`: A unicode RGI emoji or a regional indicator
  557. * Response: JSON, the status.
  558. ## `DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji`
  559. ### Remove a reaction to a post with a unicode emoji
  560. * Method: `DELETE`
  561. * Authentication: required
  562. * Params: `emoji`: A unicode RGI emoji or a regional indicator
  563. * Response: JSON, the status.
  564. ## `GET /api/v1/pleroma/statuses/:id/reactions`
  565. ### Get an object of emoji to account mappings with accounts that reacted to the post
  566. * Method: `GET`
  567. * Authentication: optional
  568. * Params: None
  569. * Response: JSON, a list of emoji/account list tuples, sorted by emoji insertion date, in ascending order, e.g, the first emoji in the list is the oldest.
  570. * Example Response:
  571. ```json
  572. [
  573. {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]},
  574. {"name": "☕", "count": 1, "me": false, "accounts": [{"id" => "abc..."}]}
  575. ]
  576. ```
  577. ## `GET /api/v1/pleroma/statuses/:id/reactions/:emoji`
  578. ### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji
  579. * Method: `GET`
  580. * Authentication: optional
  581. * Params: None
  582. * Response: JSON, a list of emoji/account list tuples
  583. * Example Response:
  584. ```json
  585. [
  586. {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]}
  587. ]
  588. ```
  589. ## `POST /api/v1/pleroma/backups`
  590. ### Create a user backup archive
  591. * Method: `POST`
  592. * Authentication: required
  593. * Params: none
  594. * Response: JSON
  595. * Example response:
  596. ```json
  597. [{
  598. "content_type": "application/zip",
  599. "file_size": 0,
  600. "inserted_at": "2020-09-10T16:18:03.000Z",
  601. "processed": false,
  602. "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
  603. }]
  604. ```
  605. ## `GET /api/v1/pleroma/backups`
  606. ### Lists user backups
  607. * Method: `GET`
  608. * Authentication: not required
  609. * Params: none
  610. * Response: JSON
  611. * Example response:
  612. ```json
  613. [{
  614. "content_type": "application/zip",
  615. "file_size": 55457,
  616. "inserted_at": "2020-09-10T16:18:03.000Z",
  617. "processed": true,
  618. "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
  619. }]
  620. ```
  621. ## `GET /api/oauth_tokens`
  622. ### Retrieve a list of active sessions for the user
  623. * Method: `GET`
  624. * Authentication: required
  625. * Params: none
  626. * Response: JSON
  627. * Example response:
  628. ```json
  629. [
  630. {
  631. "app_name": "Pleroma FE",
  632. "id": 9275,
  633. "valid_until": "2121-11-24T15:51:08.234234"
  634. },
  635. {
  636. "app_name": "Patron",
  637. "id": 8805,
  638. "valid_until": "2121-10-26T18:09:59.857150"
  639. },
  640. {
  641. "app_name": "Soapbox FE",
  642. "id": 9727,
  643. "valid_until": "2121-12-25T16:52:39.692877"
  644. }
  645. ]
  646. ```
  647. ## `DELETE /api/oauth_tokens/:id`
  648. ### Revoke a user session by its ID
  649. * Method: `DELETE`
  650. * Authentication: required
  651. * Params: none
  652. * Response: HTTP 200 on success, 500 on error
  653. ## `/api/v1/pleroma/settings/:app`
  654. ### Gets settings for some application
  655. * Method `GET`
  656. * Authentication: `read:accounts`
  657. * Response: JSON. The settings for that application, or empty object if there is none.
  658. * Example response:
  659. ```json
  660. {
  661. "some key": "some value"
  662. }
  663. ```
  664. ### Updates settings for some application
  665. * Method `PATCH`
  666. * Authentication: `write:accounts`
  667. * Request body: JSON object. The object will be merged recursively with old settings. If some field is set to null, it is removed.
  668. * Example request:
  669. ```json
  670. {
  671. "some key": "some value",
  672. "key to remove": null,
  673. "nested field": {
  674. "some key": "some value",
  675. "key to remove": null
  676. }
  677. }
  678. ```
  679. * Response: JSON. Updated (merged) settings for that application.
  680. * Example response:
  681. ```json
  682. {
  683. "some key": "some value",
  684. "nested field": {
  685. "some key": "some value",
  686. }
  687. }
  688. ```