Pleroma-API.md (4536B)
1 # Pleroma API 2 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). 4 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`. 6 7 ## `/api/pleroma/emoji` 8 ### Lists the custom emoji on that server. 9 * Method: `GET` 10 * Authentication: not required 11 * Params: none 12 * Response: JSON 13 * Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` 14 * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format 15 16 ## `/api/pleroma/follow_import` 17 ### Imports your follows, for example from a Mastodon CSV file. 18 * Method: `POST` 19 * Authentication: required 20 * Params: 21 * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow 22 * Response: HTTP 200 on success, 500 on error 23 * Note: Users that can't be followed are silently skipped. 24 25 ## `/api/pleroma/captcha` 26 ### Get a new captcha 27 * Method: `GET` 28 * Authentication: not required 29 * Params: none 30 * Response: Provider specific JSON, the only guaranteed parameter is `type` 31 * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` 32 33 ## `/api/pleroma/delete_account` 34 ### Delete an account 35 * Method `POST` 36 * Authentication: required 37 * Params: 38 * `password`: user's password 39 * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise 40 * Example response: `{"error": "Invalid password."}` 41 42 ## `/api/account/register` 43 ### Register a new user 44 * Method `POST` 45 * Authentication: not required 46 * Params: 47 * `nickname` 48 * `fullname` 49 * `bio` 50 * `email` 51 * `password` 52 * `confirm` 53 * `captcha_solution`: optional, contains provider-specific captcha solution, 54 * `captcha_token`: optional, contains provider-specific captcha token 55 * `token`: invite token required when the registerations aren't public. 56 * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` 57 * Example response: 58 ``` 59 { 60 "background_image": null, 61 "cover_photo": "https://pleroma.soykaf.com/images/banner.png", 62 "created_at": "Tue Dec 18 16:55:56 +0000 2018", 63 "default_scope": "public", 64 "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.", 65 "description_html": "blushy-crushy fediverse idol + pleroma dev.<br />let's be friends <br />ぷれろまの生徒会長。謎の外人。日本語OK. <br />公主病.", 66 "favourites_count": 0, 67 "fields": [], 68 "followers_count": 0, 69 "following": false, 70 "follows_you": false, 71 "friends_count": 0, 72 "id": 6, 73 "is_local": true, 74 "locked": false, 75 "name": "lain", 76 "name_html": "lain", 77 "no_rich_text": false, 78 "pleroma": { 79 "tags": [] 80 }, 81 "profile_image_url": "https://pleroma.soykaf.com/images/avi.png", 82 "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png", 83 "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png", 84 "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png", 85 "rights": { 86 "delete_others_notice": false 87 }, 88 "screen_name": "lain", 89 "statuses_count": 0, 90 "statusnet_blocking": false, 91 "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" 92 } 93 ``` 94 95 ## `/api/pleroma/admin/`… 96 See [Admin-API](Admin-API.md) 97 98 ## `/api/v1/pleroma/flavour/:flavour` 99 * Method `POST` 100 * Authentication: required 101 * Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}` 102 * Example response: "glitch" 103 * Note: This is intended to be used only by mastofe 104 105 ## `/api/v1/pleroma/flavour` 106 * Method `GET` 107 * Authentication: required 108 * Response: JSON string. Returns the user flavour or the default one. 109 * Example response: "glitch" 110 * Note: This is intended to be used only by mastofe 111 112 ## `/api/pleroma/notifications/read` 113 ### Mark a single notification as read 114 * Method `POST` 115 * Authentication: required 116 * Params: 117 * `id`: notifications's id 118 * Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}`