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

[
  "https://www.w3.org/ns/activitystreams",
  {
    "stickied": "as:stickied",
    "pt": "https://join-lemmy.org#",
    "sc": "http://schema.org#",
    "matrixUserId": {
      "type": "sc:Text",
      "id": "as:alsoKnownAs"
    },
    "sensitive": "as:sensitive",
    "comments_enabled": {
      "type": "sc:Boolean",
      "id": "pt:commentsEnabled"
    },
    "moderators": "as:moderators"
  },
  "https://w3id.org/security/v1"
]

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",
  "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"
  },
  "published": "2019-06-02T16:43:50.799554+00:00",
  "updated": "2021-03-10T17:18:10.498868+00:00"
}
Field NameDescription
preferredUsernameName of the actor
nameTitle of the community
sensitiveTrue indicates that all posts in the community are nsfw
attributedToFirst the community creator, then all the remaining moderators
contentText for the community sidebar, usually containing a description and rules
iconIcon, shown next to the community name
imageBanner image, shown on top of the community page
inboxActivityPub inbox URL
outboxActivityPub outbox URL, only contains up to 20 latest posts, no comments, votes or other activities
followersFollower collection URL, only contains the number of followers, no references to individual followers
endpointsContains URL of shared inbox
publishedDatetime when the community was first created
updatedDatetime when the community was last changed
publicKeyThe 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"
  },
  "matrix_user_id": "@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 NameDescription
preferredUsernameName of the actor
nameThe user's displayname
contentUser bio
iconThe user's avatar, shown next to the username
imageThe user's banner, shown on top of the profile
inboxActivityPub inbox URL
endpointsContains URL of shared inbox
publishedDatetime when the user signed up
updatedDatetime when the user profile was last changed
publicKeyThe 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.

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"
  ],
  "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"
  },
  "url": "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,
  "published": "2021-02-26T12:35:34.292626+00:00"
}
Field NameDescription
attributedToID of the user which created this post
toID of the community where it was posted to
nameTitle of the post
contentBody of the post
urlAn arbitrary link to be shared
imageThumbnail for url, only present if it is an image link
commentsEnabledFalse indicates that the post is locked, and no comments can be added
sensitiveTrue marks the post as NSFW, blurs the thumbnail and hides it from users with NSFW settign disabled
stickiedTrue means that it is shown on top of the community
publishedDatetime when the post was created
updatedDatetime 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"
  ],
  "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"
    }
  ],
  "published": "2021-03-01T13:42:43.966208+00:00",
  "updated": "2021-03-01T13:43:03.955787+00:00"
}
Field NameDescription
attributedToID of the user who created the comment
toCommunity where the comment was made
contentThe comment text
inReplyToIDs of the post where this comment was made, and the parent comment. If this is a top-level comment, inReplyTo only contains the post
publishedDatetime when the comment was created
updatedDatetime 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 NameDescription
attributedToID of the user who created this private message
toID of the recipient
contentThe text of the private message
publishedDatetime when the message was created
updatedDatetime when the message was edited (not present if it was never edited)

Collections

Community Outbox

