20 KiB
Mastodon API
Overview
Friendica provides the following endpoints defined in the official Mastodon API reference.
Authentication is the same as described in Using the APIs.
Clients
Supported apps
For supported apps please have a look at the FAQ
Unsupported apps
Android
- Fedilab Automatically uses the legacy API, see issue: https://framagit.org/tom79/fedilab/-/issues/520
- Mammut There are problems with the token request, see issue https://github.com/jamiesanson/Mammut/issues/19
iOS
- Mast Doesn't accept the entered instance name. Claims that it is invalid (Message is: "Not a valid instance (may be closed or dead)")
- Toot!
Entities
These endpoints use the Mastodon API entities. With some additional extensions listed below.
Instance (Version 2) Entities
Extensions to the Mastodon Instance::V2 Entities
friendica: Friendica specific properties of the V2 Instance including:version: The Friendica version stringcodename: The Friendica version code namedb_version: The database schema version number
Example:
{
"domain": "friendicadevtest1.myportal.social",
"title": "Friendica Social Network",
"version": "2.8.0 (compatible; Friendica 2023.03-dev)",
...
"friendica": {
"version": "2023.03-dev",
"codename": "Giant Rhubarb",
"db_version": 1516
}
}
Notification Entities
Extensions to the Mastodon Notification Entities
dismissed: whether the object has been dismissed or not
Status Entities
Extensions to the Mastodon Status Entities
in_reply_to_status: A fully populated Mastodon Status entity for the replied to status or null it is a post rather than a responsefriendica: Friendica specific properties of a status including:title: The Friendica title for a post, or empty if the status is a commentdelivery_data: Information about the state of federating a message from the serverdelivery_queue_count: Total number of remote servers that the status needs to be federated to.delivery_queue_done: Total number of remote servers that have successfully been federated to so far.delivery_queue_failed: Total number of remote servers that have we failed to federate to so far.
dislikes_count: The number of dislikes that a status has accumulated according to the server.disliked: Whether the API user disliked the status.
Example:
{
"id": "358",
"created_at": "2023-02-23T02:45:46.000Z",
"in_reply_to_id": "356",
"in_reply_to_status": {
"id": "356",
"created_at": "2023-02-23T02:45:35.000Z",
"in_reply_to_id": null,
"in_reply_to_status": null,
"in_reply_to_account_id": null,
...
"content": "A post from testuser1",
...
"account": {
"id": "6",
"username": "testuser1",
"acct": "testuser1",
"display_name": "testuser1",
...
},
...
"friendica": {
"title": "",
"dislikes_count": 0
}
},
"in_reply_to_account_id": "6",
...
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
...
"content": "A reply from testuser2",
...
"account": {
"id": "8",
"username": "testuser2",
"acct": "testuser2",
"display_name": "testuser2",
...
},
...
"friendica": {
"title": "",
"delivery_data": {
"delivery_queue_count": 10,
"delivery_queue_done": 3,
"delivery_queue_failed": 0
},
"dislikes_count": 0
}
}
Implemented endpoints
-
- Doesn't return unicode emojis since they aren't using an image URL
-
- Returned IDs are specific to follow requests
-
POST /api/v1/follow_requests/:id/authorize:idis a follow request ID, not a regular account id
-
POST /api/v1/follow_requests/:id/reject:idis a follow request ID, not a regular account id
-
POST /api/v1/follow_requests/:id/ignore- Friendica-specific, hides the follow request from the list and prevents the remote contact from retrying.
:idis a follow request ID, not a regular account id- Returns a Relationship object.
-
GET /api/v1/instance/rulesUndocumented, returns Terms of Service -
- Additional field
include_allto return read and unread statuses, defaults tofalse - Additional field
summaryreturns a count of all of the statuses that match the type filter - Additional field
with_mutedPleroma extension to return notifications from muted users, defaults tofalse - Does not support the
typefield, which is the mirror image of the supportedexclude_typesfield
- Additional field
-
- Does not support
pollsargument as Friendica does not have polls - Additional fields
friendicafor Friendica specific parameters:title: Explicitly sets the title for a post status, ignored if used on a comment status. For post statuses the legacy behavior is to use any "spoiler text" as the title if it is provided. If both the title and spoiler text are provided for a post status then they will each be used for their respective roles. If no title is provided then the legacy behavior will persist. If you want to create a post with no title but spoiler text then explicitly set the title but set it to an empty string"".
- Does not support
-
- Does not support
pollsargument as Friendica does not have polls - Additionally to the static values
public,unlistedandprivate, thevisibilityparameter can contain a numeric value with a group id. - Additional field
quote_idfor the post that is being quote reshared - Additional fields
friendicafor Friendica specific parameters:title: Explicitly sets the title for a post status, ignored if used on a comment status. For post statuses the legacy behavior is to use any "spoiler text" as the title if it is provided. If both the title and spoiler text are provided for a post status then they will each be used for their respective roles. If no title is provided then the legacy behavior will persist. If you want to create a post with no title but spoiler text then explicitly set the title but set it to an empty string"".
- Does not support
-
GET /api/v1/statuses/:id/context- Additional support for paging using
min_id,max_id,since_idparameters - Additional support for previous/next Link Headers to support paging
- Additional flag
show_allto allow including posts from blocked and ignored/muted users, defaults tofalse
- Additional support for paging using
-
- Additional field
with_mutedPleroma extension to return notifications from muted users, defaults tofalse - Additional field
exclude_repliesto only return post statuses not replies/comments, defaults tofalse
- Additional field
-
GET /api/v1/timelines/list/:id- Additional field
with_mutedPleroma extension to return notifications from muted users, defaults tofalse - Additional field
exclude_repliesto only return post statuses not replies/comments, defaults tofalse
- Additional field
-
- Additional field
with_mutedPleroma extension to return notifications from muted users, defaults tofalse - Additional field
exclude_repliesto only return post statuses not replies/comments, defaults tofalse
- Additional field
-
GET /api/v1/timelines/tag/:hashtag- Additional field
with_mutedPleroma extension to return notifications from muted users, defaults tofalse - Additional field
exclude_repliesto only return post statuses not replies/comments, defaults tofalse - Does not support the
any[],all[], ornone[]query parameters
- Additional field
-
- Additional field
friendica_localto return local trending tags instead of global tags, defaults tofalse
- Additional field
Currently unimplemented endpoints
These emdpoints are planned to be implemented somewhere in the future.
POST /api/v1/accounts/:id/remove_from_followersGET /api/v1/accounts/familiar_followersGET /api/v1/accounts/lookupPOST /api/v1/polls/:id/votesGET /api/v1/featured_tagsPOST /api/v1/featured_tagsDELETE /api/v1/featured_tags/:id
Dummy endpoints
These endpoints are returning empty data to avoid error messages when using third party clients. They refer to features that don't exist in Friendica yet.
GET /api/v1/accounts/:id/identity_proofsGET /api/v1/announcementsGET /api/v1/endorsementsGET /api/v1/filters
Non supportable endpoints
These endpoints won't be implemented at the moment. They refer to features or data that don't exist in Friendica yet.
POST /api/metaMisskey API endpoint.POST /api/v1/accountsGET /api/v1/accounts/:id/featured_tagsPOST /api/v1/accounts/:id/pinPOST /api/v1/accounts/:id/unpinGET /api/v1/admin/accountsGET /api/v1/admin/accounts/:idPOST /api/v1/admin/accounts/:id/{action}GET /api/v1/admin/reportsGET /api/v1/admin/reports/:idPOST /api/v1/admin/reports/:id/{action}POST /api/v1/announcements/:id/dismissPUT /api/v1/announcements/:id/reactions/{name}DELETE /api/v1/announcements/:id/reactions/{name}GET /api/v1/domain_blocksPOST /api/v1/domain_blocksDELETE /api/v1/domain_blocksDELETE /api/v1/emails/confirmationsGET /api/v1/featured_tags/suggestionsGET /api/v1/filters/:idPOST /api/v1/filters/:idPUT /api/v1/filters/:idDELETE /api/v1/filters/:idGET /api/v1/instance/activityPOST /api/v1/markersPUT /api/v1/scheduled_statuses/:idGET /api/v1/statuses/{id:\d+}/historyGET /api/v1/streamingDELETE /api/v1/suggestions/:id