Skip to main content

Activity Properties

Properties specific to Activity types (Create, Follow, Like, etc.).

Core Activity Structure

{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://example.com/activities/123",
"actor": "https://example.com/users/alice",
"object": { "type": "Note", "content": "..." },
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"published": "2024-01-15T10:00:00Z"
}

Required Properties

PropertyTypeDescription
typeStringActivity type
actorActor/URLWho performed it
objectObject/URLWhat it acts upon

Common Properties

PropertyTypeDescription
idURLUnique identifier
targetObject/URLDestination/context
resultObjectOutcome
originObject/URLSource location
instrumentObjectTool used
toArrayPrimary recipients
ccArraySecondary recipients
publishedDateTimeWhen performed

Activity-Specific Properties

Create

{
"type": "Create",
"actor": "https://example.com/users/alice",
"object": {
"type": "Note",
"id": "https://example.com/notes/123",
"content": "<p>Hello!</p>",
"attributedTo": "https://example.com/users/alice"
}
}

Follow

{
"type": "Follow",
"id": "https://example.com/activities/follow/456",
"actor": "https://example.com/users/alice",
"object": "https://other.example/users/bob"
}

Accept/Reject

{
"type": "Accept",
"actor": "https://other.example/users/bob",
"object": {
"type": "Follow",
"id": "https://example.com/activities/follow/456",
"actor": "https://example.com/users/alice",
"object": "https://other.example/users/bob"
}
}

Like

{
"type": "Like",
"actor": "https://example.com/users/alice",
"object": "https://other.example/notes/789"
}

Announce (Boost/Share)

{
"type": "Announce",
"actor": "https://example.com/users/alice",
"object": "https://other.example/notes/789",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": ["https://example.com/users/alice/followers"]
}

Update

{
"type": "Update",
"actor": "https://example.com/users/alice",
"object": {
"type": "Note",
"id": "https://example.com/notes/123",
"content": "<p>Updated content</p>",
"updated": "2024-01-15T12:00:00Z"
}
}

Delete

{
"type": "Delete",
"actor": "https://example.com/users/alice",
"object": "https://example.com/notes/123"
}

After deletion, the object becomes a Tombstone:

{
"type": "Tombstone",
"id": "https://example.com/notes/123",
"formerType": "Note",
"deleted": "2024-01-15T14:00:00Z"
}

Undo

{
"type": "Undo",
"actor": "https://example.com/users/alice",
"object": {
"type": "Like",
"id": "https://example.com/activities/like/101",
"actor": "https://example.com/users/alice",
"object": "https://other.example/notes/789"
}
}

Add/Remove (Collections)

{
"type": "Add",
"actor": "https://example.com/users/alice",
"object": "https://example.com/notes/123",
"target": "https://example.com/users/alice/collections/favorites"
}

Move

{
"type": "Move",
"actor": "https://old.example/users/alice",
"object": "https://old.example/users/alice",
"target": "https://new.example/users/alice"
}

Block

{
"type": "Block",
"actor": "https://example.com/users/alice",
"object": "https://other.example/users/spammer"
}

Activity Flow

┌─────────────────────────────────────────────────────┐
│ Actor performs Activity │
├─────────────────────────────────────────────────────┤
│ 1. Activity created with actor, object, type │
│ 2. Activity POSTed to actor's outbox │
│ 3. Server delivers to recipients' inboxes │
│ 4. Recipients process and may respond │
└─────────────────────────────────────────────────────┘

See Also