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/captcha`
50 * Authentication: not required
52 * Response: Provider specific JSON, the only guaranteed parameter is `type`
53 * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}`
55 ## `/api/pleroma/delete_account`
58 * Authentication: required
60 * `password`: user's password
61 * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise
62 * Example response: `{"error": "Invalid password."}`
64 ## `/api/pleroma/disable_account`
65 ### Disable an account
67 * Authentication: required
69 * `password`: user's password
70 * Response: JSON. Returns `{"status": "success"}` if the account was successfully disabled, `{"error": "[error message]"}` otherwise
71 * Example response: `{"error": "Invalid password."}`
73 ## `/api/pleroma/accounts/mfa`
74 #### Gets current MFA settings
76 * Authentication: required
77 * OAuth scope: `read:security`
78 * Response: JSON. Returns `{"enabled": "false", "totp": false }`
80 ## `/api/pleroma/accounts/mfa/setup/totp`
81 #### Pre-setup the MFA/TOTP method
83 * Authentication: required
84 * OAuth scope: `write:security`
85 * Response: JSON. Returns `{"key": [secret_key], "provisioning_uri": "[qr code uri]" }` when successful, otherwise returns HTTP 422 `{"error": "error_msg"}`
87 ## `/api/pleroma/accounts/mfa/confirm/totp`
88 #### Confirms & enables MFA/TOTP support for user account.
90 * Authentication: required
91 * OAuth scope: `write:security`
93 * `password`: user's password
94 * `code`: token from TOTP App
95 * Response: JSON. Returns `{}` if the enable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
98 ## `/api/pleroma/accounts/mfa/totp`
99 #### Disables MFA/TOTP method for user account.
101 * Authentication: required
102 * OAuth scope: `write:security`
104 * `password`: user's password
105 * Response: JSON. Returns `{}` if the disable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
106 * Example response: `{"error": "Invalid password."}`
108 ## `/api/pleroma/accounts/mfa/backup_codes`
109 #### Generstes backup codes MFA for user account.
111 * Authentication: required
112 * OAuth scope: `write:security`
113 * Response: JSON. Returns `{"codes": codes}`when successful, otherwise HTTP 422 `{"error": "[error message]"}`
115 ## `/api/pleroma/admin/`
116 See [Admin-API](admin_api.md)
118 ## `/api/v1/pleroma/notifications/read`
119 ### Mark notifications as read
121 * Authentication: required
122 * Params (mutually exclusive):
123 * `id`: a single notification id to read
124 * `max_id`: read all notifications up to this id
125 * 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
130 * Authentication: required
132 * `id`: account id to subscribe to
133 * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
139 "followed_by": false,
142 "muting_notifications": false,
145 "domain_blocking": false,
146 "showing_reblogs": true,
151 ## `/api/v1/pleroma/accounts/:id/unsubscribe`
152 ### Unsubscribe to stop receiving notifications from user statuses
154 * Authentication: required
156 * `id`: account id to unsubscribe from
157 * Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
163 "followed_by": false,
166 "muting_notifications": false,
167 "subscribing": false,
169 "domain_blocking": false,
170 "showing_reblogs": true,
175 ## `/api/v1/pleroma/accounts/:id/favourites`
176 ### Returns favorites timeline of any user
178 * Authentication: not required
180 * `id`: the id of the account for whom to return results
181 * `limit`: optional, the number of records to retrieve
182 * `since_id`: optional, returns results that are more recent than the specified id
183 * `max_id`: optional, returns results that are older than the specified id
184 * Response: JSON, returns a list of Mastodon Status entities on success, otherwise returns `{"error": "error_msg"}`
190 "id": "9hptFmUF3ztxYh3Svg",
191 "url": "https://pleroma.example.org/users/nick2",
195 "application": {"name": "Web", "website": null},
198 "content": "This is :moominmamma: note 0",
199 "created_at": "2019-04-15T15:42:15.000Z",
202 "favourites_count": 1,
203 "id": "9hptFmVJ02khbzYJaS",
204 "in_reply_to_account_id": null,
205 "in_reply_to_id": null,
207 "media_attachments": [],
212 "content": {"text/plain": "This is :moominmamma: note 0"},
213 "conversation_id": 13679,
215 "spoiler_text": {"text/plain": "2hu"}
222 "spoiler_text": "2hu",
223 "tags": [{"name": "2hu", "url": "/tag/2hu"}],
224 "uri": "https://pleroma.example.org/objects/198ed2a1-7912-4482-b559-244a0369e984",
225 "url": "https://pleroma.example.org/notice/9hptFmVJ02khbzYJaS",
226 "visibility": "public"
231 ## `/api/v1/pleroma/accounts/update_*`
232 ### Set and clear account avatar, banner, and background
234 - PATCH `/api/v1/pleroma/accounts/update_avatar`: Set/clear user avatar image
235 - PATCH `/api/v1/pleroma/accounts/update_banner`: Set/clear user banner image
236 - PATCH `/api/v1/pleroma/accounts/update_background`: Set/clear user background image
238 ## `/api/v1/pleroma/accounts/confirmation_resend`
239 ### Resend confirmation email
242 * `email`: email of that needs to be verified
243 * Authentication: not required
244 * Response: 204 No Content
246 ## `/api/v1/pleroma/mascot`
247 ### Gets user mascot image
249 * Authentication: required
251 * Response: JSON. Returns a mastodon media attachment entity.
256 "url": "https://pleroma.example.org/media/abcdefg.png",
259 "mime_type": "image/png"
264 ### Updates user mascot image
266 * Authentication: required
268 * `file`: Multipart image
269 * Response: JSON. Returns a mastodon media attachment entity
270 when successful, otherwise returns HTTP 415 `{"error": "error_msg"}`
275 "url": "https://pleroma.example.org/media/abcdefg.png",
278 "mime_type": "image/png"
282 * Note: Behaves exactly the same as `POST /api/v1/upload`.
283 Can only accept images - any attempt to upload non-image files will be met with `HTTP 415 Unsupported Media Type`.
285 ## `/api/pleroma/notification_settings`
286 ### Updates user notification settings
288 * Authentication: required
290 * `followers`: BOOLEAN field, receives notifications from followers
291 * `follows`: BOOLEAN field, receives notifications from people the user follows
292 * `remote`: BOOLEAN field, receives notifications from people on remote instances
293 * `local`: BOOLEAN field, receives notifications from people on the local instance
294 * `privacy_option`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
295 * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
297 ## `/api/pleroma/healthcheck`
298 ### Healthcheck endpoint with additional system data.
300 * Authentication: not required
302 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
306 "pool_size": 0, # database connection pool
307 "active": 0, # active processes
308 "idle": 0, # idle processes
309 "memory_used": 0.00, # Memory used
310 "healthy": true, # Instance state
311 "job_queue_stats": {} # Job queue stats
315 ## `/api/pleroma/change_email`
316 ### Change account email
318 * Authentication: required
320 * `password`: user's password
322 * Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
323 * Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
325 # Pleroma Conversations
327 Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
329 1. Pleroma Conversations never add or remove recipients, unless explicitly changed by the user.
330 2. Pleroma Conversations statuses can be requested by Conversation id.
331 3. Pleroma Conversations can be replied to.
333 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.
335 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.
337 âš Conversation IDs can be found in direct messages with the `pleroma.direct_conversation_id` key, do not confuse it with `pleroma.conversation_id`.
339 ## `GET /api/v1/pleroma/conversations/:id/statuses`
340 ### Timeline for a given conversation
342 * Authentication: required
343 * Params: Like other timelines
344 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
346 ## `GET /api/v1/pleroma/conversations/:id`
347 ### The conversation with the given ID.
349 * Authentication: required
351 * Response: JSON, statuses (200 - healthy, 503 unhealthy).
353 ## `PATCH /api/v1/pleroma/conversations/:id`
354 ### Update a conversation. Used to change the set of recipients.
356 * Authentication: required
358 * `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.
359 * Response: JSON, statuses (200 - healthy, 503 unhealthy)
361 ## `GET /api/v1/pleroma/conversations/read`
362 ### Marks all user's conversations as read.
364 * Authentication: required
366 * Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
368 ## `GET /api/pleroma/emoji/packs/import`
369 ### Imports packs from filesystem
371 * Authentication: required
373 * Response: JSON, returns a list of imported packs.
375 ## `GET /api/pleroma/emoji/packs/remote`
376 ### Make request to another instance for packs list
378 * Authentication: required
380 * `url`: url of the instance to get packs from
381 * Response: JSON with the pack list, hashmap with pack name and pack contents
383 ## `POST /api/pleroma/emoji/packs/download`
384 ### Download pack from another instance
386 * Authentication: required
388 * `url`: url of the instance to download from
389 * `name`: pack to download from that instance
390 * `as`: (*optional*) name how to save pack
391 * Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
392 errors downloading the pack
394 ## `POST /api/pleroma/emoji/packs/:name`
395 ### Creates an empty pack
397 * Authentication: required
399 * Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
401 ## `PATCH /api/pleroma/emoji/packs/:name`
402 ### Updates (replaces) pack metadata
404 * Authentication: required
406 * `metadata`: metadata to replace the old one
407 * `license`: Pack license
408 * `homepage`: Pack home page url
409 * `description`: Pack description
410 * `fallback-src`: Fallback url to download pack from
411 * `fallback-src-sha256`: SHA256 encoded for fallback pack archive
412 * `share-files`: is pack allowed for sharing (boolean)
413 * Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
414 problem with the new metadata (the error is specified in the "error" part of the response JSON)
416 ## `DELETE /api/pleroma/emoji/packs/:name`
417 ### Delete a custom emoji pack
419 * Authentication: required
421 * Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
423 ## `POST /api/pleroma/emoji/packs/:name/files`
424 ### Add new file to the pack
426 * Authentication: required
428 * `file`: file needs to be uploaded with the multipart request or link to remote file.
429 * `shortcode`: (*optional*) shortcode for new emoji, must be uniq for all emoji. If not sended, shortcode will be taken from original filename.
430 * `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
431 * Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
433 ## `PATCH /api/pleroma/emoji/packs/:name/files`
434 ### Update emoji file from pack
436 * Authentication: required
438 * `shortcode`: emoji file shortcode
439 * `new_shortcode`: new emoji file shortcode
440 * `new_filename`: new filename for emoji file
441 * `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
442 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
444 ## `DELETE /api/pleroma/emoji/packs/:name/files`
445 ### Delete emoji file from pack
447 * Authentication: required
449 * `shortcode`: emoji file shortcode
450 * Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
452 ## `GET /api/pleroma/emoji/packs`
453 ### Lists local custom emoji packs
455 * Authentication: not required
457 * Response: JSON, "ok" and 200 status and the JSON hashmap of pack name to pack contents
459 ## `GET /api/pleroma/emoji/packs/:name`
460 ### Get pack.json for the pack
462 * Authentication: not required
464 * Response: JSON, pack json with `files` and `pack` keys with 200 status or 404 if the pack does not exist
466 ## `GET /api/pleroma/emoji/packs/:name/archive`
467 ### Requests a local pack archive from the instance
469 * Authentication: not required
471 * Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
472 404 if the pack does not exist
474 ## `GET /api/v1/pleroma/accounts/:id/scrobbles`
475 ### Requests a list of current and recent Listen activities for an account
477 * Authentication: not required
479 * Response: An array of media metadata entities.
486 "title": "Some Title",
487 "artist": "Some Artist",
488 "album": "Some Album",
490 "created_at": "2019-09-28T12:40:45.000Z"
495 ## `POST /api/v1/pleroma/scrobble`
496 ### Creates a new Listen activity for an account
498 * Authentication: required
500 * `title`: the title of the media playing
501 * `album`: the album of the media playing [optional]
502 * `artist`: the artist of the media playing [optional]
503 * `length`: the length of the media playing [optional]
504 * Response: the newly created media metadata entity representing the Listen activity
508 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.
510 ## `PUT /api/v1/pleroma/statuses/:id/reactions/:emoji`
511 ### React to a post with a unicode emoji
513 * Authentication: required
514 * Params: `emoji`: A single character unicode emoji
515 * Response: JSON, the status.
517 ## `DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji`
518 ### Remove a reaction to a post with a unicode emoji
520 * Authentication: required
521 * Params: `emoji`: A single character unicode emoji
522 * Response: JSON, the status.
524 ## `GET /api/v1/pleroma/statuses/:id/reactions`
525 ### Get an object of emoji to account mappings with accounts that reacted to the post
527 * Authentication: optional
529 * 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.
533 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]},
534 {"name": "☕", "count": 1, "me": false, "accounts": [{"id" => "abc..."}]}
538 ## `GET /api/v1/pleroma/statuses/:id/reactions/:emoji`
539 ### Get an object of emoji to account mappings with accounts that reacted to the post for a specific emoji`
541 * Authentication: optional
543 * Response: JSON, a list of emoji/account list tuples
547 {"name": "😀", "count": 2, "me": true, "accounts": [{"id" => "xyz.."...}, {"id" => "zyx..."}]}