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/packs/import`
382 ### Imports packs from filesystem
384 * Authentication: required
386 * Response: JSON, returns a list of imported packs.
388 ## `GET /api/pleroma/emoji/packs/remote`
389 ### Make request to another instance for packs list
391 * Authentication: required
393 * `url`: url of the instance to get packs from
394 * Response: JSON with the pack list, hashmap with pack name and pack contents
396 ## `POST /api/pleroma/emoji/packs/download`
397 ### Download pack from another instance
399 * Authentication: required
401 * `url`: url of the instance to download from
402 * `name`: pack to download from that instance
403 * `as`: (*optional*) name how to save pack
404 * Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
405 errors downloading the pack
407 ## `POST /api/pleroma/emoji/packs/:name`
408 ### Creates an empty pack
410 * Authentication: required
412 * Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
414 ## `PATCH /api/pleroma/emoji/packs/:name`
415 ### Updates (replaces) pack metadata
417 * Authentication: required
419 * `metadata`: metadata to replace the old one
420 * `license`: Pack license
421 * `homepage`: Pack home page url
422 * `description`: Pack description
423 * `fallback-src`: Fallback url to download pack from
424 * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
425 * `share-files`: is pack allowed for sharing (boolean)
426 * Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
427 problem with the new metadata (the error is specified in the "error" part of the response JSON)
429 ## `DELETE /api/pleroma/emoji/packs/:name`
430 ### Delete a custom emoji pack
432 * Authentication: required
434 * Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
436 ## `POST /api/pleroma/emoji/packs/:name/files`
437 ### Add new file to the pack
439 * Authentication: required
441 * `file`: file needs to be uploaded with the multipart request or link to remote file.
442 * `shortcode`: (*optional*) shortcode for new emoji, must be unique for all emoji. If not sended, shortcode will be taken from original filename.
443 * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
444 * Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
446 ## `PATCH /api/pleroma/emoji/packs/:name/files`
447 ### Update emoji file from pack
449 * Authentication: required
451 * `shortcode`: emoji file shortcode
452 * `new_shortcode`: new emoji file shortcode
453 * `new_filename`: new filename for emoji file
454 * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
455 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
457 ## `DELETE /api/pleroma/emoji/packs/:name/files`
458 ### Delete emoji file from pack
460 * Authentication: required
462 * `shortcode`: emoji file shortcode
463 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
465 ## `GET /api/pleroma/emoji/packs`
467 ### Lists local custom emoji packs
470 * Authentication: not required
472 * `page`: page number for packs (default 1)
473 * `page_size`: page size for packs (default 50)
474 * Response: `packs` key with JSON hashmap of pack name to pack contents and `count` key for count of packs.
479 "pack_name": {...}, // pack contents
482 "count": 0 // packs count
486 ## `GET /api/pleroma/emoji/packs/:name`
488 ### Get pack.json for the pack
491 * Authentication: not required
493 * `page`: page number for files (default 1)
494 * `page_size`: page size for files (default 30)
495 * Response: JSON, pack json with `files`, `files_count` and `pack` keys with 200 status or 404 if the pack does not exist.
500 "files_count": 0, // emoji count in pack
505 ## `GET /api/pleroma/emoji/packs/:name/archive`
506 ### Requests a local pack archive from the instance
508 * Authentication: not required
510 * Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
511 404 if the pack does not exist
513 ## `GET /api/v1/pleroma/accounts/:id/scrobbles`
514 ### Requests a list of current and recent Listen activities for an account
516 * Authentication: not required
518 * Response: An array of media metadata entities.
525 "title": "Some Title",
526 "artist": "Some Artist",
527 "album": "Some Album",
529 "created_at": "2019-09-28T12:40:45.000Z"
534 ## `POST /api/v1/pleroma/scrobble`
535 ### Creates a new Listen activity for an account
537 * Authentication: required
539 * `title`: the title of the media playing
540 * `album`: the album of the media playing [optional]
541 * `artist`: the artist of the media playing [optional]
542 * `length`: the length of the media playing [optional]
543 * Response: the newly created media metadata entity representing the Listen activity
547 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.
549 ## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
550 ### React to a post with a unicode emoji
552 * Authentication: required
553 * Params: `emoji`: A single character unicode emoji
554 * Response: JSON, the status.
556 ## `DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji`
557 ### Remove a reaction to a post with a unicode emoji
559 * Authentication: required
560 * Params: `emoji`: A single character unicode emoji
561 * Response: JSON, the status.
563 ## `GET /api/v1/pleroma/statuses/:id/reactions`
564 ### Get an object of emoji to account mappings with accounts that reacted to the post
566 * Authentication: optional
568 * 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.
572 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]},
573 {"name": "☕", "count": 1, "me": false, "accounts": [{"id" => "abc..."}]}
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
580 * Authentication: optional
582 * Response: JSON, a list of emoji/account list tuples
586 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]}