Merge branch 'develop' into 'develop'
[akkoma] / docs / Pleroma-API.md
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 * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}`
56 * Example response:
57 ```
58 {
59 "background_image": null,
60 "cover_photo": "https://pleroma.soykaf.com/images/banner.png",
61 "created_at": "Tue Dec 18 16:55:56 +0000 2018",
62 "default_scope": "public",
63 "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.",
64 "description_html": "blushy-crushy fediverse idol + pleroma dev.<br />let's be friends <br />ぷれろまの生徒会長。謎の外人。日本語OK. <br />公主病.",
65 "favourites_count": 0,
66 "fields": [],
67 "followers_count": 0,
68 "following": false,
69 "follows_you": false,
70 "friends_count": 0,
71 "id": 6,
72 "is_local": true,
73 "locked": false,
74 "name": "lain",
75 "name_html": "lain",
76 "no_rich_text": false,
77 "pleroma": {
78 "tags": []
79 },
80 "profile_image_url": "https://pleroma.soykaf.com/images/avi.png",
81 "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png",
82 "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png",
83 "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png",
84 "rights": {
85 "delete_others_notice": false
86 },
87 "screen_name": "lain",
88 "statuses_count": 0,
89 "statusnet_blocking": false,
90 "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain"
91 }
92 ```
93
94 ## `/api/pleroma/admin/`…
95 See [Admin-API](Admin-API.md)