aboutsummaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-07-15 17:10:27 -0500
committerMark Felder <feld@FreeBSD.org>2019-07-15 17:10:27 -0500
commitffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38 (patch)
treeb397d1192c69a7d089c86d41b6e09e89954ea798 /docs/api
parente912f81c828cc7e1d2c0dff8daed3ad52f407a61 (diff)
parent03bcb40883dafa2886110e2b625c4cc5c21106f1 (diff)
downloadpleroma-ffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38.tar.gz
Merge branch 'develop' into feature/matstodon-statuses-by-name
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/admin_api.md129
-rw-r--r--docs/api/differences_in_mastoapi_responses.md18
-rw-r--r--docs/api/pleroma_api.md21
3 files changed, 136 insertions, 32 deletions
diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md
index b45c5e285..c429da822 100644
--- a/docs/api/admin_api.md
+++ b/docs/api/admin_api.md
@@ -38,7 +38,9 @@ Authentication is required and the user must be an admin.
"moderator": bool
},
"local": bool,
- "tags": array
+ "tags": array,
+ "avatar": string,
+ "display_name": string
},
...
]
@@ -174,13 +176,13 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `nickname`
- `status` BOOLEAN field, false value means deactivation.
-## `/api/pleroma/admin/users/:nickname`
+## `/api/pleroma/admin/users/:nickname_or_id`
### Retrive the details of a user
- Method: `GET`
- Params:
- - `nickname`
+ - `nickname` or `id`
- Response:
- On failure: `Not found`
- On success: JSON of the user
@@ -289,7 +291,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `limit`: optional, the number of records to retrieve
- `since_id`: optional, returns results that are more recent than the specified id
- `max_id`: optional, returns results that are older than the specified id
-- Response:
+- Response:
- On failure: 403 Forbidden error `{"error": "error_msg"}` when requested by anonymous or non-admin
- On success: JSON, returns a list of reports, where:
- `account`: the user who has been reported
@@ -331,6 +333,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
"pleroma": {},
"sensitive": false
},
+ "tags": ["force_unlisted"],
"statuses_count": 3,
"url": "https://pleroma.example.org/users/user",
"username": "user"
@@ -366,6 +369,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
"pleroma": {},
"sensitive": false
},
+ "tags": ["force_unlisted"],
"statuses_count": 1,
"url": "https://pleroma.example.org/users/lain",
"username": "lain"
@@ -443,7 +447,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- Params:
- `id`
- Response:
- - On failure:
+ - On failure:
- 403 Forbidden `{"error": "error_msg"}`
- 404 Not Found `"Not found"`
- On success: JSON, Report object (see above)
@@ -454,8 +458,8 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- Params:
- `id`
- `state`: required, the new state. Valid values are `open`, `closed` and `resolved`
-- Response:
- - On failure:
+- Response:
+ - On failure:
- 400 Bad Request `"Unsupported state"`
- 403 Forbidden `{"error": "error_msg"}`
- 404 Not Found `"Not found"`
@@ -467,10 +471,10 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- Params:
- `id`
- `status`: required, the message
-- Response:
- - On failure:
- - 400 Bad Request `"Invalid parameters"` when `status` is missing
- - 403 Forbidden `{"error": "error_msg"}`
+- Response:
+ - On failure:
+ - 400 Bad Request `"Invalid parameters"` when `status` is missing
+ - 403 Forbidden `{"error": "error_msg"}`
- 404 Not Found `"Not found"`
- On success: JSON, created Mastodon Status entity
@@ -540,10 +544,10 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `id`
- `sensitive`: optional, valid values are `true` or `false`
- `visibility`: optional, valid values are `public`, `private` and `unlisted`
-- Response:
- - On failure:
+- Response:
+ - On failure:
- 400 Bad Request `"Unsupported visibility"`
- - 403 Forbidden `{"error": "error_msg"}`
+ - 403 Forbidden `{"error": "error_msg"}`
- 404 Not Found `"Not found"`
- On success: JSON, Mastodon Status entity
@@ -552,8 +556,99 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- Method `DELETE`
- Params:
- `id`
-- Response:
- - On failure:
- - 403 Forbidden `{"error": "error_msg"}`
+- Response:
+ - On failure:
+ - 403 Forbidden `{"error": "error_msg"}`
- 404 Not Found `"Not found"`
- On success: 200 OK `{}`
+
+## `/api/pleroma/admin/config`
+### List config settings
+- Method `GET`
+- Params: none
+- Response:
+
+```json
+{
+ configs: [
+ {
+ "group": string,
+ "key": string or string with leading `:` for atoms,
+ "value": string or {} or [] or {"tuple": []}
+ }
+ ]
+}
+```
+
+## `/api/pleroma/admin/config`
+### Update config settings
+Module name can be passed as string, which starts with `Pleroma`, e.g. `"Pleroma.Upload"`.
+Atom keys and values can be passed with `:` in the beginning, e.g. `":upload"`.
+Tuples can be passed as `{"tuple": ["first_val", Pleroma.Module, []]}`.
+`{"tuple": ["some_string", "Pleroma.Some.Module", []]}` will be converted to `{"some_string", Pleroma.Some.Module, []}`.
+Keywords can be passed as lists with 2 child tuples, e.g.
+`[{"tuple": ["first_val", Pleroma.Module]}, {"tuple": ["second_val", true]}]`.
+
+Compile time settings (need instance reboot):
+- all settings by this keys:
+ - `:hackney_pools`
+ - `:chat`
+ - `Pleroma.Web.Endpoint`
+ - `Pleroma.Repo`
+- part settings:
+ - `Pleroma.Captcha` -> `:seconds_valid`
+ - `Pleroma.Upload` -> `:proxy_remote`
+ - `:instance` -> `:upload_limit`
+
+- Method `POST`
+- Params:
+ - `configs` => [
+ - `group` (string)
+ - `key` (string or string with leading `:` for atoms)
+ - `value` (string, [], {} or {"tuple": []})
+ - `delete` = true (optional, if parameter must be deleted)
+ ]
+
+- Request (example):
+
+```json
+{
+ configs: [
+ {
+ "group": "pleroma",
+ "key": "Pleroma.Upload",
+ "value": [
+ {"tuple": [":uploader", "Pleroma.Uploaders.Local"]},
+ {"tuple": [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
+ {"tuple": [":link_name", true]},
+ {"tuple": [":proxy_remote", false]},
+ {"tuple": [":proxy_opts", [
+ {"tuple": [":redirect_on_failure", false]},
+ {"tuple": [":max_body_length", 1048576]},
+ {"tuple": [":http": [
+ {"tuple": [":follow_redirect", true]},
+ {"tuple": [":pool", ":upload"]},
+ ]]}
+ ]
+ ]},
+ {"tuple": [":dispatch", {
+ "tuple": ["/api/v1/streaming", "Pleroma.Web.MastodonAPI.WebsocketHandler", []]
+ }]}
+ ]
+ }
+ ]
+}
+
+- Response:
+
+```json
+{
+ configs: [
+ {
+ "group": string,
+ "key": string or string with leading `:` for atoms,
+ "value": string or {} or [] or {"tuple": []}
+ }
+ ]
+}
+```
diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md
index f952696f7..f5a72543a 100644
--- a/docs/api/differences_in_mastoapi_responses.md
+++ b/docs/api/differences_in_mastoapi_responses.md
@@ -16,9 +16,11 @@ Adding the parameter `with_muted=true` to the timeline queries will also return
## Statuses
+- `visibility`: has an additional possible value `list`
+
Has these additional fields under the `pleroma` object:
-- `local`: true if the post was made on the local instance.
+- `local`: true if the post was made on the local instance
- `conversation_id`: the ID of the conversation the status is associated with (if any)
- `in_reply_to_account_acct`: the `acct` property of User entity for replied user (if any)
- `content`: a map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`
@@ -46,6 +48,8 @@ Has these additional fields under the `pleroma` object:
- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated
- `hide_followers`: boolean, true when the user has follower hiding enabled
- `hide_follows`: boolean, true when the user has follow hiding enabled
+- `settings_store`: A generic map of settings for frontends. Opaque to the backend. Only returned in `verify_credentials` and `update_credentials`
+- `chat_token`: The token needed for Pleroma chat. Only returned in `verify_credentials`
### Source
@@ -72,6 +76,8 @@ Additional parameters can be added to the JSON body/Form data:
- `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example.
- `content_type`: string, contain the MIME type of the status, it is transformed into HTML by the backend. You can get the list of the supported MIME types with the nodeinfo endpoint.
+- `to`: A list of nicknames (like `lain@soykaf.club` or `lain` on the local server) that will be used to determine who is going to be addressed by this post. Using this will disable the implicit addressing by mentioned names in the `status` body, only the people in the `to` list will be addressed. The normal rules for for post visibility are not affected by this and will still apply.
+- `visibility`: string, besides standard MastoAPI values (`direct`, `private`, `unlisted` or `public`) it can be used to address a List by setting it to `list:LIST_ID`.
## PATCH `/api/v1/update_credentials`
@@ -83,6 +89,16 @@ Additional parameters can be added to the JSON body/Form data:
- `hide_favorites` - if true, user's favorites timeline will be hidden
- `show_role` - if true, user's role (e.g admin, moderator) will be exposed to anyone in the API
- `default_scope` - the scope returned under `privacy` key in Source subentity
+- `pleroma_settings_store` - Opaque user settings to be saved on the backend.
+- `skip_thread_containment` - if true, skip filtering out broken threads
+- `pleroma_background_image` - sets the background image of the user.
+
+### Pleroma Settings Store
+Pleroma has mechanism that allows frontends to save blobs of json for each user on the backend. This can be used to save frontend-specific settings for a user that the backend does not need to know about.
+
+The parameter should have a form of `{frontend_name: {...}}`, with `frontend_name` identifying your type of client, e.g. `pleroma_fe`. It will overwrite everything under this property, but will not overwrite other frontend's settings.
+
+This information is returned in the `verify_credentials` endpoint.
## Authentication
diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md
index 4d99a2d2b..d83ebd734 100644
--- a/docs/api/pleroma_api.md
+++ b/docs/api/pleroma_api.md
@@ -126,20 +126,6 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi
## `/api/pleroma/admin/`…
See [Admin-API](Admin-API.md)
-## `/api/v1/pleroma/flavour/:flavour`
-* Method `POST`
-* Authentication: required
-* Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}`
-* Example response: "glitch"
-* Note: This is intended to be used only by mastofe
-
-## `/api/v1/pleroma/flavour`
-* Method `GET`
-* Authentication: required
-* Response: JSON string. Returns the user flavour or the default one.
-* Example response: "glitch"
-* Note: This is intended to be used only by mastofe
-
## `/api/pleroma/notifications/read`
### Mark a single notification as read
* Method `POST`
@@ -252,6 +238,13 @@ See [Admin-API](Admin-API.md)
]
```
+## `/api/v1/pleroma/accounts/update_*`
+### Set and clear account avatar, banner, and background
+
+- PATCH `/api/v1/pleroma/accounts/update_avatar`: Set/clear user avatar image
+- PATCH `/api/v1/pleroma/accounts/update_banner`: Set/clear user banner image
+- PATCH `/api/v1/pleroma/accounts/update_background`: Set/clear user background image
+
## `/api/v1/pleroma/mascot`
### Gets user mascot image
* Method `GET`