Verified against AS2 Core & Vocabulary (W3C REC 2017), the published AS2 JSON-LD context, ActivityPub REC, Mastodon v4.7.3 source (context_helper.rb, account.rb, json_ld_helper.rb) on 2026-10-15.
Core Types
ActivityStreams 2.0 defines a small set of core types that form the foundation for all ActivityPub objects. There are two base types — Object and Link — and every other type extends one of them (AS2 Core §4). "Actor types" in the diagram is a grouping, not a class: Person, Group, Application, Service and Organization each extend Object directly.
Type Hierarchy
Object
The base type for all ActivityStreams objects.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Object",
"id": "https://example.com/objects/1",
"name": "A Simple Object"
}
Common Properties
| Property | Type | Description |
|---|---|---|
@context | String/Array | JSON-LD context |
type | String/Array | The object type(s) |
id | String (URI) | Globally unique identifier |
name | String | Human-readable name |
content | String | Text content (often HTML) |
summary | String | Brief description |
published | DateTime | When created |
updated | DateTime | When last modified |
attributedTo | Object/Link | Creator/author |
to | Object/Link, one or many | Primary recipients |
cc | Object/Link, one or many | Secondary recipients |
bto | Object/Link, one or many | Blind primary recipients |
bcc | Object/Link, one or many | Blind secondary recipients |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Object",
"id": "https://example.com/objects/unique-id",
"name": "My Object",
"content": "This is the content of the object",
"published": "2024-01-15T10:00:00Z",
"updated": "2024-01-15T12:00:00Z",
"attributedTo": "https://example.com/users/alice"
}
Link
Represents a reference to another resource. Links are not Objects—they're a separate base type.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Link",
"href": "https://example.com/resource",
"mediaType": "text/html"
}
Link Properties
| Property | Type | Description |
|---|---|---|
href | String (URI) | The target resource URL |
rel | String/Array | Link relation type |
mediaType | String | MIME type of the target |
name | String | Human-readable name |
hreflang | String | Language of the target |
height | Integer | Height in pixels |
width | Integer | Width in pixels |
preview | Object/Link | Preview of the linked resource |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Link",
"href": "https://example.com/article",
"mediaType": "text/html",
"name": "An Interesting Article",
"hreflang": "en"
}
Activity
Represents an action. Activities are the primary way to describe what's happening in ActivityPub.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Activity",
"actor": "https://example.com/users/alice",
"object": "https://example.com/notes/1"
}
Activity Properties
| Property | Type | Description |
|---|---|---|
actor | Object/Link | Who performed the activity |
object | Object/Link | What the activity is about |
target | Object/Link | Indirect object (e.g., Add to target) |
result | Object/Link | Result of the activity |
origin | Object/Link | Where the activity originated |
instrument | Object/Link | Tool used to perform the activity |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://example.com/activities/1",
"actor": "https://example.com/users/alice",
"object": {
"type": "Note",
"content": "Hello, world!"
},
"published": "2024-01-15T10:00:00Z"
}
IntransitiveActivity
An Activity without an object property. The action is self-contained.
Examples
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Arrive",
"actor": "https://example.com/users/alice",
"location": {
"type": "Place",
"name": "San Francisco"
}
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Travel",
"actor": "https://example.com/users/alice",
"origin": {
"type": "Place",
"name": "New York"
},
"target": {
"type": "Place",
"name": "Los Angeles"
}
}
Collection
Represents an ordered or unordered set of Objects or Links.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Collection",
"totalItems": 3,
"items": [
"https://example.com/objects/1",
"https://example.com/objects/2",
"https://example.com/objects/3"
]
}
Collection Properties
| Property | Type | Description |
|---|---|---|
totalItems | Integer | Total number of items |
items | Object/Link, one or many | The items (unordered) |
current | CollectionPage/Link | Current page |
first | CollectionPage/Link | First page |
last | CollectionPage/Link | Last page |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Collection",
"id": "https://example.com/users/alice/followers",
"totalItems": 150,
"first": "https://example.com/users/alice/followers?page=1"
}
OrderedCollection
A Collection where the order of items is significant.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "OrderedCollection",
"totalItems": 3,
"orderedItems": [
"https://example.com/objects/3",
"https://example.com/objects/2",
"https://example.com/objects/1"
]
}
Used For
ActivityPub requires inbox and outbox to be OrderedCollections, presented in reverse chronological order (newest first). followers, following, liked, likes and shares MUST be either an OrderedCollection or a Collection (AP §5).
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "OrderedCollection",
"id": "https://example.com/users/alice/outbox",
"totalItems": 1250,
"first": "https://example.com/users/alice/outbox?page=true",
"last": "https://example.com/users/alice/outbox?min_id=0&page=true"
}
CollectionPage
A single page of a Collection.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "CollectionPage",
"partOf": "https://example.com/collection",
"items": [...]
}
CollectionPage Properties
| Property | Type | Description |
|---|---|---|
partOf | Collection/Link | The parent collection |
next | CollectionPage/Link | Next page |
prev | CollectionPage/Link | Previous page |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "CollectionPage",
"id": "https://example.com/users/alice/followers?page=1",
"partOf": "https://example.com/users/alice/followers",
"next": "https://example.com/users/alice/followers?page=2",
"items": [
"https://example.com/users/bob",
"https://example.com/users/carol"
]
}
OrderedCollectionPage
A single page of an OrderedCollection.
Definition
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "OrderedCollectionPage",
"partOf": "https://example.com/collection",
"orderedItems": [...],
"startIndex": 0
}
Additional Property
| Property | Type | Description |
|---|---|---|
startIndex | Integer | Index of the first item |
Example
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "OrderedCollectionPage",
"id": "https://example.com/users/alice/outbox?page=true",
"partOf": "https://example.com/users/alice/outbox",
"next": "https://example.com/users/alice/outbox?max_id=123&page=true",
"prev": "https://example.com/users/alice/outbox?min_id=456&page=true",
"orderedItems": [
{
"type": "Create",
"object": { "type": "Note", "content": "Hello!" }
}
]
}
Multiple Types
type may hold more than one value, so consumers must handle an array. A common use is adding an extension type alongside an AS2 type that non-aware consumers still understand:
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": ["Person", "http://schema.org/Person"],
"id": "https://example.com/users/alice",
"name": "Alice"
}
Null Values
AS2 Core treats an omitted property and a null value as equivalent — "no value has been assigned" — and an empty array MUST be represented by omitting the property or setting it to null (AS2 Core §2). Omitting is the simpler choice and what most implementations emit:
// Correct
{
"type": "Note",
"content": "Hello"
}
// Avoid
{
"type": "Note",
"content": "Hello",
"summary": null
}
Next Steps
- Activity Types - All activity types
- Object Types - Content object types
- Actor Types - Actor types
- Properties - All properties reference