Lemmy Federation Protocol
The Lemmy Protocol (or Lemmy Federation Protocol) is a subset of the ActivityPub Protocol, with some extensions.
This document is targeted at developers who are familiar with the ActivityPub and ActivityStreams protocols. It gives a detailed outline of the actors, objects and activities used by Lemmy.
Before reading this, have a look at our Federation Overview to get an idea how Lemmy federation works on a high level.
- Context
- Actors
- Objects
- Collections
- Activities
Context
[
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"lemmy": "https://join-lemmy.org/ns#",
"litepub": "http://litepub.social/ns#",
"pt": "https://joinpeertube.org/ns#",
"sc": "http://schema.org/",
"ChatMessage": "litepub:ChatMessage",
"commentsEnabled": "pt:commentsEnabled",
"sensitive": "as:sensitive",
"matrixUserId": "lemmy:matrixUserId",
"posting_restricted_to_mods": "lemmy:posting_restricted_to_mods",
"remove_data": "lemmy:remove_data",
"stickied": "lemmy:stickied",
"moderators": {
"@type": "@id",
"@id": "lemmy:moderators"
},
"expires": "as:endTime",
"distinguished": "lemmy:distinguished",
"language": "sc:inLanguage"
}
]
The context is identical for all activities and objects.
Actors
Community
An automated actor. Users can send posts or comments to it, which the community forwards to its followers in the form of Announce
.
Sends activities to user: Accept/Follow
, Announce
Receives activities from user: Follow
, Undo/Follow
, Create
, Update
, Like
, Dislike
, Remove
(only admin/mod), Delete
(only creator), Undo
(only for own actions)
{
"id": "https://enterprise.lemmy.ml/c/tenforward",
"type": "Group",
"preferredUsername": "main",
"name": "Ten Forward",
"summary": "<p>Lounge and recreation facility</p>\n<hr />\n<p>Welcome to the <a href=\"https://memory-alpha.fandom.com/wiki/USS_Enterprise_(NCC-1701-D)\">Enterprise</a>!.</p>\n",
"source": {
"content": "Lounge and recreation facility\n\n---\n\nWelcome to the [Enterprise](https://memory-alpha.fandom.com/wiki/USS_Enterprise_(NCC-1701-D))!.",
"mediaType": "text/markdown"
},
"sensitive": false,
"icon": {
"type": "Image",
"url": "https://enterprise.lemmy.ml/pictrs/image/waqyZwLAy4.webp"
},
"image": {
"type": "Image",
"url": "https://enterprise.lemmy.ml/pictrs/image/Wt8zoMcCmE.jpg"
},
"inbox": "https://enterprise.lemmy.ml/c/tenforward/inbox",
"followers": "https://enterprise.lemmy.ml/c/tenforward/followers",
"moderators": "https://enterprise.lemmy.ml/c/tenforward/moderators",
"attributedTo": "https://enterprise.lemmy.ml/c/tenforward/moderators",
"postingRestrictedToMods": false,
"endpoints": {
"sharedInbox": "https://enterprise.lemmy.ml/inbox"
},
"outbox": "https://enterprise.lemmy.ml/c/tenforward/outbox",
"publicKey": {
"id": "https://enterprise.lemmy.ml/c/tenforward#main-key",
"owner": "https://enterprise.lemmy.ml/c/tenforward",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzRjKTNtvDCmugplwEh+g\nx1bhKm6BHUZfXfpscgMMm7tXFswSDzUQirMgfkxa9ubfr1PDFKffA2vQ9x6CyuO/\n70xTafdOHyV1tSqzgKz0ZvFZ/VCOo6qy1mYWVkrtBm/fKzM+87MdkKYB/zI4VyEJ\nLfLQgjwxBAEYUH3CBG71U0gO0TwbimWNN0vqlfp0QfThNe1WYObF88ZVzMLgFbr7\nRHBItZjlZ/d8foPDidlIR3l2dJjy0EsD8F9JM340jtX7LXqFmU4j1AQKNHTDLnUF\nwYVhzuQGNJ504l5LZkFG54XfIFT7dx2QwuuM9bSnfPv/98RYrq1Si6tCkxEt1cVe\n4wIDAQAB\n-----END PUBLIC KEY-----\n"
},
"language": [
{
"identifier": "fr",
"name": "Français"
},
{
"identifier": "de",
"name": "Deutsch"
}
],
"published": "2019-06-02T16:43:50.799554+00:00",
"updated": "2021-03-10T17:18:10.498868+00:00"
}
Field Name | Description |
---|---|
preferredUsername | Name of the actor |
name | Title of the community |
sensitive | True indicates that all posts in the community are nsfw |
attributedTo | First the community creator, then all the remaining moderators |
content | Text for the community sidebar, usually containing a description and rules |
icon | Icon, shown next to the community name |
image | Banner image, shown on top of the community page |
inbox | ActivityPub inbox URL |
outbox | ActivityPub outbox URL, only contains up to 20 latest posts, no comments, votes or other activities |
followers | Follower collection URL, only contains the number of followers, no references to individual followers |
endpoints | Contains URL of shared inbox |
published | Datetime when the community was first created |
updated | Datetime when the community was last changed |
publicKey | The public key used to verify signatures from this actor |
User
A person, interacts primarily with the community where it sends and receives posts/comments. Can also create and moderate communities, and send private messages to other users.
Sends activities to Community: Follow
, Undo/Follow
, Create
, Update
, Like
, Dislike
, Remove
(only admin/mod), Delete
(only creator), Undo
(only for own actions)
Receives activities from Community: Accept/Follow
, Announce
Sends and receives activities from/to other users: Create/Note
, Update/Note
, Delete/Note
, Undo/Delete/Note
(all those related to private messages)
{
"id": "https://enterprise.lemmy.ml/u/picard",
"type": "Person",
"preferredUsername": "picard",
"name": "Jean-Luc Picard",
"summary": "<p>Captain of the starship <strong>Enterprise</strong>.</p>\n",
"source": {
"content": "Captain of the starship **Enterprise**.",
"mediaType": "text/markdown"
},
"icon": {
"type": "Image",
"url": "https://enterprise.lemmy.ml/pictrs/image/ed9ej7.jpg"
},
"image": {
"type": "Image",
"url": "https://enterprise.lemmy.ml/pictrs/image/XenaYI5hTn.png"
},
"matrixUserId": "@picard:matrix.org",
"inbox": "https://enterprise.lemmy.ml/u/picard/inbox",
"outbox": "https://enterprise.lemmy.ml/u/picard/outbox",
"endpoints": {
"sharedInbox": "https://enterprise.lemmy.ml/inbox"
},
"published": "2020-01-17T01:38:22.348392+00:00",
"updated": "2021-08-13T00:11:15.941990+00:00",
"publicKey": {
"id": "https://enterprise.lemmy.ml/u/picard#main-key",
"owner": "https://enterprise.lemmy.ml/u/picard",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0lP99/s5Vv+XbPdkeqIJ\nwoD4GFnHmBnBHdEKChEUWfWj1TtioC/rGNoXFQeXQA3Amhy4nxSceiDnUgwkkuQY\nv0MtIW58NzgknEavtllxL+LSds5pg3gANaDIk8UiWTkqXTg0GnlJMpCK1Chen0l/\nszL6DEvUyTSuS5ZYDXFgewF89Pe7U0S15V5U2Harv7AgJYDyxmUL0D1pGuUCRqcE\nl5MTHJjrXeNnH1w2g8aly8YlO/Cr0L51rFg/lBF23vni7ZLv8HbmWh6YpaAf1R8h\nE45zKR7OHqymdjzrg1ITBwovefpwMkVgnJ+Wdr4HPnFlBSkXPoZeM11+Z8L0anzA\nXwIDAQAB\n-----END PUBLIC KEY-----\n"
}
}
Field Name | Description |
---|---|
preferredUsername | Name of the actor |
name | The user's displayname |
content | User bio |
icon | The user's avatar, shown next to the username |
image | The user's banner, shown on top of the profile |
inbox | ActivityPub inbox URL |
endpoints | Contains URL of shared inbox |
published | Datetime when the user signed up |
updated | Datetime when the user profile was last changed |
publicKey | The public key used to verify signatures from this actor |
The user inbox is not actually implemented yet, and is only a placeholder for ActivityPub implementations which require it.
Instance
Represents a Lemmy instance, and is used to federate global data like the instance description or site bans. It can be fetched from the root path.
{
"type": "Application",
"id": "https://enterprise.lemmy.ml/",
"name": "Enterprise",
"summary": "A test instance",
"content": "<p>Enterprise sidebar</p>\\n",
"mediaType": "text/html",
"source": {
"content": "Enterprise sidebar",
"mediaType": "text/markdown"
},
"inbox": "https://enterprise.lemmy.ml/inbox",
"outbox": "https://enterprise.lemmy.ml/outbox",
"publicKey": {
"id": "https://enterprise.lemmy.ml/#main-key",
"owner": "https://enterprise.lemmy.ml/",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAupcK0xTw5yQb/fnztAmb\n9LfPbhJJP1+1GwUaOXGYiDJD6uYJhl9CLmgztLl3RyV9ltOYoN8/NLNDfOMmgOjd\nrsNWEjDI9IcVPmiZnhU7hsi6KgQvJzzv8O5/xYjAGhDfrGmtdpL+lyG0B5fQod8J\n/V5VWvTQ0B0qFrLSBBuhOrp8/fTtDskdtElDPtnNfH2jn6FgtLOijidWwf9ekFo4\n0I1JeuEw6LuD/CzKVJTPoztzabUV1DQF/DnFJm+8y7SCJa9jEO56Uf9eVfa1jF6f\ndH6ZvNJMiafstVuLMAw7C/eNJy3ufXgtZ4403oOKA0aRSYf1cc9pHSZ9gDE/mevH\nLwIDAQAB\n-----END PUBLIC KEY-----\n"
},
"language": [
{
"identifier": "fr",
"name": "Français"
},
{
"identifier": "es",
"name": "Español"
}
],
"published": "2022-01-19T21:52:11.110741+00:00"
}
Field Name | Description |
---|---|
name | Instance name |
summary | Short description |
content | Long description (sidebar) |
icon | Instance icon |
image | Instance banner |
inbox | ActivityPub inbox URL |
endpoints | Contains URL of shared inbox |
published | Datetime when the instance was created |
updated | Datetime when the instance metadata |
publicKey | The public key used to verify signatures from this actor |
Objects
Post
A page with title, and optional URL and text content. The URL often leads to an image, in which case a thumbnail is included. Each post belongs to exactly one community.
{
"id": "https://enterprise.lemmy.ml/post/55143",
"type": "Page",
"attributedTo": "https://enterprise.lemmy.ml/u/picard",
"to": [
"https://enterprise.lemmy.ml/c/tenforward",
"https://www.w3.org/ns/activitystreams#Public"
],
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"name": "Post title",
"content": "<p>This is a post in the /c/tenforward community</p>\n",
"mediaType": "text/html",
"source": {
"content": "This is a post in the /c/tenforward community",
"mediaType": "text/markdown"
},
"attachment": [
{
"type": "Link",
"href": "https://enterprise.lemmy.ml/pictrs/image/eOtYb9iEiB.png"
}
],
"image": {
"type": "Image",
"url": "https://enterprise.lemmy.ml/pictrs/image/eOtYb9iEiB.png"
},
"sensitive": false,
"commentsEnabled": true,
"stickied": true,
"language": {
"identifier": "fr",
"name": "Français"
},
"published": "2021-02-26T12:35:34.292626+00:00"
}
Field Name | Description |
---|---|
attributedTo | ID of the user which created this post |
to | ID of the community where it was posted to |
name | Title of the post |
content | Body of the post |
url | An arbitrary link to be shared |
image | Thumbnail for url , only present if it is an image link |
commentsEnabled | False indicates that the post is locked, and no comments can be added |
sensitive | True marks the post as NSFW, blurs the thumbnail and hides it from users with NSFW settign disabled |
stickied | True means that it is shown on top of the community |
published | Datetime when the post was created |
updated | Datetime when the post was edited (not present if it was never edited) |
Comment
A reply to a post, or reply to another comment. Contains only text (including references to other users or communities). Lemmy displays comments in a tree structure.
{
"id": "https://enterprise.lemmy.ml/comment/38741",
"type": "Note",
"attributedTo": "https://enterprise.lemmy.ml/u/picard",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": [
"https://enterprise.lemmy.ml/c/tenforward",
"https://enterprise.lemmy.ml/u/picard"
],
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"inReplyTo": "https://enterprise.lemmy.ml/post/55143",
"content": "<p>first comment!</p>\n",
"mediaType": "text/html",
"source": {
"content": "first comment!",
"mediaType": "text/markdown"
},
"tag": [
{
"href": "https://enterprise.lemmy.ml/u/picard",
"type": "Mention",
"name": "@picard@enterprise.lemmy.ml"
}
],
"distinguished": false,
"language": {
"identifier": "fr",
"name": "Français"
},
"published": "2021-03-01T13:42:43.966208+00:00",
"updated": "2021-03-01T13:43:03.955787+00:00"
}
Field Name | Description |
---|---|
attributedTo | ID of the user who created the comment |
to | Community where the comment was made |
content | The comment text |
inReplyTo | IDs of the post where this comment was made, and the parent comment. If this is a top-level comment, inReplyTo only contains the post |
published | Datetime when the comment was created |
updated | Datetime when the comment was edited (not present if it was never edited) |
Private Message
A direct message from one user to another. Can not include additional users. Threading is not implemented yet, so the inReplyTo
field is missing.
{
"id": "https://enterprise.lemmy.ml/private_message/1621",
"type": "ChatMessage",
"attributedTo": "https://enterprise.lemmy.ml/u/picard",
"to": [
"https://queer.hacktivis.me/users/lanodan"
],
"content": "<p>Hello hello, testing</p>\n",
"mediaType": "text/html",
"source": {
"content": "Hello hello, testing",
"mediaType": "text/markdown"
},
"published": "2021-10-21T10:13:14.597721+00:00"
}
Field Name | Description |
---|---|
attributedTo | ID of the user who created this private message |
to | ID of the recipient |
content | The text of the private message |
published | Datetime when the message was created |
updated | Datetime when the message was edited (not present if it was never edited) |
Collections
Community Outbox
{
"type":"OrderedCollection",
"id":"https://ds9.lemmy.ml/c/testcom/outbox",
"totalItems":2,
"orderedItems":[
{
"actor":"https://ds9.lemmy.ml/c/testcom",
"to":[
"https://www.w3.org/ns/activitystreams#Public"
],
"object":{
"actor":"https://ds9.lemmy.ml/u/nutomic",
"to":[
"https://www.w3.org/ns/activitystreams#Public"
],
"cc":[
"https://ds9.lemmy.ml/c/testcom"
],
"type":"Create",
"id":"http://ds9.lemmy.ml/activities/create/eee6a57a-622f-464d-b560-73ae1fcd3ddf",
"object":{
"type":"Page",
"id":"https://ds9.lemmy.ml/post/2328",
"attributedTo":"https://ds9.lemmy.ml/u/nutomic",
"to":[
"https://ds9.lemmy.ml/c/testcom",
"https://www.w3.org/ns/activitystreams#Public"
],
"name":"another outbox test",
"mediaType":"text/html",
"commentsEnabled":true,
"sensitive":false,
"stickied":false,
"published":"2021-11-18T17:19:45.895163+00:00"
}
},
"cc":[
"https://ds9.lemmy.ml/c/testcom/followers"
],
"type":"Announce",
"id":"https://ds9.lemmy.ml/activities/announce/b204fe9f-b13d-4af2-9d22-239ac2d892e6"
},
{
"actor":"https://ds9.lemmy.ml/c/testcom",
"to":[
"https://www.w3.org/ns/activitystreams#Public"
],
"object":{
"actor":"https://ds9.lemmy.ml/u/nutomic",
"to":[
"https://www.w3.org/ns/activitystreams#Public"
],
"cc":[
"https://ds9.lemmy.ml/c/testcom"
],
"type":"Create",
"id":"http://ds9.lemmy.ml/activities/create/eee6a57a-622f-464d-b560-73ae1fcd3ddf",
"object":{
"type":"Page",
"id":"https://ds9.lemmy.ml/post/2327",
"attributedTo":"https://ds9.lemmy.ml/u/nutomic",
"to":[
"https://ds9.lemmy.ml/c/testcom",
"https://www.w3.org/ns/activitystreams#Public"
],
"name":"outbox test",
"mediaType":"text/html",
"commentsEnabled":true,
"sensitive":false,
"stickied":false,
"published":"2021-11-18T17:19:05.763109+00:00"
}
},
"cc":[
"https://ds9.lemmy.ml/c/testcom/followers"
],
"type":"Announce",
"id":"https://ds9.lemmy.ml/activities/announce/c6c960ce-c8d8-4231-925e-3ba367468f18"
}
]
}
The outbox only contains Create/Post
activities for now.
Community Followers
{
"id": "http://enterprise.lemmy.ml/c/main/followers",
"type": "Collection",
"totalItems": 3,
"items": []
}
The followers collection is only used to expose the number of followers. Actor IDs are not included, to protect user privacy.
Community Moderators
{
"type": "OrderedCollection",
"id": "https://enterprise.lemmy.ml/c/tenforward/moderators",
"orderedItems": [
"https://enterprise.lemmy.ml/u/picard"
]
}
User Outbox
{
"type": "OrderedCollection",
"id": "http://ds9.lemmy.ml/u/lemmy_alpha/outbox",
"orderedItems": [],
"totalItems": 0
}
Activities
User to Community
Follow
When the user clicks "Subscribe" in a community, a Follow
is sent. The community automatically responds with an Accept/Follow
.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": "http://enterprise.lemmy.ml/c/main",
"type": "Follow",
"id": "http://ds9.lemmy.ml/activities/follow/6abcd50b-b8ca-4952-86b0-a6dd8cc12866"
}
Unfollow
Clicking on the unsubscribe button in a community causes an Undo/Follow
to be sent. The community removes the user from its follower list after receiving it.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": {
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": "http://enterprise.lemmy.ml/c/main",
"type": "Follow",
"id": "http://ds9.lemmy.ml/activities/follow/dc2f1bc5-f3a0-4daa-a46b-428cbfbd023c"
},
"type": "Undo",
"id": "http://ds9.lemmy.ml/activities/undo/dd83c482-8ebd-4b6c-9008-c8373bd1a86a"
}
Report Post or Comment
Reports a post or comment for rule violation, so that mods/admins review it.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"object": "http://enterprise.lemmy.ml/post/7",
"summary": "report this post",
"type": "Flag",
"id": "http://ds9.lemmy.ml/activities/flag/98b0933f-5e45-4a95-a15f-e0dc86361ba4"
}
Community to User
Accept Follow
Automatically sent by the community in response to a Follow
. At the same time, the community adds this user to its followers list.
{
"actor": "http://enterprise.lemmy.ml/c/main",
"object": {
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": "http://enterprise.lemmy.ml/c/main",
"type": "Follow",
"id": "http://ds9.lemmy.ml/activities/follow/6abcd50b-b8ca-4952-86b0-a6dd8cc12866"
},
"type": "Accept",
"id": "http://enterprise.lemmy.ml/activities/accept/75f080cc-3d45-4654-8186-8f3bb853fa27"
}
Announce
When the community receives a post or comment activity, it wraps that into an Announce
and sends it to all followers.
{
"actor": "http://enterprise.lemmy.ml/c/main",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"type": "Page",
"id": "http://enterprise.lemmy.ml/post/7",
"attributedTo": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://enterprise.lemmy.ml/c/main",
"https://www.w3.org/ns/activitystreams#Public"
],
"name": "post 4",
"mediaType": "text/html",
"commentsEnabled": true,
"sensitive": false,
"stickied": false,
"published": "2021-11-01T12:11:22.871846+00:00"
},
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"type": "Create",
"id": "http://enterprise.lemmy.ml/activities/create/2807c9ec-3ad8-4859-a9e0-28b59b6e499f"
},
"cc": [
"http://enterprise.lemmy.ml/c/main/followers"
],
"type": "Announce",
"id": "http://enterprise.lemmy.ml/activities/announce/8030b171-803a-4108-94b1-342688f375cf"
}
Announcable
All of these activities are sent from a user to a community. The community then wraps it in an Announce activity, and sends it to its followers.
Create or Update Post
When a user creates a new post, it is sent to the respective community. Editing a previously created post sends an almost identical activity, except the type
being Update
. We don't support mentions in posts yet.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"type": "Page",
"id": "http://ds9.lemmy.ml/post/1",
"attributedTo": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"http://enterprise.lemmy.ml/c/main",
"https://www.w3.org/ns/activitystreams#Public"
],
"audience": "https://enterprise.lemmy.ml/c/main",
"name": "test post",
"content": "<p>test body</p>\n",
"mediaType": "text/html",
"source": {
"content": "test body",
"mediaType": "text/markdown"
},
"attachment": [
{
"type": "Link",
"href": "https://lemmy.ml/pictrs/image/xl8W7FZfk9.jpg"
}
],
"commentsEnabled": true,
"sensitive": false,
"stickied": false,
"language": {
"identifier": "ko",
"name": "한국어"
},
"published": "2021-10-29T15:10:51.557399+00:00"
},
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "https://enterprise.lemmy.ml/c/main",
"type": "Create",
"id": "http://ds9.lemmy.ml/activities/create/eee6a57a-622f-464d-b560-73ae1fcd3ddf"
}
Create or Update Comment
A reply to a post, or to another comment. Can contain mentions of other users. Editing a previously created post sends an almost identical activity, except the type
being Update
.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"type": "Note",
"id": "http://ds9.lemmy.ml/comment/1",
"attributedTo": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://enterprise.lemmy.ml/c/main",
"http://ds9.lemmy.ml/u/lemmy_alpha"
],
"audience": "http://ds9.lemmy.ml/u/lemmy_alpha",
"content": "hello",
"mediaType": "text/html",
"source": {
"content": "hello",
"mediaType": "text/markdown"
},
"inReplyTo": "http://ds9.lemmy.ml/post/1",
"published": "2021-11-01T11:45:49.794920+00:00"
},
"cc": [
"http://enterprise.lemmy.ml/c/main",
"http://ds9.lemmy.ml/u/lemmy_alpha"
],
"audience": "http://ds9.lemmy.ml/u/lemmy_alpha",
"tag": [
{
"href": "http://ds9.lemmy.ml/u/lemmy_alpha",
"type": "Mention",
"name": "@lemmy_alpha@ds9.lemmy.ml"
}
],
"type": "Create",
"id": "http://ds9.lemmy.ml/activities/create/1e77d67c-44ac-45ed-bf2a-460e21f60236"
}
Like Post or Comment
An upvote for a post or comment.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": "http://ds9.lemmy.ml/comment/1",
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"type": "Like",
"id": "http://ds9.lemmy.ml/activities/like/fd61d070-7382-46a9-b2b7-6bb253732877"
}
Dislike Post or Comment
A downvote for a post or comment.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"object": "http://ds9.lemmy.ml/post/1",
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"type": "Dislike",
"id": "http://enterprise.lemmy.ml/activities/dislike/64d40d40-a829-43a5-8247-1fb595b3ca1c"
}
Undo Like or Dislike Post or Comment
Remove a vote that was previously done by the same user.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": {
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"object": "http://ds9.lemmy.ml/comment/1",
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"type": "Like",
"id": "http://ds9.lemmy.ml/activities/like/efcf7ae2-dfcc-4ff4-9ce4-6adf251ff004"
},
"audience": "https://enterprise.lemmy.ml/c/tenforward",
"type": "Undo",
"id": "http://ds9.lemmy.ml/activities/undo/3518565c-24a7-4d9e-8e0a-f7a2f45ac618"
}
Delete Post or Comment
Deletes a previously created post or comment. This can only be done by the original creator of that post/comment.
{
"actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/post/1",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Delete",
"id": "http://ds9.lemmy.ml/activities/delete/f2abee48-c7bb-41d5-9e27-8775ff32db12"
}
Remove Post or Comment
Removes a post or comment. This can only be done by a community mod, or by an admin on the instance where the community is hosted. The difference to delete is that remove activities have a summary field, which contains the reason for removal, as provided by the mod/admin.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/comment/1",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Delete",
"summary": "bad comment",
"id": "http://enterprise.lemmy.ml/activities/delete/42ca1a79-f99e-4518-a2ca-ba2df221eb5e"
}
Undo Delete or Remove
Reverts the action done by the activity in the object field. In this example, the removed Note is restored.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/comment/1",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Delete",
"summary": "bad comment",
"id": "http://enterprise.lemmy.ml/activities/delete/2598435c-87a3-49cd-81f3-a44b03b7af9d"
},
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Undo",
"id": "http://enterprise.lemmy.ml/activities/undo/a850cf21-3866-4b3a-b80b-56aa00997fee"
}
Add Mod
Add a new mod to the community. Has to be sent by an existing community mod, or an admin of the community's instance.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/u/lemmy_alpha",
"target": "http://enterprise.lemmy.ml/c/main/moderators",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Add",
"id": "http://enterprise.lemmy.ml/activities/add/ec069147-77c3-447f-88c8-0ef1df10403f"
}
Remove Mod
Remove an existing mod from the community. Has to be sent by an existing community mod, or an admin of the community's instance.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/u/lemmy_alpha",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"type": "Remove",
"target": "http://enterprise.lemmy.ml/c/main/moderators",
"audience": "http://enterprise.lemmy.ml/u/main",
"id": "http://enterprise.lemmy.ml/activities/remove/aab114f8-cfbd-4935-a5b7-e1a64603650d"
}
Block User
Blocks a user so he can't participate anymore. The scope is determined by the target
field: either a community, or a whole instance. The remove_data
field can optionally be set to indicate that all previous posts of the user should
be deleted.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/u/lemmy_alpha",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"target": "http://enterprise.lemmy.ml/c/main",
"type": "Block",
"removeData": true,
"summary": "spam post",
"expires": "2021-11-01T12:23:50.151874+00:00",
"id": "http://enterprise.lemmy.ml/activities/block/5d42fffb-0903-4625-86d4-0b39bb344fc2"
}
Undo Block User
Reverts a previous user block.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": "http://ds9.lemmy.ml/u/lemmy_alpha",
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"target": "http://enterprise.lemmy.ml/c/main",
"type": "Block",
"removeData": true,
"summary": "spam post",
"expires": "2021-11-01T12:23:50.151874+00:00",
"id": "http://enterprise.lemmy.ml/activities/block/726f43ab-bd0e-4ab3-89c8-627e976f553c"
},
"cc": [
"http://enterprise.lemmy.ml/c/main"
],
"audience": "http://enterprise.lemmy.ml/u/main",
"type": "Undo",
"id": "http://enterprise.lemmy.ml/activities/undo/06a20ffb-3e32-42fb-8f4c-674b36d7c557"
}
User to User
Create or Update Private message
Creates a new private message between two users.
{
"id": "http://enterprise.lemmy.ml/activities/create/987d05fa-f637-46d7-85be-13d112bc269f",
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://ds9.lemmy.ml/u/lemmy_alpha"
],
"object": {
"type": "ChatMessage",
"id": "http://enterprise.lemmy.ml/private_message/1",
"attributedTo": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://ds9.lemmy.ml/u/lemmy_alpha"
],
"content": "hello",
"mediaType": "text/html",
"source": {
"content": "hello",
"mediaType": "text/markdown"
},
"published": "2021-10-29T15:31:56.058289+00:00"
},
"type": "Create"
}
Delete Private Message
Deletes a previous private message.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://enterprise.lemmy.ml/u/lemmy_beta"
],
"object": "http://enterprise.lemmy.ml/private_message/1",
"type": "Delete",
"id": "http://enterprise.lemmy.ml/activities/delete/041d9858-5eef-4ad9-84ae-7455b4d87ed9"
}
Undo Delete Private Message
Restores a previously deleted private message. The object
is regenerated from scratch, as such the activity ID and other fields are different.
{
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://ds9.lemmy.ml/u/lemmy_alpha"
],
"object": {
"actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
"to": [
"http://enterprise.lemmy.ml/u/lemmy_beta"
],
"object": "http://enterprise.lemmy.ml/private_message/1",
"type": "Delete",
"id": "http://enterprise.lemmy.ml/activities/delete/616c41be-04ed-4bd4-b865-30712186b122"
},
"type": "Undo",
"id": "http://enterprise.lemmy.ml/activities/undo/35e5b337-014c-4bbe-8d63-6fac96f51409"
}