logo

pleroma

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

pleroma_api.md (26835B)


  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. ## `GET /api/v1/pleroma/bookmark_folders`
  259. ### Gets user bookmark folders
  260. * Authentication: required
  261. * Response: JSON. Returns a list of bookmark folders.
  262. * Example response:
  263. ```json
  264. [
  265. {
  266. "id": "9umDrYheeY451cQnEe",
  267. "name": "Read later",
  268. "emoji": "🕓",
  269. "source": {
  270. "emoji": "🕓"
  271. }
  272. }
  273. ]
  274. ```
  275. ## `POST /api/v1/pleroma/bookmark_folders`
  276. ### Creates a bookmark folder
  277. * Authentication: required
  278. * Params:
  279. * `name`: folder name
  280. * `emoji`: folder emoji (optional)
  281. * Response: JSON. Returns a single bookmark folder.
  282. ## `PATCH /api/v1/pleroma/bookmark_folders/:id`
  283. ### Updates a bookmark folder
  284. * Authentication: required
  285. * Params:
  286. * `id`: folder id
  287. * `name`: folder name (optional)
  288. * `emoji`: folder emoji (optional)
  289. * Response: JSON. Returns a single bookmark folder.
  290. ## `DELETE /api/v1/pleroma/bookmark_folders/:id`
  291. ### Deletes a bookmark folder
  292. * Authentication: required
  293. * Params:
  294. * `id`: folder id
  295. * Response: JSON. Returns a single bookmark folder.
  296. ## `/api/v1/pleroma/mascot`
  297. ### Gets user mascot image
  298. * Method `GET`
  299. * Authentication: required
  300. * Response: JSON. Returns a mastodon media attachment entity.
  301. * Example response:
  302. ```json
  303. {
  304. "id": "abcdefg",
  305. "url": "https://pleroma.example.org/media/abcdefg.png",
  306. "type": "image",
  307. "pleroma": {
  308. "mime_type": "image/png"
  309. }
  310. }
  311. ```
  312. ### Updates user mascot image
  313. * Method `PUT`
  314. * Authentication: required
  315. * Params:
  316. * `file`: Multipart image
  317. * Response: JSON. Returns a mastodon media attachment entity
  318. when successful, otherwise returns HTTP 415 `{"error": "error_msg"}`
  319. * Example response:
  320. ```json
  321. {
  322. "id": "abcdefg",
  323. "url": "https://pleroma.example.org/media/abcdefg.png",
  324. "type": "image",
  325. "pleroma": {
  326. "mime_type": "image/png"
  327. }
  328. }
  329. ```
  330. * Note: Behaves exactly the same as `POST /api/v1/upload`.
  331. Can only accept images - any attempt to upload non-image files will be met with `HTTP 415 Unsupported Media Type`.
  332. ## `/api/pleroma/notification_settings`
  333. ### Updates user notification settings
  334. * Method `PUT`
  335. * Authentication: required
  336. * Params:
  337. * `block_from_strangers`: BOOLEAN field, blocks notifications from accounts you do not follow
  338. * `hide_notification_contents`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
  339. * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
  340. ## `/api/v1/pleroma/healthcheck`
  341. ### Healthcheck endpoint with additional system data.
  342. * Method `GET`
  343. * Authentication: not required
  344. * Params: none
  345. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  346. * Example response:
  347. ```json
  348. {
  349. "pool_size": 0, # database connection pool
  350. "active": 0, # active processes
  351. "idle": 0, # idle processes
  352. "memory_used": 0.00, # Memory used
  353. "healthy": true, # Instance state
  354. "job_queue_stats": {} # Job queue stats
  355. }
  356. ```
  357. ## `/api/pleroma/change_email`
  358. ### Change account email
  359. * Method `POST`
  360. * Authentication: required
  361. * Params:
  362. * `password`: user's password
  363. * `email`: new email
  364. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  365. * Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
  366. ## `/api/pleroma/move_account`
  367. ### Move account
  368. * Method `POST`
  369. * Authentication: required
  370. * Params:
  371. * `password`: user's password
  372. * `target_account`: the nickname of the target account (e.g. `foo@example.org`)
  373. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  374. * 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").
  375. ## `/api/pleroma/aliases`
  376. ### Get aliases of the current account
  377. * Method `GET`
  378. * Authentication: required
  379. * Response: JSON. Returns `{"aliases": [alias, ...]}`, where `alias` is the nickname of an alias, e.g. `foo@example.org`.
  380. ### Add alias to the current account
  381. * Method `PUT`
  382. * Authentication: required
  383. * Params:
  384. * `alias`: the nickname of the alias to add, e.g. `foo@example.org`.
  385. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  386. ### Delete alias from the current account
  387. * Method `DELETE`
  388. * Authentication: required
  389. * Params:
  390. * `alias`: the nickname of the alias to delete, e.g. `foo@example.org`.
  391. * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
  392. ## `/api/v1/pleroma/remote_interaction`
  393. ## Interact with profile or status from remote account
  394. * Metod `POST`
  395. * Authentication: not required
  396. * Params:
  397. * `ap_id`: Profile or status ActivityPub ID
  398. * `profile`: Remote profile webfinger
  399. * Response: JSON. Returns `{"url": "[redirect url]"}` on success, `{"error": "[error message]"}` otherwise
  400. # Pleroma Conversations
  401. Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
  402. 1. Pleroma Conversations never add or remove recipients, unless explicitly changed by the user.
  403. 2. Pleroma Conversations statuses can be requested by Conversation id.
  404. 3. Pleroma Conversations can be replied to.
  405. 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.
  406. 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.
  407. âš  Conversation IDs can be found in direct messages with the `pleroma.direct_conversation_id` key, do not confuse it with `pleroma.conversation_id`.
  408. ## `GET /api/v1/pleroma/conversations/:id/statuses`
  409. ### Timeline for a given conversation
  410. * Method `GET`
  411. * Authentication: required
  412. * Params: Like other timelines
  413. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  414. ## `GET /api/v1/pleroma/conversations/:id`
  415. ### The conversation with the given ID.
  416. * Method `GET`
  417. * Authentication: required
  418. * Params: None
  419. * Response: JSON, statuses (200 - healthy, 503 unhealthy).
  420. ## `PATCH /api/v1/pleroma/conversations/:id`
  421. ### Update a conversation. Used to change the set of recipients.
  422. * Method `PATCH`
  423. * Authentication: required
  424. * Params:
  425. * `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.
  426. * Response: JSON, statuses (200 - healthy, 503 unhealthy)
  427. ## `POST /api/v1/pleroma/conversations/read`
  428. ### Marks all user's conversations as read.
  429. * Method `POST`
  430. * Authentication: required
  431. * Params: None
  432. * Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
  433. ## `GET /api/v1/pleroma/emoji/pack?name=:name`
  434. ### Get pack.json for the pack
  435. * Method `GET`
  436. * Authentication: not required
  437. * Params:
  438. * `page`: page number for files (default 1)
  439. * `page_size`: page size for files (default 30)
  440. * Response: JSON, pack json with `files`, `files_count` and `pack` keys with 200 status or 404 if the pack does not exist.
  441. ```json
  442. {
  443. "files": {...},
  444. "files_count": 0, // emoji count in pack
  445. "pack": {...}
  446. }
  447. ```
  448. ## `POST /api/v1/pleroma/emoji/pack?name=:name`
  449. ### Creates an empty pack
  450. * Method `POST`
  451. * Authentication: required (admin)
  452. * Params:
  453. * `name`: pack name
  454. * Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
  455. ## `PATCH /api/v1/pleroma/emoji/pack?name=:name`
  456. ### Updates (replaces) pack metadata
  457. * Method `PATCH`
  458. * Authentication: required (admin)
  459. * Params:
  460. * `name`: pack name
  461. * `metadata`: metadata to replace the old one
  462. * `license`: Pack license
  463. * `homepage`: Pack home page url
  464. * `description`: Pack description
  465. * `fallback-src`: Fallback url to download pack from
  466. * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
  467. * `share-files`: is pack allowed for sharing (boolean)
  468. * Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
  469. problem with the new metadata (the error is specified in the "error" part of the response JSON)
  470. ## `DELETE /api/v1/pleroma/emoji/pack?name=:name`
  471. ### Delete a custom emoji pack
  472. * Method `DELETE`
  473. * Authentication: required (admin)
  474. * Params:
  475. * `name`: pack name
  476. * Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
  477. ## `GET /api/v1/pleroma/emoji/packs/import`
  478. ### Imports packs from filesystem
  479. * Method `GET`
  480. * Authentication: required (admin)
  481. * Params: None
  482. * Response: JSON, returns a list of imported packs.
  483. ## `GET /api/v1/pleroma/emoji/packs/remote`
  484. ### Make request to another instance for packs list
  485. * Method `GET`
  486. * Authentication: required (admin)
  487. * Params:
  488. * `url`: url of the instance to get packs from
  489. * `page`: page number for packs (default 1)
  490. * `page_size`: page size for packs (default 50)
  491. * Response: JSON with the pack list, hashmap with pack name and pack contents
  492. ## `POST /api/v1/pleroma/emoji/packs/download`
  493. ### Download pack from another instance
  494. * Method `POST`
  495. * Authentication: required (admin)
  496. * Params:
  497. * `url`: url of the instance to download from
  498. * `name`: pack to download from that instance
  499. * `as`: (*optional*) name how to save pack
  500. * Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
  501. errors downloading the pack
  502. ## `POST /api/v1/pleroma/emoji/packs/files?name=:name`
  503. ### Add new file to the pack
  504. * Method `POST`
  505. * Authentication: required (admin)
  506. * Params:
  507. * `name`: pack name
  508. * `file`: file needs to be uploaded with the multipart request or link to remote file.
  509. * `shortcode`: (*optional*) shortcode for new emoji, must be unique for all emoji. If not sended, shortcode will be taken from original filename.
  510. * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
  511. * Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  512. ## `PATCH /api/v1/pleroma/emoji/packs/files?name=:name`
  513. ### Update emoji file from pack
  514. * Method `PATCH`
  515. * Authentication: required (admin)
  516. * Params:
  517. * `name`: pack name
  518. * `shortcode`: emoji file shortcode
  519. * `new_shortcode`: new emoji file shortcode
  520. * `new_filename`: new filename for emoji file
  521. * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
  522. * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  523. ## `DELETE /api/v1/pleroma/emoji/packs/files?name=:name`
  524. ### Delete emoji file from pack
  525. * Method `DELETE`
  526. * Authentication: required (admin)
  527. * Params:
  528. * `name`: pack name
  529. * `shortcode`: emoji file shortcode
  530. * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
  531. ## `GET /api/v1/pleroma/emoji/packs`
  532. ### Lists local custom emoji packs
  533. * Method `GET`
  534. * Authentication: not required
  535. * Params:
  536. * `page`: page number for packs (default 1)
  537. * `page_size`: page size for packs (default 50)
  538. * Response: `packs` key with JSON hashmap of pack name to pack contents and `count` key for count of packs.
  539. ```json
  540. {
  541. "packs": {
  542. "pack_name": {...}, // pack contents
  543. ...
  544. },
  545. "count": 0 // packs count
  546. }
  547. ```
  548. ## `GET /api/v1/pleroma/emoji/packs/archive?name=:name`
  549. ### Requests a local pack archive from the instance
  550. * Method `GET`
  551. * Authentication: not required
  552. * Params:
  553. * `name`: pack name
  554. * Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
  555. 404 if the pack does not exist
  556. ## `GET /api/v1/pleroma/accounts/:id/scrobbles`
  557. Audio scrobbling in Pleroma is **deprecated**.
  558. ### Requests a list of current and recent Listen activities for an account
  559. * Method `GET`
  560. * Authentication: not required
  561. * Params: None
  562. * Response: An array of media metadata entities.
  563. * Example response:
  564. ```json
  565. [
  566. {
  567. "account": {...},
  568. "id": "1234",
  569. "title": "Some Title",
  570. "artist": "Some Artist",
  571. "album": "Some Album",
  572. "length": 180000,
  573. "created_at": "2019-09-28T12:40:45.000Z"
  574. }
  575. ]
  576. ```
  577. ## `POST /api/v1/pleroma/scrobble`
  578. Audio scrobbling in Pleroma is **deprecated**.
  579. ### Creates a new Listen activity for an account
  580. * Method `POST`
  581. * Authentication: required
  582. * Params:
  583. * `title`: the title of the media playing
  584. * `album`: the album of the media playing [optional]
  585. * `artist`: the artist of the media playing [optional]
  586. * `length`: the length of the media playing [optional]
  587. * Response: the newly created media metadata entity representing the Listen activity
  588. # Emoji Reactions
  589. 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.
  590. ## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
  591. ### React to a post with a unicode emoji
  592. * Method: `PUT`
  593. * Authentication: required
  594. * Params: `emoji`: A unicode RGI emoji or a regional indicator
  595. * Response: JSON, the status.
  596. ## `DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji`
  597. ### Remove a reaction to a post with a unicode emoji
  598. * Method: `DELETE`
  599. * Authentication: required
  600. * Params: `emoji`: A unicode RGI emoji or a regional indicator
  601. * Response: JSON, the status.
  602. ## `GET /api/v1/pleroma/statuses/:id/reactions`
  603. ### Get an object of emoji to account mappings with accounts that reacted to the post
  604. * Method: `GET`
  605. * Authentication: optional
  606. * Params: None
  607. * 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.
  608. * Example Response:
  609. ```json
  610. [
  611. {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]},
  612. {"name": "☕", "count": 1, "me": false, "accounts": [{"id" => "abc..."}]}
  613. ]
  614. ```
  615. ## `GET /api/v1/pleroma/statuses/:id/reactions/:emoji`
  616. ### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji
  617. * Method: `GET`
  618. * Authentication: optional
  619. * Params: None
  620. * Response: JSON, a list of emoji/account list tuples
  621. * Example Response:
  622. ```json
  623. [
  624. {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]}
  625. ]
  626. ```
  627. ## `POST /api/v1/pleroma/backups`
  628. ### Create a user backup archive
  629. * Method: `POST`
  630. * Authentication: required
  631. * Params: none
  632. * Response: JSON
  633. * Example response:
  634. ```json
  635. [{
  636. "content_type": "application/zip",
  637. "file_size": 0,
  638. "inserted_at": "2020-09-10T16:18:03.000Z",
  639. "processed": false,
  640. "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
  641. }]
  642. ```
  643. ## `GET /api/v1/pleroma/backups`
  644. ### Lists user backups
  645. * Method: `GET`
  646. * Authentication: not required
  647. * Params: none
  648. * Response: JSON
  649. * Example response:
  650. ```json
  651. [{
  652. "content_type": "application/zip",
  653. "file_size": 55457,
  654. "inserted_at": "2020-09-10T16:18:03.000Z",
  655. "processed": true,
  656. "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
  657. }]
  658. ```
  659. ## `GET /api/oauth_tokens`
  660. ### Retrieve a list of active sessions for the user
  661. * Method: `GET`
  662. * Authentication: required
  663. * Params: none
  664. * Response: JSON
  665. * Example response:
  666. ```json
  667. [
  668. {
  669. "app_name": "Pleroma FE",
  670. "id": 9275,
  671. "valid_until": "2121-11-24T15:51:08.234234"
  672. },
  673. {
  674. "app_name": "Patron",
  675. "id": 8805,
  676. "valid_until": "2121-10-26T18:09:59.857150"
  677. },
  678. {
  679. "app_name": "Soapbox FE",
  680. "id": 9727,
  681. "valid_until": "2121-12-25T16:52:39.692877"
  682. }
  683. ]
  684. ```
  685. ## `DELETE /api/oauth_tokens/:id`
  686. ### Revoke a user session by its ID
  687. * Method: `DELETE`
  688. * Authentication: required
  689. * Params: none
  690. * Response: HTTP 200 on success, 500 on error
  691. ## `/api/v1/pleroma/settings/:app`
  692. ### Gets settings for some application
  693. * Method `GET`
  694. * Authentication: `read:accounts`
  695. * Response: JSON. The settings for that application, or empty object if there is none.
  696. * Example response:
  697. ```json
  698. {
  699. "some key": "some value"
  700. }
  701. ```
  702. ### Updates settings for some application
  703. * Method `PATCH`
  704. * Authentication: `write:accounts`
  705. * Request body: JSON object. The object will be merged recursively with old settings. If some field is set to null, it is removed.
  706. * Example request:
  707. ```json
  708. {
  709. "some key": "some value",
  710. "key to remove": null,
  711. "nested field": {
  712. "some key": "some value",
  713. "key to remove": null
  714. }
  715. }
  716. ```
  717. * Response: JSON. Updated (merged) settings for that application.
  718. * Example response:
  719. ```json
  720. {
  721. "some key": "some value",
  722. "nested field": {
  723. "some key": "some value",
  724. }
  725. }
  726. ```