{
  "type": "OrderedCollection",
  "id": "https://ds9.lemmy.ml/c/main/outbox",
  "totalItems": 7,
  "orderedItems": [
    {
      "actor": "https://ds9.lemmy.ml/u/dess_ds9",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1685",
        "attributedTo": "https://ds9.lemmy.ml/u/dess_ds9",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "Test post",
        "mediaType": "text/html",
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-09-30T16:37:58.425718+00:00",
        "updated": "2021-09-30T16:39:50.934055+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/157bc329-05cb-4dc3-ad9e-5110fde3f3aa"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/nutomic",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1665",
        "attributedTo": "https://ds9.lemmy.ml/u/nutomic",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "another webmention test",
        "mediaType": "text/html",
        "url": "https://webmention.rocks/test/1",
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-09-17T13:22:15.026912+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/c54e4509-16ac-42bf-b3b4-0bf8516f8152"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/nutomic",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1664",
        "attributedTo": "https://ds9.lemmy.ml/u/nutomic",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "another test",
        "mediaType": "text/html",
        "url": "https://webmention.rocks/test/1",
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-09-17T13:13:21.675891+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/25f7d2cb-11d5-4c9c-aa3c-85fbff9f9e0c"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/nutomic",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1663",
        "attributedTo": "https://ds9.lemmy.ml/u/nutomic",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "Webmention test from Lemmy",
        "mediaType": "text/html",
        "url": "https://webmention.rocks/test/1",
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-09-17T13:00:15.392844+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/cfbd12b8-2e11-42b6-a609-b482decbaf11"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/dess_tester_3",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1644",
        "attributedTo": "https://ds9.lemmy.ml/u/dess_tester_3",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "The best wireless earbuds you can buy right now | Engadget",
        "mediaType": "text/html",
        "url": "https://www.engadget.com/best-wireless-earbuds-120058222.html",
        "image": {
          "type": "Image",
          "url": "https://ds9.lemmy.ml/pictrs/image/0WWsYOuwAE.jpg"
        },
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-08-26T01:22:06.428368+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/76c94408-944a-4a2f-a88b-d10f12b472b0"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/dess_ds9",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1643",
        "attributedTo": "https://ds9.lemmy.ml/u/dess_ds9",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "First Look: Cadillac’s luxury EV debut seems like a winner | Engadges",
        "content": "<p>test</p>\n",
        "mediaType": "text/html",
        "source": {
          "content": "test",
          "mediaType": "text/markdown"
        },
        "url": "https://www.engadget.com/cadillac-lyriq-luxury-ev-first-look-video-171543752.html",
        "image": {
          "type": "Image",
          "url": "https://ds9.lemmy.ml/pictrs/image/gnmtvgXP31.jpg"
        },
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-08-23T23:43:06.560543+00:00",
        "updated": "2021-08-23T23:52:51.832606+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/b1f95918-f593-4951-91cf-2c3340cd9509"
    },
    {
      "actor": "https://ds9.lemmy.ml/u/dess_ds9_2",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "object": {
        "type": "Page",
        "id": "https://ds9.lemmy.ml/post/1642",
        "attributedTo": "https://ds9.lemmy.ml/u/dess_ds9_2",
        "to": [
          "https://ds9.lemmy.ml/c/main",
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "name": "A test post from DS9",
        "mediaType": "text/html",
        "commentsEnabled": true,
        "sensitive": false,
        "stickied": false,
        "published": "2021-08-06T14:10:47.493075+00:00"
      },
      "cc": [
        "https://ds9.lemmy.ml/c/main"
      ],
      "type": "Create",
      "id": "https://ds9.lemmy.ml/activities/create/6359b2e7-badb-4241-b5ee-b093078361bd"
    }
  ]
}

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"
  ],
  "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"
    ],
    "name": "test post",
    "content": "<p>test body</p>\n",
    "mediaType": "text/html",
    "source": {
      "content": "test body",
      "mediaType": "text/markdown"
    },
    "url": "https://lemmy.ml/pictrs/image/xl8W7FZfk9.jpg",
    "commentsEnabled": true,
    "sensitive": false,
    "stickied": false,
    "published": "2021-10-29T15:10:51.557399+00:00"
  },
  "cc": [
    "http://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"
    ],
    "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"
  ],
  "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",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": "http://ds9.lemmy.ml/comment/1",
  "cc": [
    "http://enterprise.lemmy.ml/c/main"
  ],
  "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",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": "http://ds9.lemmy.ml/post/1",
  "cc": [
    "http://enterprise.lemmy.ml/c/main"
  ],
  "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",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": {
    "actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "object": "http://ds9.lemmy.ml/comment/1",
    "cc": [
      "http://enterprise.lemmy.ml/c/main"
    ],
    "type": "Like",
    "id": "http://ds9.lemmy.ml/activities/like/efcf7ae2-dfcc-4ff4-9ce4-6adf251ff004"
  },
  "cc": [
    "http://enterprise.lemmy.ml/c/main"
  ],
  "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": {
    "id": "http://ds9.lemmy.ml/post/1",
    "type": "Tombstone"
  },
  "cc": [
    "http://enterprise.lemmy.ml/c/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": {
    "id": "http://ds9.lemmy.ml/comment/1",
    "type": "Tombstone"
  },
  "cc": [
    "http://enterprise.lemmy.ml/c/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": {
      "id": "http://ds9.lemmy.ml/comment/1",
      "type": "Tombstone"
    },
    "cc": [
      "http://enterprise.lemmy.ml/c/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"
  ],
  "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"
  ],
  "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",
  "id": "http://enterprise.lemmy.ml/activities/remove/aab114f8-cfbd-4935-a5b7-e1a64603650d"
}

Block User

Blocks a user from a community, so he can't participate in it.

{
  "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"
  ],
  "target": "http://enterprise.lemmy.ml/c/main",
  "type": "Block",
  "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": "http://ds9.lemmy.ml/u/lemmy_alpha",
  "cc": [
    "http://enterprise.lemmy.ml/c/main"
  ],
  "target": "http://enterprise.lemmy.ml/c/main",
  "type": "Block",
  "id": "http://enterprise.lemmy.ml/activities/block/5d42fffb-0903-4625-86d4-0b39bb344fc2"
}

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"
}