3 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).
5 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`.
7 ## `/api/pleroma/emoji`
8 ### Lists the custom emoji on that server.
10 * Authentication: not required
20 "image_url": "/finmoji/128px/girlpower-128.png"
26 "image_url": "/finmoji/128px/education-128.png"
32 "image_url": "/finmoji/128px/finnishlove-128.png"
36 * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format
38 ## `/api/pleroma/follow_import`
39 ### Imports your follows, for example from a Mastodon CSV file.
41 * Authentication: required
43 * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow
44 * Response: HTTP 200 on success, 500 on error
45 * Note: Users that can't be followed are silently skipped.
47 ## `/api/pleroma/blocks_import`
48 ### Imports your blocks.
50 * Authentication: required
52 * `list`: STRING or FILE containing a whitespace-separated list of accounts to block
53 * Response: HTTP 200 on success, 500 on error
55 ## `/api/pleroma/mutes_import`
56 ### Imports your mutes.
58 * Authentication: required
60 * `list`: STRING or FILE containing a whitespace-separated list of accounts to mute
61 * Response: HTTP 200 on success, 500 on error
63 ## `/api/pleroma/captcha`
66 * Authentication: not required
68 * Response: Provider specific JSON, the only guaranteed parameter is `type`
69 * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint", "seconds_valid": 300}`
71 ## `/api/pleroma/delete_account`
74 * Authentication: required
76 * `password`: user's password
77 * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise
78 * Example response: `{"error": "Invalid password."}`
80 ## `/api/pleroma/disable_account`
81 ### Disable an account
83 * Authentication: required
85 * `password`: user's password
86 * Response: JSON. Returns `{"status": "success"}` if the account was successfully disabled, `{"error": "[error message]"}` otherwise
87 * Example response: `{"error": "Invalid password."}`
89 ## `/api/pleroma/accounts/mfa`
90 #### Gets current MFA settings
92 * Authentication: required
93 * OAuth scope: `read:security`
94 * Response: JSON. Returns `{"enabled": "false", "totp": false }`
96 ## `/api/pleroma/accounts/mfa/setup/totp`
97 #### Pre-setup the MFA/TOTP method
99 * Authentication: required
100 * OAuth scope: `write:security`
101 * Response: JSON. Returns `{"key": [secret_key], "provisioning_uri": "[qr code uri]" }` when successful, otherwise returns HTTP 422 `{"error": "error_msg"}`
103 ## `/api/pleroma/accounts/mfa/confirm/totp`
104 #### Confirms & enables MFA/TOTP support for user account.
106 * Authentication: required
107 * OAuth scope: `write:security`
109 * `password`: user's password
110 * `code`: token from TOTP App
111 * Response: JSON. Returns `{}` if the enable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
114 ## `/api/pleroma/accounts/mfa/totp`
115 #### Disables MFA/TOTP method for user account.
117 * Authentication: required
118 * OAuth scope: `write:security`
120 * `password`: user's password
121 * Response: JSON. Returns `{}` if the disable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
122 * Example response: `{"error": "Invalid password."}`
124 ## `/api/pleroma/accounts/mfa/backup_codes`
125 #### Generstes backup codes MFA for user account.
127 * Authentication: required
128 * OAuth scope: `write:security`
129 * Response: JSON. Returns `{"codes": codes}`when successful, otherwise HTTP 422 `{"error": "[error message]"}`
131 ## `/api/pleroma/admin/`
132 See [Admin-API](admin_api.md)
134 ## `/api/v1/pleroma/notifications/read`
135 ### Mark notifications as read
137 * Authentication: required
138 * Params (mutually exclusive):
139 * `id`: a single notification id to read
140 * `max_id`: read all notifications up to this id
141 * Response: Notification entity/Array of Notification entities that were read. In case of `max_id`, only the first 80 read notifications will be returned.
143 ## `/api/v1/pleroma/accounts/:id/subscribe`
144 ### Subscribe to receive notifications for all statuses posted by a user
146 * Authentication: required
148 * `id`: account id to subscribe to
149 * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
155 "followed_by": false,
158 "muting_notifications": false,
161 "domain_blocking": false,
162 "showing_reblogs": true,
167 ## `/api/v1/pleroma/accounts/:id/unsubscribe`
168 ### Unsubscribe to stop receiving notifications from user statuses
170 * Authentication: required
172 * `id`: account id to unsubscribe from
173 * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
179 "followed_by": false,
182 "muting_notifications": false,
183 "subscribing": false,
185 "domain_blocking": false,
186 "showing_reblogs": true,
191 ## `/api/v1/pleroma/accounts/:id/favourites`
192 ### Returns favorites timeline of any user
194 * Authentication: not required
196 * `id`: the id of the account for whom to return results
197 * `limit`: optional, the number of records to retrieve
198 * `since_id`: optional, returns results that are more recent than the specified id
199 * `max_id`: optional, returns results that are older than the specified id
200 * Response: JSON, returns a list of Mastodon Status entities on success, otherwise returns `{"error": "error_msg"}`
206 "id": "9hptFmUF3ztxYh3Svg",
207 "url": "https://pleroma.example.org/users/nick2",
211 "application": {"name": "Web", "website": null},
214 "content": "This is :moominmamma: note 0",
215 "created_at": "2019-04-15T15:42:15.000Z",
218 "favourites_count": 1,
219 "id": "9hptFmVJ02khbzYJaS",
220 "in_reply_to_account_id": null,
221 "in_reply_to_id": null,
223 "media_attachments": [],
228 "content": {"text/plain": "This is :moominmamma: note 0"},
229 "conversation_id": 13679,
231 "spoiler_text": {"text/plain": "2hu"}
238 "spoiler_text": "2hu",
239 "tags": [{"name": "2hu", "url": "/tag/2hu"}],
240 "uri": "https://pleroma.example.org/objects/198ed2a1-7912-4482-b559-244a0369e984",
241 "url": "https://pleroma.example.org/notice/9hptFmVJ02khbzYJaS",
242 "visibility": "public"
247 ## `/api/v1/pleroma/accounts/update_*`
248 ### Set and clear account avatar, banner, and background
250 - PATCH `/api/v1/pleroma/accounts/update_avatar`: Set/clear user avatar image
251 - PATCH `/api/v1/pleroma/accounts/update_banner`: Set/clear user banner image
252 - PATCH `/api/v1/pleroma/accounts/update_background`: Set/clear user background image
254 ## `/api/v1/pleroma/accounts/confirmation_resend`
255 ### Resend confirmation email
258 * `email`: email of that needs to be verified
259 * Authentication: not required
260 * Response: 204 No Content
262 ## `/api/v1/pleroma/mascot`
263 ### Gets user mascot image
265 * Authentication: required
267 * Response: JSON. Returns a mastodon media attachment entity.
272 "url": "https://pleroma.example.org/media/abcdefg.png",
275 "mime_type": "image/png"
280 ### Updates user mascot image
282 * Authentication: required
284 * `file`: Multipart image
285 * Response: JSON. Returns a mastodon media attachment entity
286 when successful, otherwise returns HTTP 415 `{"error": "error_msg"}`
291 "url": "https://pleroma.example.org/media/abcdefg.png",
294 "mime_type": "image/png"
298 * Note: Behaves exactly the same as `POST /api/v1/upload`.
299 Can only accept images - any attempt to upload non-image files will be met with `HTTP 415 Unsupported Media Type`.
301 ## `/api/pleroma/notification_settings`
302 ### Updates user notification settings
304 * Authentication: required
306 * `block_from_strangers`: BOOLEAN field, blocks notifications from accounts you do not follow
307 * `hide_notification_contents`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
308 * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
310 ## `/api/pleroma/healthcheck`
311 ### Healthcheck endpoint with additional system data.
313 * Authentication: not required
315 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
319 "pool_size": 0, # database connection pool
320 "active": 0, # active processes
321 "idle": 0, # idle processes
322 "memory_used": 0.00, # Memory used
323 "healthy": true, # Instance state
324 "job_queue_stats": {} # Job queue stats
328 ## `/api/pleroma/change_email`
329 ### Change account email
331 * Authentication: required
333 * `password`: user's password
335 * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
336 * Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
338 # Pleroma Conversations
340 Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
342 1. Pleroma Conversations never add or remove recipients, unless explicitly changed by the user.
343 2. Pleroma Conversations statuses can be requested by Conversation id.
344 3. Pleroma Conversations can be replied to.
346 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.
348 The status posting endpoint takes an additional parameter, `in_reply_to_conversation_id`, which, when set, will set the visiblity to direct and address only the people who are the recipients of that Conversation.
350 âš Conversation IDs can be found in direct messages with the `pleroma.direct_conversation_id` key, do not confuse it with `pleroma.conversation_id`.
352 ## `GET /api/v1/pleroma/conversations/:id/statuses`
353 ### Timeline for a given conversation
355 * Authentication: required
356 * Params: Like other timelines
357 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
359 ## `GET /api/v1/pleroma/conversations/:id`
360 ### The conversation with the given ID.
362 * Authentication: required
364 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
366 ## `PATCH /api/v1/pleroma/conversations/:id`
367 ### Update a conversation. Used to change the set of recipients.
369 * Authentication: required
371 * `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.
372 * Response: JSON, statuses (200 - healthy, 503 unhealthy)
374 ## `POST /api/v1/pleroma/conversations/read`
375 ### Marks all user's conversations as read.
377 * Authentication: required
379 * Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
381 ## `GET /api/pleroma/emoji/pack?name=:name`
383 ### Get pack.json for the pack
386 * Authentication: not required
388 * `page`: page number for files (default 1)
389 * `page_size`: page size for files (default 30)
390 * Response: JSON, pack json with `files`, `files_count` and `pack` keys with 200 status or 404 if the pack does not exist.
395 "files_count": 0, // emoji count in pack
400 ## `POST /api/pleroma/emoji/pack?name=:name`
402 ### Creates an empty pack
405 * Authentication: required (admin)
408 * Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
410 ## `PATCH /api/pleroma/emoji/pack?name=:name`
412 ### Updates (replaces) pack metadata
415 * Authentication: required (admin)
418 * `metadata`: metadata to replace the old one
419 * `license`: Pack license
420 * `homepage`: Pack home page url
421 * `description`: Pack description
422 * `fallback-src`: Fallback url to download pack from
423 * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
424 * `share-files`: is pack allowed for sharing (boolean)
425 * Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
426 problem with the new metadata (the error is specified in the "error" part of the response JSON)
428 ## `DELETE /api/pleroma/emoji/pack?name=:name`
430 ### Delete a custom emoji pack
433 * Authentication: required (admin)
436 * Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
438 ## `GET /api/pleroma/emoji/packs/import`
440 ### Imports packs from filesystem
443 * Authentication: required (admin)
445 * Response: JSON, returns a list of imported packs.
447 ## `GET /api/pleroma/emoji/packs/remote`
449 ### Make request to another instance for packs list
452 * Authentication: required (admin)
454 * `url`: url of the instance to get packs from
455 * `page`: page number for packs (default 1)
456 * `page_size`: page size for packs (default 50)
457 * Response: JSON with the pack list, hashmap with pack name and pack contents
459 ## `POST /api/pleroma/emoji/packs/download`
461 ### Download pack from another instance
464 * Authentication: required (admin)
466 * `url`: url of the instance to download from
467 * `name`: pack to download from that instance
468 * `as`: (*optional*) name how to save pack
469 * Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
470 errors downloading the pack
472 ## `POST /api/pleroma/emoji/packs/files?name=:name`
474 ### Add new file to the pack
477 * Authentication: required (admin)
480 * `file`: file needs to be uploaded with the multipart request or link to remote file.
481 * `shortcode`: (*optional*) shortcode for new emoji, must be unique for all emoji. If not sended, shortcode will be taken from original filename.
482 * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
483 * Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
485 ## `PATCH /api/pleroma/emoji/packs/files?name=:name`
487 ### Update emoji file from pack
490 * Authentication: required (admin)
493 * `shortcode`: emoji file shortcode
494 * `new_shortcode`: new emoji file shortcode
495 * `new_filename`: new filename for emoji file
496 * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
497 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
499 ## `DELETE /api/pleroma/emoji/packs/files?name=:name`
501 ### Delete emoji file from pack
504 * Authentication: required (admin)
507 * `shortcode`: emoji file shortcode
508 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
510 ## `GET /api/pleroma/emoji/packs`
512 ### Lists local custom emoji packs
515 * Authentication: not required
517 * `page`: page number for packs (default 1)
518 * `page_size`: page size for packs (default 50)
519 * Response: `packs` key with JSON hashmap of pack name to pack contents and `count` key for count of packs.
524 "pack_name": {...}, // pack contents
527 "count": 0 // packs count
531 ## `GET /api/pleroma/emoji/packs/archive?name=:name`
533 ### Requests a local pack archive from the instance
536 * Authentication: not required
539 * Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
540 404 if the pack does not exist
542 ## `GET /api/v1/pleroma/accounts/:id/scrobbles`
543 ### Requests a list of current and recent Listen activities for an account
545 * Authentication: not required
547 * Response: An array of media metadata entities.
554 "title": "Some Title",
555 "artist": "Some Artist",
556 "album": "Some Album",
558 "created_at": "2019-09-28T12:40:45.000Z"
563 ## `POST /api/v1/pleroma/scrobble`
564 ### Creates a new Listen activity for an account
566 * Authentication: required
568 * `title`: the title of the media playing
569 * `album`: the album of the media playing [optional]
570 * `artist`: the artist of the media playing [optional]
571 * `length`: the length of the media playing [optional]
572 * Response: the newly created media metadata entity representing the Listen activity
576 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.
578 ## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
579 ### React to a post with a unicode emoji
581 * Authentication: required
582 * Params: `emoji`: A single character unicode emoji
583 * Response: JSON, the status.
585 ## `DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji`
586 ### Remove a reaction to a post with a unicode emoji
588 * Authentication: required
589 * Params: `emoji`: A single character unicode emoji
590 * Response: JSON, the status.
592 ## `GET /api/v1/pleroma/statuses/:id/reactions`
593 ### Get an object of emoji to account mappings with accounts that reacted to the post
595 * Authentication: optional
597 * 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.
601 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]},
602 {"name": "☕", "count": 1, "me": false, "accounts": [{"id" => "abc..."}]}
606 ## `GET /api/v1/pleroma/statuses/:id/reactions/:emoji`
607 ### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji
609 * Authentication: optional
611 * Response: JSON, a list of emoji/account list tuples
615 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]}
619 ## `POST /api/v1/pleroma/backups`
620 ### Create a user backup archive
623 * Authentication: required
630 "content_type": "application/zip",
632 "inserted_at": "2020-09-10T16:18:03.000Z",
634 "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
638 ## `GET /api/v1/pleroma/backups`
639 ### Lists user backups
642 * Authentication: not required
649 "content_type": "application/zip",
651 "inserted_at": "2020-09-10T16:18:03.000Z",
653 "url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"