ActivityPub
A decentralized social networking protocol based upon the ActivityStreams 2.0 data format and JSON-LD.
Last updated
Was this helpful?
A decentralized social networking protocol based upon the ActivityStreams 2.0 data format and JSON-LD.
Last updated
Was this helpful?
Sample payloads will be added at a future date.
Create = transformed into a status and saved into database
Delete = removes a status from the database
Like = transformed into a favourite on a status
Announce = transformed into a boost on a status
Flag = transformed into a report to the moderation team.
Update = only supported on polls. Used to refresh vote count.
Undo = undo a previous Like or Announce.
The first-class Object types supported by Mastodon are Note
and Question
.
Notes are transformed into regular statuses.
Questions are transformed into a poll status.
Some other Object types are converted as best as possible. The transformer uses content
if available, or name
if not, in order to generate status text. The url
will be appended. The summary
property will be used as the CW text.
Article
Page
Image
Audio
Video
Event
Follow = Indicate interest in receiving status updates from a profile.
Accept/Reject = used to approve or deny Follow activities. Unlocked accounts will automatically reply with an Accept, while locked accounts can manually choose whether to approve or deny a follow request.
Add/Remove = manage pinned posts and featured collections.
Block = Signal to a remote server that they should hide your profile from that user. Not guaranteed.
Flag = report user
Update = refresh account details
Move = migrate followers from one account to another. Requires alsoKnownAs to be set in both directions.
Delete = remove an account from the database, as well as all of their statuses.
Undo = undo a previous Follow, Accept Follow, or Block.
Property
Interpretation
preferredUsername
Used for Webfinger lookup. Must be unique on the domain, and must correspond to a Webfinger acct:
URI.
name
Used as profile display name.
summary
Used as profile bio.
type
Assumed to be Person. If type is Application or Service, it will be interpreted as a bot flag.
url
Used as profile link.
icon
Used as profile avatar.
image
Used as profile header.
manuallyApprovesFollowers
Will be shown as a locked account.
discoverable
publicKey
featured
attachment
alsoKnownAs
Required for Move activity.
Mastodon sanitizes incoming HTML in order to not break assumptions for API client developers. Supported elements include <p>
, <span>
, <br>
, and <a>
. Unsupported elements will be converted to <p>
.The sanitizer will keep classes if they begin with microformats prefixes or are semantic classes:
h-*
p-*
u-*
dt-*
e-*
mention
hashtag
ellipsis
invisible
toot:
)Contains definitions for Mastodon features.
toot:Emoji
toot:IdentityProof
toot:blurhash
toot:focalPoint
toot:featured
toot:discoverable
toot:votersCount
as:
)Contains ActivityStreams extended properties that have been proposed but not officially adopted yet.
as:Hashtag
as:alsoKnownAs
as:manuallyApprovesFollowers
as:movedTo
as:sensitive
sec:
)sec:publicKey
sec:publicKeyPem
sec:owner
sec:signature
sec:signatureValue
Contains a collection of terms from various namespaces, used for Linked Data Signatures.
dc:creator
dc:created
sec:signature
sec:signatureValue
schema:
)Contains properties used for profile metadata.
schema:PropertyValue
schema:value
What is known in Mastodon as “pinned toots”, or statuses that are always featured at the top of people’s profiles, is implemented using an extra property featured
on the actor object that points to a Collection
of objects. Example:
Mastodon supports arbitrary emojis, that is, small images uploaded by admins and invokable via shortcodes. For this, an Emoji
type is used. These emojis are listed in the tag
property just like Mention
and Hashtag
objects, since they are entities that affect how the text is rendered. Example:
Mastodon supports arbitrary profile fields containing name-value pairs. This is implemented using the attachment
property on actor objects, with objects in the array having a type of PropertyValue
and a value
property, both from the schema.org namespace. Example:
Mastodon supports integration with identity providers to prove that a profile is linked to a certain identity. This is implemented using the attachment
property on actor objects, with objects in the array having a type of IdentityProof
from the Mastodon namespace. The object also includes signatureAlgorithm
and signatureValue
from the W3ID Security Vocabulary namespace. Example:
Mastodon allows users to opt-in or opt-out of discoverability features like the profile directory. This flag may also be used as an indicator of the user's preferences toward being included in external discovery services, such as search engines or other indexing tools. If you are implementing such a tool, it is recommended that you respect this property if it is present. This is implemented using an extra property discoverable
on objects. Example:
Will be shown in the profile directory. See .
Required for signatures. See .
Pinned posts. See .
Used for profile fields. See and .
Contains properties used for HTTPS Signatures and Linked Data Signatures. Also used for identity proofs. See for more information.
Public keys are used for HTTPS Signatures and Linked Data Signatures. This is implemented using an extra property publicKey
on actor objects. See for more information. Example:
Mastodon supports setting a focal point on uploaded images, so that wherever that image is displayed, the focal point stays in view. This is implemented using an extra property focalPoint
on Image
objects. The property is simply an array of two floating points between -1.0 and 1.0, with 0,0 being the center of the image, the first value being x (-1.0 is the left edge, +1.0 is the right edge) and the second value being y (-1.0 is the bottom edge, +1.0 is the top edge). See for more information. Example:
Mastodon generates colorful preview thumbnails for attachments. This is implemented using an extra property blurhash
on Image
objects. The property is a string generated by the . Example: