Message Standard

A universal messaging format. Works for chat, email-like threads, group conversations, and channels.

Message

{
	$type: 'message',
	$version: 1,
	$kind: 'message',
	$id: 'msg-2026-0329-001',
	$from: {
		$type: 'contact',
		$name: 'John',
		$avatar: 'https://example.com/john.webp'
	},
	$to: [
		{ $type: 'contact', $name: 'Jane' }
	],
	$body: 'Did you see the new filesystem standard?',
	$format: 'text',
	$created: '2026-03-29 11:05:30',
	$thread: 'thread-2026-0328-042',
	$attachments: [
		{
			$url: 'https://hub.example.com/files/screenshot.webp',
			$mime: 'image/webp',
			$size: 48200,
			$name: 'screenshot.webp'
		}
	]
}

Thread

A conversation thread grouping related messages.

{
	$type: 'message',
	$version: 1,
	$kind: 'thread',
	$id: 'thread-2026-0328-042',
	$subject: 'WorldAPI Standards Discussion',
	$created: '2026-03-28 09:00:00',
	$updated: '2026-03-29 11:05:30',
	$participants: [
		{ $type: 'contact', $name: 'John' },
		{ $type: 'contact', $name: 'Jane' }
	],
	$messages: [ ... ],
	$count: 14
}

Channel

A named group space -- like a chat room or mailing list.

{
	$type: 'message',
	$version: 1,
	$kind: 'channel',
	$id: 'channel-dev',
	$name: 'Development',
	$description: 'General development discussion',
	$created: '2026-01-01 00:00:00',
	$owner: { $type: 'contact', $name: 'John' },
	$members: [
		{ $type: 'contact', $name: 'John', $role: 'admin' },
		{ $type: 'contact', $name: 'Jane', $role: 'member' },
		{ $type: 'contact', $name: 'Tom', $role: 'member' }
	],
	$threads: [ ... ],
	$permissions: {
		$public: false,
		$join: 'invite'
	}
}

Status & Receipts

Optional delivery and read status per message.

{
	$type: 'message',
	$version: 1,
	$kind: 'status',
	$message: 'msg-2026-0329-001',
	$delivered: '2026-03-29 11:05:31',
	$read: '2026-03-29 11:06:02',
	$user: { $type: 'contact', $name: 'Jane' }
}

Object Kinds

$kind Use case
message A single message
thread A conversation grouping messages
channel A named group space
status Delivery/read receipt for a message

Standard Properties

Property Type Required Description
$type string yes Always 'message'
$version number yes Standard version
$kind string yes message, thread, channel, or status
$id string yes Unique identifier
$from object yes* Sender (contact object)
$to array no Recipients
$body string yes* Message content
$format string no text (default) or html
$created string yes UTC datetime
$updated string no UTC datetime if edited
$thread string no Thread ID this message belongs to
$reply_to string no Message ID being replied to
$attachments array no Attached files
$subject string no Thread or channel subject
$participants array no Thread participants
$members array no Channel members with $role
$messages array no Messages in thread
$threads array no Threads in channel
$count number no Total message/thread count
$permissions object no Access control for channels

* Required depends on $kind.