Bu sayfa yalnızca İngilizce olarak var.
Yuva is one place to answer every user of every product you run: e-mail, live chat on websites and panels, and private in-app conversations in mobile apps. It is a single Go binary and a Postgres database.
Goals
- One inbox for many products. Each product is an inbox; members see the inboxes they belong to.
- One conversation model for every channel. Live chat and asynchronous messaging differ only in settings, not in code paths.
- E-mail done properly: threading, quote stripping, attachments, loop protection, bounces.
- Native embedding: a web component for sites and panels, Swift and Kotlin SDKs for apps, a Go helper for the host backend.
- Easy to run: one binary, one Postgres. No Redis, no separate worker process, no Node at runtime.
- Typed everywhere: OpenAPI 3.1 is the contract; clients are generated from it.
- Ready to be hosted for others: every row belongs to a workspace and usage is counted from day one.
Not goals: a CRM, a marketing automation suite (journeys, A/B tests, lead scoring), social-media channels (WhatsApp, Instagram, …). They may come later; the model must not block them. Yuva does not host product documentation, but it collects feedback and questions on the documentation sites products already have (see “Documentation pages”). Since M13 it sends broadcasts (newsletters, announcements) to contacts who subscribed, and replies to them land in the inbox (see “Broadcasts and e-mail designs”). Since M40 it sends triggered e-mails: one design to each contact once, a set time after a trigger; journeys with several steps, branches or goals stay out. Since M15 it measures the workspace’s own websites and apps without cookies, for the team and in aggregate with support (see “Analytics”). Since M20 it hosts help centers, the support articles of a product next to the documentation on its own site (see “Help center”).
Concepts
| Concept | Meaning |
|---|---|
| Workspace | The tenant. A self-hosted install usually has one. Owns everything below. |
| Member | A person who answers. Role owner, admin or agent. Owners and admins see every inbox; agents see the inboxes they were granted, and only contacts with a conversation or external id in one of them, plus contacts with neither that they created themselves (contacts.created_by; a contact nobody in an inbox has touched yet, such as one the feedback API made, is seen by owners and admins only); they set external ids only in their inboxes (ids in other inboxes are kept) and change e-mail addresses only of contacts that appear in no other inbox (403 forbidden). An inbox, conversation, contact or attachment the caller cannot see answers 404. |
| Inbox | One product or brand. Branding, languages, business hours, mode (live or async), expected reply time, identity secret, webhooks. |
| Channel | How messages reach an inbox: email, chat (web widget), app (mobile SDKs), api (server-to-server, e.g. a feedback form). An inbox has any number of channels. |
| Contact | The person writing in. Known by an external user id from the host app (per inbox), one or more e-mail addresses (unique within the workspace), or an anonymous visitor id. Contacts belong to the workspace, not to an inbox; a contact lists the inboxes it has a conversation or external id in (cut to the inboxes the reader may see), and the contact list filters by inbox. |
| Conversation | A thread between a contact and an inbox. Status open, pending, snoozed, closed; assignee; labels; priority; the channel it started on. |
| Message | One entry in a conversation: message (to or from the contact), note (members only) or event (assigned, closed, …). Has attachments and a per-channel delivery state. |
Feedback is a conversation that starts on the app or api channel with a feedback kind and
metadata (category, app version, build, OS, OS version, device model, locale, screen, installation
id). An inbox owns its categories (inboxes.feedback_categories, migration 00093): 1 to 20 entries
of key (^[a-z][a-z0-9_]{0,31}$), names (language tag to name) and icon (a lowercase Lucide
name), in display order, always including other. Every inbox, existing and new, starts with bug,
idea, praise and other. Owners, admins and keys with inboxes:manage replace the list with
PATCH /v1/inboxes/{id} (feedback_categories, also on the Inbox body; inbox.updated is emitted).
POST /client/v1/feedback (no category means other) and POST /v1/feedback answer 400 for a
category the inbox does not list. A category that leaves the list moves its feedback to other in
the same transaction (the stored feedback.category changes, so listings, filters, counts, webhooks
and MCP all agree; re-adding the key does not bring it back). /client/v1 returns
feedback_category_items, {key, name, icon} for every category with name in the request’s
Accept-Language (by q-weight, else the inbox’s default locale, then en), so the SDKs never
hard-code names. Clients built before custom categories keep working: the legacy
feedback_categories there lists only the keys among the four built-in ones, and a feedback’s
category on /client/v1 is its key if built-in, else other; category_key and category_name
carry the real key and its name. /v1 and webhooks show the real key. The category is checked
inside the insert transaction under FOR SHARE on the inbox row, which conflicts with the update’s
FOR UPDATE, so no feedback is stored under a key that has just been removed. Counts and the category filter work on any key. Apps send it
with POST /client/v1/feedback (JSON, or multipart with screenshots); host backends whose forms
are server-rendered send it with an API key to POST /v1/feedback, naming the user by their
external id, into any inbox of the key’s workspace. The conversation starts on the inbox’s api
channel, which the first such request creates (named API) when the inbox has none. It is
answered like any other conversation; the answer reaches the contact in the app, or by e-mail when
they allowed it (allow_email): members’ replies the contact has not read go out through the same
delayed e-mail as chat replies. The panel
filters conversations by kind and feedback category and counts open feedback per category.
A feedback may carry a score, an integer 1 to 5 (POST /client/v1/feedback, 400 outside the range), kept in the
feedback JSON next to the category (a check constraint holds the range, migration 00079) and returned wherever
feedback is: the conversation and feedback listings, feedback.score in webhook payloads and feedback_score in
the MCP list_feedback tool. Feedback sent without one, or before it existed, has none.
Client details (migration 00147). Widgets and SDKs send app and device details the customer never
types (ClientInfo: app version and build, SDK name and version, platform ios/android/web,
OS and version, device maker and model, app and device locale, IANA timezone, screen, free storage;
every field optional, trimmed, length-checked with 400, unknown keys dropped) as client_info on
POST /client/v1/sessions, kept on contact_sessions.client_info. client_info on a new
conversation or message (JSON, or a multipart part holding the JSON object) replaces the session’s
value from that request on, so an SDK refreshes it without a new session. Every conversation,
message and feedback the session writes copies the session’s value to conversations.client_info
(with client_info_at) and to the contact when it is not older than the contact’s, so the contact
holds the latest across their conversations; a contact merge keeps the newer one. A conversation
that existed before hears conversation.updated when the value changed. Feedback keeps its own
FeedbackFields unchanged. /v1 returns read-only client_info and client_info_at on
Conversation and Contact (and so in events and webhooks that carry them), absent when none;
MCP returns client_info inside customer_content since the customer’s client wrote it.
/client/v1 never returns it.
Feedback has its own place (M18). It stays a conversation, so replies, notes, assignment, e-mail fallback, events and webhooks are the ones every conversation has; only where it is shown and what it is called change. Decisions:
- Panel. A Feedback entry in the pages menu (
/feedback, its own shortcut, a badge with open feedback from thefeedbackcount) opens a list with Open and Resolved tabs and category tabs with their open counts (All, then the inbox categories, Bug, Idea, Praise and Other by default), filtered by inbox like the inbox. A row is a triage line, not a chat preview: category, the first line of the text, the contact, app version, OS and device (or the page’s title for page feedback), a mark when screenshots are attached, a mark when the team has answered, and the time. Opening a row shows the existing conversation view beside the list. The Conversations view, its counts and its unread badge show every kind exceptfeedback, and its source filter loses the Feedback option.GET /v1/conversations/countstakeskindlike the list does. - Resolved. For a feedback,
closedis called Resolved everywhere a person reads it (panel, SDKs, widget); there is no new status. The panel’s Close and Reopen read Resolve and Reopen, and Send and close reads Reply and resolve. A contact who writes to a resolved feedback reopens it, as any conversation: a fix that did not work comes back to the same thread. - No rating. Feedback never asks for a satisfaction rating:
can_rateis false forkindfeedback, and ratings reports leave it out. - Contact side.
GET /client/v1/conversationstakeskind(several values, like/v1). The Swift and Kotlin conversation lists show Messages and Feedback as two tabs when the contact has sent feedback, one list otherwise. A feedback row shows its category, the first line and a state: Sent (no answer yet), Answered (the team’s message is the last one), Resolved. The thread of a feedback shows the category and state in its header and, when resolved, a line saying the team marked it resolved, with the composer still open. The feedback form’s sent screen has View feedback next to Done, which opens that thread. - Progress. A member can tell the contact where a feedback stands:
feedback.progressis one ofplanned,in_progress,done,wont_do, or absent when nobody set it. It is separate from the status: a feedback can bedoneand still open, or resolved with no progress. Members set and clear it in the panel’s feedback header and on the conversation update; each change is a conversation event (feedback_progress) in the timeline, the contact sees it as a line in the thread, and the contact’s row shows the progress (Planned, In progress, Done, Won’t do) instead of Sent or Answered while it is set. The panel’s feedback row shows it as a chip. Progress never hides the resolved line: a resolved feedback’s thread shows that line whether or not a progress is set, and the header keeps the progress tag. - SDK look. The Swift and Kotlin views look like a native messaging app, not a settings list: rows
edge to edge with a round avatar or category icon, a short time (14:32, Yesterday), unread in bold
with a dot, the team name and reply time as the title’s subtitle, the feedback state as a small
colored tag, a thread of bubbles with the composer riding the keyboard. There is no theming API;
apps that want their own look build on
YuvaClient.
Members change up to 100 conversations in one request (POST /v1/conversations/bulk: status,
assignee, labels to add and remove); each is checked against the caller’s inbox access and
changed in its own transaction with the same events and webhooks as a single change, and the
answer lists which changed and which were refused.
Bulk changes in content lists (#200). The other lists the panel selects many in share one
pattern: POST /v1/<resource>/bulk with {ids, action, ...params}, 1 to 100 ids (duplicates count
once), answered 200 with BulkResult (succeeded ids, failed with each id’s status, code,
detail, field and the typed extras the single answer carries, such as used_by for
image_in_use). Each id runs in its own transaction through the same function as the single
endpoint, so events, webhooks and post-commit signals are the single change’s; an id the caller
cannot see, of another workspace or of another parent is not_found, and a personal mailbox’s
design or broadcast is not_found to everyone but its owner (its list answers 404 as the parent).
An unknown action or a missing or invalid parameter (collection_id included) is a whole-request
400; the role or scope of the single action is checked once (403). Help center articles:
delete, publish and unpublish (one locale, the center’s default when absent; no such
translation is not_found), move (collection_id, null for none). What’s new entries:
delete, publish (the whole entry; one already published succeeds untouched, without a second
changelog.entry.published). List subscriptions: unsubscribe (no undo: consent is
recorded), delete. E-mail designs: delete (archive), e-mail images: delete (without force),
broadcasts: delete (an active one is broadcast_active). Discussions act on the opening post:
hide and unhide are updateDiscussionPost with state: hidden and state: published, spam is markDiscussionPostSpam, delete
is deleteDiscussionPost (only a thread the member wrote; others forbidden). Undo uses the
inverse action (unpublish and publish, move back per article, unhide after hide).
A member who sees both inboxes moves a
conversation to another inbox of the workspace (POST /v1/conversations/{id}/move) with its
messages, notes, labels and attachments; the assignee stays only with access to the new inbox,
replies continue on the new inbox’s channel of the same kind, and an e-mail conversation is
refused when the new inbox has no e-mail channel. Owners, admins and API keys merge one contact
into another (POST /v1/contacts/{id}/merge): the target keeps its id and gains the source’s
addresses, external ids, attributes (its own value wins) and conversations; the source is deleted,
so identity tokens and mail for its keys find the target.
Team workflow (M28)
Planned; built in the order teams and macros, SLA and custom fields, automation and automatic
assignment, saved views. Snoozed conversations wake on the server at snooze_until; a rule made by
an owner or admin may reply to customers while bots_may_send is off, one made by an API key only
while it is on; a reopened conversation gets no new resolution target.
Teams (#138).
-
Tables.
teams (workspace_id, id, name unique per workspace, description, assignment_mode, assignment_cap, created_at, updated_at),team_members (workspace_id, team_id, member_id)andteam_inboxes (workspace_id, team_id, inbox_id, created_at). All foreign keys are composite(workspace_id, …)withON DELETE CASCADE. -
Access. A member’s inbox access is the union of their own grants and their teams’ grants. A migration adds the view
member_inbox_access(inbox_members ∪ team_inboxes⋈team_members) and redefinesinbox_viewersasmember_inbox_access ∪ api_key_inboxes. Every query oninbox_viewersfollows without change. -
Switching the seven direct readers.
HasInboxAccess,ListNotificationCandidates,ListInboxNotifications,ListAvailableMembersandListAnalyticsSubscriberAddressesmove tomember_inbox_access.ListViewerInboxIDsgainsDISTINCT.ListInboxMembersreturns each member withvia: direct | teamand the team ids. -
No raw reads. A test greps
queries/*.sqland fails on anyFROM inbox_membersoutside the view and the grant and revoke queries. -
Assigning to a team.
conversations.team_id(nullable,ON DELETE SET NULL). A conversation has a team, a member, both or neither. A team can be set only if it holds a grant on the conversation’s inbox; otherwise422 team_access. Moving a conversation keepsteam_idonly when the team can see the new inbox, the same rule as the assignee. -
List filters.
team_id=<id>andteam=mine(any team of the caller); “Unassigned” staysassignee_id IS NULL./v1/conversations/countsgainsteams(open per team) andmine_teams. -
Endpoints.
/v1/teams(CRUD),PUT|DELETE /v1/teams/{id}/members/{member_id},PUT|DELETE /v1/teams/{id}/inboxes/{inbox_id}. Reads needinboxes:read; writes needinboxes:manage(owners, admins, keys not limited to inboxes). -
Who sees teams. Agents and inbox-limited keys see the teams they belong to and the teams granted an inbox they see. Owners and admins see all.
-
Revocation takes effect at once. Every change that alters a member’s effective access diffs
member_inbox_accessfor the affected members inside the same transaction. It emits oneinbox_access.changedper(member, inbox)whose effective access flipped (existing schema), so open realtime connections reload their inbox set. Removing a member deletes theirteam_membersrows by cascade. The heartbeat re-check already closes their connections. -
Events and audit. Events
team.created,team.updatedandteam.deleted(payload carriesmember_idsandinbox_ids) go to realtime, to webhooks, and to members named in the payload or who see all inboxes. Audit actions:team.created,team.deleted,team.member_added,team.member_removed,team.inbox_access_granted,team.inbox_access_revoked. -
As built (#138, migrations 00101 and 00102).
member_inbox_accesshas a fourth columnteam_id(null for a member’s own grant), soListInboxMembersreadsviaandteam_idsfrom the view and only the grant and revoke queries touchinbox_members(TestNoRawInboxMembersReadschecks queries, later migrations and Go strings). Every access change takes a per-workspace advisory lock first, then diffs; a direct revoke that a team still covers sends noinbox_access.changed. Deleting a team or revoking its grant on an inbox clearsteam_idon the affected conversations in the same transaction, oneconversation.updatedeach, no timeline entry; wherever a team is set or kept the team row is lockedFOR SHAREbefore the conversation, so a team deleted or revoked mid-change answers422 team_access. Team payloads list only theinbox_idsthe receiver sees;team.updatedcarriesremoved_member_idsand reaches removed members. Bulk update and conversation create take noteam_id; MCPassigntakesteam_idorremove_team. The assignment columns onteamsexist and #139 exposes them.team.updatedis not audited.
Automatic assignment (#139).
-
Settings.
inboxes.assignment_modeandteams.assignment_mode(off | round_robin | least_open), andassignment_cap(1–500, null for no cap). -
Turn tracking.
assignment_turns (workspace_id, pool_id, member_id, last_at)holds round-robin turns.pool_idis the inbox id or the team id. -
Eligible members. A member is eligible when all of these hold:
- they have access to the inbox (
member_inbox_access); - they have a fresh realtime connection (
presenceFresh) andavailability = 'auto'; - the inbox is inside its business hours (
inboxOpen); - they are under the cap;
- for a team pool, they are a member of the team.
- they have access to the inbox (
-
Cap. The cap counts the member’s
open, non-spam, untrashed conversations across the workspace. Manual assignment ignores the cap; the hand-off menu shows “over cap”. -
Which pool. A conversation with a team and no member uses the team’s pool. One with neither uses the inbox’s pool. One with
assignee_idset is never touched. -
The job.
auto_assign {workspace_id, conversation_id}(unique by args) runs after the automation job for the same trigger, or directly when the workspace has no enabled rule for it. Rules decide first. -
Nobody eligible.
conversations.assign_waiting_sinceis set; a partial index(workspace_id, assign_waiting_since) WHERE assign_waiting_since IS NOT NULLcovers it. -
Picking up waiting conversations.
assign_waiting {workspace_id}(unique while pending) takes waiting conversations oldest first, 50 per run. It is queued when:- a member connects or sets availability to
auto; - a member’s conversation leaves
openor is unassigned; - the per-minute sweep finds an inbox whose business hours just opened.
- a member connects or sets availability to
-
Reopen. If the assignee still has inbox access and is not
away, they keep the conversation; otherwise it is unassigned and enters the pool. -
Events. An automatic assignment writes the same
assignedtimeline event andconversation.updatedas a manual one, withauto: true, and notifies like a manual assignment. -
As built (#139, migrations 00115 and 00116). Settings are on inboxes and teams with the same permission as their other fields; turning a pool on or widening its cap queues the waiting run. Round robin picks the member with the oldest turn (never-turned first, ties by id); least open picks the fewest open, then by turn; every automatic assignment writes a turn, strictly increasing per pool. A team with no member uses only the team’s pool (team off assigns nothing). Pool entries are a non-imported
conversation.createdand a reopen written bysystem; when an automation run is queued for the same conversation it carries the assignment and queuesauto_assignafter its last rule, and a rule that assigned, unassigned or handed to the pool decides instead of the reopen check. Each automatic assignment takes the per-workspace advisory lock, then the conversation, then the event lock; the waiting run reads 50 ids per page to the end and decides each conversation in its own short transaction, remembering an empty pool per (pool, inbox). The load count reads a partial index on open, non-spam, untrashed conversations per assignee.assign_waiting_sinceis set once and cleared when the conversation gets a member, leavesopen, is marked spam, moved with a member or trashed; a manual unassign doesn’t put it in the pool. The per-minute sweep queues the waiting run for every workspace with a waiting conversation and a member online and available, not only when hours open, since River skips a trigger while the same run is in progress. On reopen the assignee keeps it while they still have inbox access and aren’t away (online and cap not required); only when the conversation’s pool is on. While the rules job is held by the rate limit, its new conversation is marked waiting but held for the rules. Manual assignment and contact reopens take no assignment lock: a race ends as if the automatic one ran first.
SLA policies (#140).
-
Policies.
sla_policies (workspace_id, id, name, position, enabled, inbox_ids uuid[], channel_kinds text[], label_ids uuid[], priorities text[], first_reply_minutes, next_reply_minutes, resolution_minutes, warn_minutes default 15). An empty array matches anything; at least one target is required. The first enabled policy bypositionwhose conditions match applies. -
Per-conversation state.
conversation_sla (workspace_id, conversation_id PK, policy_id, assignee_id_at_outcome, team_id_at_outcome), plus for each targett ∈ {first_reply, next_reply, resolution}:t_due_at,t_remaining_s(business seconds left while paused),t_met_at,t_breached_at,t_warned_at, andpaused_at. The list’ssla_due_atisleast(open due times), stored onconversations(indexed(workspace_id, sla_due_at) WHERE sla_due_at IS NOT NULL) so the list sorts bysort=sla_due. -
Clocks. Every target counts in the inbox’s business hours and timezone, and in plain time when hours are off. The arithmetic is one Go function
addBusinessSeconds(inbox, from, secs).- First reply: starts at the first contact message.
- Next reply: starts at a contact message that follows a team reply.
- Resolution: starts at creation.
-
What meets a target. A member’s or a bot’s sent public reply meets first and next reply. Notes, drafts, system auto-replies and rule replies never do. Resolution is met at the first close.
-
Reopen. A reopened conversation runs no new resolution target: the outcome of the first close stands. Only next reply applies.
-
Pausing.
pendingandsnoozedpause every running target:t_remaining_sis stored andt_due_atcleared.openresumes them witht_due_at = addBusinessSeconds(now, t_remaining_s). -
Snooze wake. New per-minute job
snooze_wake. Per workspace it runsUPDATE … SET status='open' WHERE status='snoozed' AND snooze_until <= now() … FOR UPDATE SKIP LOCKED LIMIT 500. Each change emitsconversation.updatedand astatus_changedevent and resumes the clock. -
Re-evaluation. A change of priority, labels or inbox (move) picks the policy again. A different policy recomputes due times from the original start instants; outcomes already met or breached stay as they are.
-
Exclusions. Spam and trash drop the row.
mailinboxes (M34) never get one. -
Breach detection.
- When a due time is set, the same transaction queues
sla_check {conversation_id, target, due_at}withScheduledAt = due_at, and a warning check atdue_at − warn_minutes. - The job acts only when the stored
t_due_atstill equals itsdue_at:UPDATE … SET t_breached_at = now() WHERE … AND t_breached_at IS NULL AND t_met_at IS NULL AND t_due_at = $due RETURNING. Stale jobs do nothing, and each breach fires once. - A per-minute sweep catches lost jobs via the
sla_due_atindex.
- When a due time is set, the same transaction queues
-
Breach output. A breach emits
conversation.sla_breachedand a warning emitsconversation.sla_warning(realtime and webhooks). Both notify the assignee, or the team’s members when there is no assignee, through two new member notification kinds (sla_warningpush;sla_breachedpush and e-mail). -
API, stats, reports.
Conversation.sla={policy_id, due_at, state: on_track | due_soon | breached | met | paused, targets[]}./v1/statsgainssla.metandsla.breached, in total, per inbox and per member (assignee_id_at_outcome). Y-147 rolls up the met and breached instants ofconversation_sla. -
Endpoints.
/v1/sla-policies(CRUD plusPUT /order):inboxes:readandinboxes:manage, owners and admins. -
As built (#140, migrations 00109 and 00110). Outcomes live in
sla_outcomes(one per target start, unique on conversation, target and start; insertsON CONFLICT DO NOTHING), because next-reply targets replace one another onconversation_sla;/v1/statsand #147 count from it. A breached target keeps itsdue_atuntil met, so breached conversations sort first. Every evaluation re-checks that the row’s policy is enabled and matches; when no policy applies (spam, trash, no match, a policy disabled, narrowed or deleted) the row is kept withdropped_atinstead of being deleted, and when one applies again the running targets get back the business time they had left, so time while dropped never counts and a breach is never recorded twice. A conversation that never had a row starts no target before the policy’screated_at. Policy edits and label or inbox deletions re-evaluate the conversations they drive in the same transaction; deleting the last label or inbox in a policy’s list turns the policy off. The clock walks civil dates, so days whose midnight does not exist (America/Santiago) are neither skipped nor counted twice; enabled hours with no intervals count as plain time. A warning is queued only while its time is still ahead.snooze_wakeleaves spam and trashed conversations snoozed. Inbox-limited keys cannot write policies; agents and limited keys see policies with no inbox list or one naming their inboxes.conversation.updatedis also sent when onlyslachanges. Notification recipients still need inbox access;awayskips team members, not the assignee.
Automation rules (#141).
-
Rules.
automation_rules (workspace_id, id, name, enabled, position, inbox_id nullable, trigger, idle_minutes, conditions jsonb, actions jsonb, created_by, …).- Triggers:
conversation_created,message_received(contact message),status_changed,idle. - Conditions are an all-of list over: channel kind, kind, feedback category, subject or body contains, contact attribute, label, priority, team, assignee empty, inside or outside business hours.
- Actions, at most 10 per rule: add or remove label, assign (member, team, or the auto-assignment pool), priority, status, snooze, note, reply with a canned reply, send to a webhook endpoint.
- Triggers:
-
One ordered list. Workspace and inbox rules share one list ordered by
position; an inbox rule is a rule withinbox_id. -
Runs.
automation_runs (workspace_id, id, rule_id, conversation_id, trigger_key, outcome: applied | failed, error, actions jsonb, created_at)with a unique key on(workspace_id, rule_id, trigger_key). Kept 30 days.GET /v1/automation-rules/{id}/runsis the rule log. -
Queuing.
inTxcallsqueueAutomations(ev.items). Each eligible event queuesautomation_run {workspace_id, event_id}, using the idswriteEventsreturns.trigger_keyisevent:<id>. Foridle, a 5-minute sweep usesidle:<conversation_id>:<last_activity_at>, so each idle period fires once. -
Execution. The job loads the enabled rules for the trigger in order. For each rule, one transaction:
- lock the conversation;
INSERT automation_runs … ON CONFLICT DO NOTHING; zero rows means the rule already ran, so skip it;- evaluate the conditions on the current state, so a later rule sees an earlier rule’s changes; when they do not match, roll back, so no row is written;
- apply the actions through the same code as
/v1(changeConversation, message create) under a rule principal that sees every inbox.
A failed action rolls back that rule’s transaction and records
failedin a separate transaction. Rules already committed stay committed on retry, so each rule has at most one effect per trigger. -
No loops.
eventBatchcarriesorigin_rule_id; events written by a rule store it in the payload (rule: {id, name}), andqueueAutomationsskips them. A rule’s change never triggers a rule. -
Customer-facing safety. A canned-reply action is skipped (outcome
failed, reasonauto_reply) when any of these hold:- the triggering message is
message_emails.autoor a bounce; - the contact is blocked;
- the conversation is spam;
- a rule already replied in this conversation within the hour (
ClaimAutoReply-style claim).
- the triggering message is
-
Webhook action. It delivers an
automation.triggeredevent to an existing endpoint through the normal delivery jobs (same signing and address checks). Rules store no URLs or secrets. -
Rate limit.
automation_actions, 600 per workspace per minute, checked in the job before any transaction opens. Over the limit, the job snoozes 60 s. -
Order with assignment. The automation job queues
auto_assignlast forconversation_createdandmessage_received(reopen). -
Scopes.
automations:read;automations:manageis a manager scope, never implied, refused for inbox-limited keys. A rule acts with workspace-wide power. -
Audit.
automation_rule.created,.updated,.deleted(target host only for webhook actions). -
As built (#141, migration 00113). While
bots_may_sendis off a rule reply needs both the rule and its canned reply last saved by a member who is owner or admin at run time; a rule’ssaved_bychanges when its trigger, idle minutes, inbox, conditions, actions orenabledchange, not on rename or reorder, and canned replies recordsaved_bywhen their body changes (replies saved before 00113 count as unknown and must be saved again). Rule replies are also capped at three per conversation in 24 hours. A rule whose conditions did not match commits anot_matchedrun, so a retry never evaluates it again on a later state; database errors are retried by River, business refusals becomefailedruns with a specific reason (auto_reply,bot_sending_disabled,field_required,team_access,label_gone,canned_reply_gone,webhook_unavailableand more). Every message a rule writes has authorsystemandMessage.rule {id, name}; each applied run adds arule_appliedtimeline event;conversation.updateddoes not name the rule. Rule notes and replies movelast_message_atbut notlast_activity_at, so a rule never starts a new idle period; an idle run re-checks under the conversation lock that nothing happened since and the conversation is still open or pending and not spam.conversations.snooze_rule_idrecords the rule that set a snooze, and its wake triggers no rule. The idle sweep runs every 5 minutes over open and pending conversations quiet for the rule’s minutes (a window of 15 minutes, 2000 per value per sweep). Inside one rule: note, reply, one conversation change, then the webhook. The rate limit is taken per rule before its transaction, all or nothing, only for rules that will apply; a refused job snoozes until the window ends and resumes from that rule. Deleted references are not stripped: an action needing one fails the run; deleting an inbox deletes its rules. Conditions includestatus; operators arein,not_in,equals,not_equals,contains,not_contains,is_set,is_not_set.automation.triggeredcannot be subscribed to; it reaches only the endpoint a rule names. -
Mail filters (#173, migration 00137). A filter is a rule with the
inbox_idof amailinbox and the triggermail_received, queued next tomessage_received(sameevent:<id>key, so one run per rule and trigger) for every inbound e-mail message, first or later; drafts, outbound mail and imports never run one, nor does a delivery report ingress trusts (null envelope sender under a v2 signature and a parsed DSN, marked on the event asbounce): a sender-writtenReturn-Path: <>orpostmaster@From runs filters like any mail. The job reads the inbox and the e-mail’s facts (from, to, cc, List-Id lower-cased without angle brackets, non-inline files;MailFactsOf, no column) once for all its rules. Conditionsfrom,to,cc,list_id(contains/not_contains, case-insensitive) andhas_attachment(equalstrue/false) go only withmail_received, whose values,subjectincluded, are 3 to 200 characters. Actionsstar(member_ids),archive(statusclosed; excludesset_statusandsnooze),trash(last, after therule_appliedevent; excludesforward_to_member, whose notifier drops trashed conversations) andforward_to_member(amail_forwardednotification, push and e-mail by preference) are mail-only. A shared mail inbox’s filter takes every action; a personal mailbox’s only labels, star, archive, trash, snooze, forward, status, priority and assign/unassign. Every member a filter stars for, assigns or forwards to must read the inbox (memberHasInbox, themember_inbox_accessview, so #171 delegates count):400at save, afailedrunno_accessat run time. Personal mailboxes are told apart byisPersonal(inbox)alone. Their filters use onlymail_received; only the owner sees and writes them, by session or own grant (agents’ grants never carryautomations:manage); everyone else, owners, admins and keys included, gets404on them and400(inbox_id must be an inbox of the workspace) creating one there; an orphaned mailbox’s filters are nobody’s. They cannot change inbox, a shared rule cannot move into one,stardefaults to the owner, and their audit rows, the trash a filter does included, carry no details. Positions and the 100-rule limit count per scope: each personal mailbox, and all other rules.GET /v1/automation-ruleslists the rules outside personal mailboxes; a mailbox’s filters only with?inbox_id=and only to its owner;PUT /orderorders the caller’s mailbox whenids[0]is one of its filters. They run as the system for that mailbox only (principal.mailbox, admitted bycanReadPersonalandcanSeeInbox); workspace rules never run on a personal mailbox. Mail inboxes never auto-assign, somail_receivedholds assignment only inassignAfter’s order, aftermessage_received.GET /v1/messages/{id}/filter-suggestion(inbound e-mail of a mail inbox the caller reads) returns a draft:frompluslist_id, else that e-mail’ssubject, each only when 3 to 200 characters, no actions.
Macros (#142).
-
Table.
macros (workspace_id, id, owner_member_id nullable, name, shortcut, body nullable, actions jsonb, position, …). Null owner means shared. Shortcut is unique per owner scope. -
Actions. Labels add and remove, assignee or team, status, priority, snooze duration.
-
Endpoints and scopes.
/v1/macros. Read withconversations:read(shared ones, plus the caller’s own). Personal macros need a member session or OAuth token. Shared macros are written by owners, admins and keys withcanned_replies:write. -
Composer. The
/menu and the command palette list canned replies and macros together. Choosing a macro fills the composer and holds its actions. -
Applying on send.
MessageCreategainsthen: ConversationUpdateplusmacro_id. The server applies them in the same transaction as the message, so the existing undo hold (which only delays the POST) covers both. The timeline event names the macro. -
Unchanged. Canned replies stay as they are.
thenis also how “send and close” can become atomic later. -
As built (#142, migration 00100). Actions are
add_labels,remove_labels,assignee_id(null unassigns),status,snooze_minutes(implies snoozed) andpriority; members only, no team yet. Shortcuts are unique among shared macros and per member among personal ones.thenoverrides the macro field by field. A macro’s assignee who can no longer take the conversation is skipped and themacro_appliedevent saysskipped: ["assignee"]; an assignee inthenis still refused. Removing a member clears them from macros, deleting a label strips it, both in the same transaction; saves check labels and the assignee underFOR SHARElocks. A repeatedclient_idapplies nothing.
Saved views (#143).
-
Table.
saved_views (workspace_id, id, name, visibility: personal | workspace | team, owner_member_id, team_id, filters jsonb, position, …). -
Filters. The stored filters use exactly the
ListConversationsquery parameters, validated by the same parser. -
Who manages them. Personal views: any member. Workspace and team views: owners, admins and keys with
views:write. Team views are listed to team members, owners and admins. -
Counts.
GET /v1/viewsreturns each view withcount, open conversations counted under the caller’s owninbox_viewersfilter, capped at 1000. A shared view therefore never counts or lists anything the caller cannot see. At most 50 views per caller. -
Deleted labels and teams. The delete transaction strips the id from
filterswith a jsonb update. A rename changes nothing, because views store ids. -
As built (#143, migration 00111).
filtersare parsed byconversationFilter, the same codeListConversationscalls, so a list parameter added there is a view filter with no change in views; at most 30 parameters of 2000 characters. Every views endpoint needsconversations:read, writes alsoviews:write. Limits are 50 personal views per member, 50 workspace views and 50 per team;GET /v1/viewslists the caller’s own, the workspace’s and their teams’ views without truncation, and owners and admins reach other teams’ views with?team_id=. Inbox-limited keys neither see nor write team views. Counts wrap the list’s own statement incount(*), four at a time, each stopped after one second (count_unavailable). Deleting a team deletes its team views; PATCH locks the view and writes only the fields sent.
Custom fields (#144).
-
Definitions.
custom_fields (workspace_id, id, object: conversation | contact, key ^[a-z][a-z0-9_]{0,39}$, name, type: text | number | date | select | checkbox, options jsonb, required_on_close, position). At most 50 per object. -
Values.
- Conversations:
conversations.fields jsonb NOT NULL DEFAULT '{}'. - Contacts: the existing
attributes. A key with a definition is validated (400 field_invalidon/v1). On/client/v1and identity tokens an invalid value is dropped and logged, never refused. Other keys stay free-form.
- Conversations:
-
Filtering.
field.<key>=<value>on the list and in views, viafields @> $1, served by a GIN index (jsonb_path_ops). -
Required on close. Closing without a required field answers
409 field_required(withfield). This holds on PATCH, bulk (per item), MCP, macros and rules (the rule logsfailed). -
Deletions. Deleting a field or a select option clears the conversation values in a River batch job; contact attributes are kept.
-
Endpoints and payloads.
/v1/custom-fieldswith the new manager scopefields:manage. Values are written withconversations:write/contacts:write.fieldsappears on webhook and realtime payloads. -
As built (#144, migrations 00106 and 00107). Object, key and type are immutable;
optionsreplaces the list;required_on_closeexists only on conversation fields. Every deletion of a field or a select option queues its owncustom_field_clearjob, which walks conversations by id 500 at a time; a create refused with409 field_clearingqueues a fresh clear, so a lost job never blocks a key. Lifting spam from a closed conversation also needs the required fields. Spam conversations close without them. A “reply to linked” with close still sends and leaves a conversation open when its required field is missing.
MCP (coverage rules).
- Added:
list_teams,list_macros(body as text fordraft_reply; actions listed),list_custom_fields,set_conversation_fields. Also:assigngainsteam_id;search_conversationsgainsteam_id,sla_state,sort=sla_dueandfields;get_conversationreturnsslaandfields. - Left out on purpose:
- Team management and membership: access, under the credentials-and-access rule.
- Automation rules, read and write: they act with workspace power and can mail customers and call webhooks.
- SLA policies and field definitions: workspace settings.
- Saved views: a panel construct; search covers the filters.
- Macro writes and applying a macro: actions are applied only on a member’s send.
Webhook and event types added: team.created, team.updated, team.deleted, conversation.sla_warning, conversation.sla_breached, automation.triggered (endpoint action only).
Left out of M28:
- holiday calendars;
- per-member business hours;
- skills-based routing;
- load weighting by channel;
- SLA on
mailinboxes; - rules with OR groups;
- rules triggered by notes or by other rules.
Reports (M29)
Built in #147 (migration 00114). Reports answer from rollups, never by scanning messages over the
range, and agree with /v1/stats for today.
- Granularity: UTC quarter hours.
report_rollups (workspace_id, bucket, inbox_id, channel_kind, team_id, member_id, label_id, outbound, metric, bin, n)holds sums per 15-minute UTC bucket, not per day or hour: every offset in use today is a multiple of 15 minutes (India +5:30, Nepal +5:45, Chatham +12:45), so any local day, week or month is a whole number of buckets and a report in any IANA zone is exact. Reads sum buckets intodate_trunc(granularity, bucket AT TIME ZONE tz). Rows exist only where something happened. Index(workspace_id, bucket). - Facts. One query (
ReportFacts) lists everything that happened in a window, each with the conversation’s inbox, channel kind and team and the member it is attributed to, counted exactly as/v1/statscounts:replies(member replies or bot drafts a member sent; bots, rules and automatic replies never),closed,reopened(previous_statusclosed),opened(not spam, not imported),first_reply(stats’ definition, attributed to the replier),resolution(each close after a contact message, from the first such message after the previous close, attributed to the closer),rating_good|bad(atrated_at, to the assignee), andsla_<target>_<met|breached>fromsla_outcomes(inbox, assignee and team at the outcome). Trashed conversations and imported rows are left out. Labels are the conversation’s labels when its bucket is built; each fact is written once withlabel_idnull and once per label, and totals read only the null rows. - Percentiles: fixed log histograms.
first_replyandresolutionrows count per bin: bin 0 is under a second, bin b holds [1.05^(b-1), 1.05^b) seconds, capped at 400 (about 9.5 years). Bins add up across buckets, days and groups, so medians and p90 over any range are exact up to the bin: within 2.5% when read at the bin’s geometric middle, interpolated between neighbouring samples so an even count’s median is the mean of the middle two as in/v1/stats. No t-digest: merging fixed bins in SQL is a plainsum. - The job. A periodic
report_rollup_scan(5 minutes) queuesreport_rollup {workspace_id}(unique while pending) for every workspace (ListWorkspaceIDs, the SLA sweep’s listing).report_rollup_state (workspace_id, built_until, recomputed_on, recompute_at)drives it, each step one transaction under the state row’s lock that deletes the window’s buckets and copies fresh ones: first a UTC day at a time from the first activity reports count (the earliest of a native conversation, a message that was not imported, so replies in imported threads count, and an SLA outcome; the backfill), then today from midnight UTC (or 10 minutes beforebuilt_until, whichever is earlier) to the last quarter-hour edge on every run;built_untilis always a bucket edge, so a bucket is never part rolled up and part counted live, and once per UTC day the 31 days before today, a day per step (recompute_atresumes an unfinished rebuild). A run stops after 20 seconds and snoozes itself to go on. Deleted workspaces are skipped. - Reading.
GET /v1/reportsreads the rollups beforebuilt_untiland, whenbuilt_untilis less than a day old, counts the facts after it live and passes them to the same SQL as arrays, so one query filters, checks access and groups both. Inboxes are filtered throughinbox_viewers. Deleted inboxes and labels drop out at read time; deleted teams and members fall into the group without a key. The ids are not foreign keys, so no deletion rewrites the table.from/toare local days, at most 13 months apart; series list every period, the first cut atfrom. - API.
GET /v1/reportsandGET /v1/reports/export(CSV, the same parameters, formula-safe cells as the consent export), scopereports:read(every member’s token may have it; implied for keys made without named scopes from now on, never added to older keys). MCPget_report. - Privacy. Rollups hold counts and ids, no content. They go with the workspace (foreign key on
workspace_id,ON DELETE CASCADE). Retention days do not apply to them; the nightly rebuild stops at the retention cutoff, so periods whose conversations retention deleted keep their counts. Conversations deleted or trashed inside the rebuild window drop out of it.
Conversation origin (#211)
Support inboxes also send broadcasts, triggered e-mails and designed outreach, and replies to them
open conversations next to support requests. A conversation’s origin is derived, not stored:
outbound when it has broadcast_id (a reply to a broadcast, triggered e-mails being broadcasts of
kind triggered) or holds an e-mail with message_emails.outreach (a design sent to a contact who had
not written in the conversation, #209); support otherwise. The SQL function
conversation_outbound(workspace_id, conversation_id, broadcast_id) (migration 00145) is the one
definition; the outreach check is an EXISTS over message_emails_conversation_idx.
- List.
GET /v1/conversations?origin=support|outboundcombines with every other filter,broadcast_idincluded; saved views take it like any list parameter. MCPsearch_conversationstakesorigin. - Counts.
GET /v1/conversations/countsaddsoutboundandoutbound_inboxes(open, not spam, per inbox), included in the other counts, for the panel’s “Replies to mail we sent” entry under each inbox. MCPget_countsreturns them. - Reports.
report_rollups.outboundis a rollup dimension, set per fact from the conversation’s origin when its bucket is built (ListReportOutbound, like labels).GET /v1/reports, its CSV export and MCPget_reporttakeorigin; without it every figure counts both origins, as before. Migration 00145 adds the column (older rows count as support) and clearsrecomputed_on, so the next run rebuilds the last 31 days with origins; older periods staysupport.
Components
┌──────────────────────── yuva (one Go binary) ─────────────────────────┐
e-mail ─► edge/ Email Worker ─► /ingress/email ─┐ │
any MTA ─────────────────────► /ingress/email ─┤ │
widget, SDKs ─────────────────► /client/v1 + WS ┼─► store (Postgres) ◄─ jobs (River) ──┼─► SMTP
host backends ────────────────► /v1 (API keys) ─┤ ▲ ├─► webhooks ─► host backend ─► APNs/FCM
panel (embedded SPA) ─────────► /v1 + WS ───────┘ └─ LISTEN/NOTIFY realtime ├─► web push to members
└───────────────────────────────────────────────────────────────────────┘
object storage: S3-compatible or local disk
Server (api/)
- Go,
net/http, OpenAPI 3.1 contract inopenapi/openapi.yaml, strict server generated with oapi-codegen. Postgres through pgx and sqlc; goose migrations. - Background work on River (Postgres-backed queue): outbound e-mail, webhooks, notification
fan-out, attachment cleanup, retention, and migrations on their own
migrationsqueue (see “Moving to Yuva”). Calls to the outside that can hang or retry for long run on their own queues, so a customer’s broken endpoint never holds up assignment, automation, SLA checks or notifications on the default queue:webhooks(10 workers, webhook deliveries only),outbound(10: member Web Push, app push, Slack posts and events, issue-tracker sync),email(10: sending through a channel’s SMTP: replies, list mail, deliverability and migration probes) andimports(2: help-center imports). Each job kind sets its queue in its own insert options. - Rate limits count in Postgres so every replica shares them (#134):
rate_limits(UNLOGGED, one row per key) holds a fixed window that starts with the key’s first request; one upsert per check counts and answers, and several keys go in one statement when a batch is checked (analytics server events; takes of one key are merged first). Windows and leases are measured by the database’s clock (clock_timestamp()), never a replica’s. When the database check fails (logged at most once a minute), a check for a signed-in member, API key or grant lets the request through, and every other check (anonymous and contact traffic, jobs) counts in the process’s own fixed windows with the same limits (at most 100,000 keys; a new key beyond that is refused) (#185). Several keys that must all fit are taken all or nothing (takeEvery) in a short transaction of their own: missing windows are opened and lockedFOR UPDATEin key order and counted only when all fit, so a refused request spends no key; never inside a caller’s transaction. A check that depends on rows a transaction read (slug changes, idea votes, subscription confirmations, new anonymous visitors) runs on that transaction’s connection in a savepoint, so it never waits for a second pool connection; all other checks run before any transaction opens. Keys are HMAC-SHA256 (derived from the master key) of the limit name and its subject, truncated to 16 bytes, so no address or e-mail address is stored. The 4 concurrent analytics queries per workspace are leases inrate_slots(2 × the query timeout + 30 s, so a crashed process frees them). A River job every minute deletes ended windows and leases.rate_limitsandrate_slotsare the written exception to theworkspace_idrule: most limits are per address or token before any workspace is known, and the key is a hash. Sign-ups, migration connection tests and list imports count their own rows, as before. - Budgets that every visitor of one channel, page or centre shares are a
budget{network, ceiling}(#187): after the per-address limit (IPv4 /32, IPv6 /64), one network (IPv4 /24, IPv6 /48,rateNet) may usenetworkof it, andceilingonly caps the total load, so a flood from a few sources never refuses the others. Per network and ceiling: session starts and page ratings or help reactions 120 / 6,000 a minute, contact writes 240 / 12,000, help search 120 / 12,000 per centre, list sign-ups 40 / 6,000 an hour, status sign-ups 40 / 3,000 an hour per page, what’s new 480 / 24,000 a minute per changelog. - Public hardening (#191). The Caddy ask (
GET /status-domains/check) never limits the proxy’s own asks (client address equal to a loopback or trusted TCP peer); other callers get 120 a minute per address and 30 a minute per name memory cannot answer. A live domain and a known miss are answered from the own-domain cache (30 s) without counting, a known page that is not live is looked up each time, so publishing counts at once and workspace deletion reaches the ask within 30 s. Analytics share passwords hash with argon2id m=7 MiB, t=5, p=1 (OWASP’s equivalent of m=19 MiB, t=2, a third of the memory per guess), at most 4 at once per process; stored hashes keep their settings, above m=64 MiB, t=10 or p=4 refused. Unlocks: 30 a minute per address and 10 per address and link count every attempt; only wrong passwords count against the link, 60 an hour per link and network and 1,000 per link, checked without counting before hashing (past either every unlock gets 429; a database failure there answers 500). The analytics property cache remembers unknown keys in a map of their own for a minute, and a key that is notyuva_ak_and 24 base64url characters is never looked up. Public page caches (status, help, roadmap, changelog) key by page id and keep at most 200 entries a page in a list-based LRU; a full page or cache drops its expired entries, else its least recently used one, never the whole cache. - Realtime: WebSocket (
coder/websocket). Every change that members see live writes a row toeventsin the same transaction, last, under a per-workspace advisory lock, so event ids within a workspace follow commit order; the transaction’sNOTIFYcarries the id. One listener per process loads each notified event and an in-process hub fans it out to that workspace’s connections, filtered by inbox access. Clients resume with the last event id: the server replays newer events (kept 7 days, cleaned by a River job) before live ones, or answersresync_requiredand the client reloads over HTTP. A slow connection is closed instead of holding up the hub; when the listener reconnects, every connection is closed so it resumes. Typing and presence notices are not stored: they travel as the payload of a secondNOTIFYchannel, have no id and are never replayed. Each open realtime connection is a row inrealtime_connections, seen on every heartbeat; presence is read from the rows seen in the last 75 seconds. Members see their teammates the same way:/v1/membersreports each member’savailabilityand whether they areonline, and amember.presencenotice reaches the workspace’s member connections when a member connects, disconnects or changes availability. Contacts likewise: acontact.presencenotice reaches the member connections that can see the contact when its first/client/v1/realtimeconnection in a process has loaded (ready) and when the last loaded one closes, at most once per 2 seconds per contact (a change inside that time is announced once when it ends); continuity and app-push scheduling run on the last close only. Per process a contact session keeps at most 20 client sockets and an address (rateIP) 200; a socket beyond either is accepted and closed at once, before any replay, with 1013too_many_connections;retry_after=30. The cap bounds one process’s memory and fan-out, not the cluster’s: a NAT with more than 200 open widgets on one replica loses live updates for the extra ones, which still work over HTTP. Connects are limited cluster-wide before the upgrade: 30 a minute per session and 120 per address (429 rate_limited). A client’s replay starts atmax(last_event_id, contact_sessions.first_event_id)(the workspace’s newest event when the session was made, migration 00125) and reads at most 1,000 events; past that it getsresync_required(#188)./v1/realtimerecords a member connection (presence, automatic assignment) only for member sessions and first-party member-app tokens; keys and assistants stream without making the member present (#192). When a contact reads further in the widget or an app, the conversation’slast_read_by_contact_atmoves (kept on the conversation row next tocontact_reads) and a storedcontact.readevent reaches the members who can see the conversation; it never goes to webhooks or to contacts. A connection that ends without closing (a process that died) only stops being seen, so a River job every minute announces the members and contacts whose last connection went stale in the previous two minutes. - The panel and the widget bundles are embedded with
go:embed; one binary serves everything. - Configuration through environment variables. Secrets stored in the database (SMTP passwords,
identity secrets, webhook secrets) are encrypted with AES-256-GCM under a master key,
YUVA_MASTER_KEY(32 random bytes, base64, e.g.openssl rand -base64 32). The server does not start without it, and losing it makes the stored secrets unreadable. Rotation (#194, migration 00128):YUVA_MASTER_KEY_PREVIOUS(one key, never equal to the current one) is accepted for opening values while new ones are sealed with the current key;yuva master-key rotatere-seals every registered sealed column in batches, compare-and-swap so a concurrent panel save is never overwritten, and ends by runningyuva master-key check, which exits non-zero until nothing needs the previous key. A test fails when a new binary column is registered neither as sealed nor as not sealed. Derived values (mail link tokens, probe headers, share tokens, the DNS proof value) are accepted under either key while the previous one is set; rate-limit windows start over. Opt-out hashes cannot be re-derived, so each workspace’s opt-out key is stored sealed inworkspace_keys, written at startup for every workspace while no previous key is set; with a previous key the server refuses to start when a workspace with opt-outs has no stored key. After a suspected leak the previous key is removed at once rather than kept for old links. slogstructured logs, Prometheus metrics,/healthzand/readyz.
API surfaces
| Prefix | Used by | Auth |
|---|---|---|
/v1 |
panel, host backends, scripts | member session cookie, or workspace API key |
/client/v1 |
widget, mobile SDKs | channel public key + contact session, or a reader token on the discussion endpoints |
/client/v1/analytics/{key} |
the analytics script, useyuva/analytics, the mobile analytics modules |
an analytics property’s public key; browsers only from the property’s domains |
/v1/analytics/shared/{token} |
read-only analytics shares | a share token (and its password session) |
/ingress/email |
edge Worker, MTAs | HMAC signature over the raw message |
/ingress/ses |
SES bounce and complaint notifications via SNS | SNS signature |
/s/{token}, /m/{token}, /c/{token}, /i/{token} |
people who receive list and broadcast mail | a token sealed under the master key; an image token |
/status/{slug}, /client/v1/status/{slug}, a verified status domain |
anyone reading a published status page | none |
/roadmap/{slug} |
anyone reading a public roadmap board | none |
/changelog/{slug} |
anyone reading a published What’s new feed | none |
/ingress/heartbeat/{token}, /ingress/status/{token} |
host jobs and monitoring (heartbeats, Alertmanager, Grafana) | a monitor token |
/v1/realtime, /client/v1/realtime |
panel, widget, SDKs | as above |
A member session belongs to a person, not to a workspace. Workspace endpoints act on the workspace
named in the Yuva-Workspace header, or on the person’s only workspace when the header is absent.
An API key acts on its own workspace only and cannot manage members or keys.
A /v1 request other than GET/HEAD that carries the session cookie (and no bearer token) must
come from the panel: its Origin must be YUVA_PUBLIC_URL or a WebAuthn origin (without
Origin, Sec-Fetch-Site: same-origin is required; else 403 origin_not_allowed), and a body
must be application/json or multipart/form-data (else 415 unsupported_media_type), which a
cross-site form or a no-cors fetch cannot send. SameSite=Lax alone lets sibling subdomains
post with the cookie.
Owners and admins make keys in the panel or with /v1/api-keys. An operator with access to the
server’s database makes them from the command line with the same code, for scripts and
provisioning before anyone has signed in:
yuva api-key create --workspace <id|name> --name <name> # prints only the secret, once, on stdout
yuva api-key list --workspace <id|name> # id, prefix, name, dates; never a secret
yuva api-key revoke <id>
--workspace takes the workspace id or its exact name; a name that more than one workspace has
is refused with their ids. A key made this way has no creating member.
Inboxes and channels are managed by owners and admins; the same operator can create them from the command line, which runs the HTTP handlers as an owner of the workspace (same validation, SMTP password encryption and events):
yuva inbox create --workspace <id|name> --name <name> [--slug <slug>] [--locale <tag>] \
[--timezone <zone>] [--mode live|async] [--expected-reply-minutes <n>] # prints the inbox id
yuva inbox list --workspace <id|name>
yuva channel create-email --workspace <id|name> --inbox <id|slug> --name <name> --address <address> \
[--display-name <name>] [--from-address <address>] [--smtp-host <host> [--smtp-port <n>] \
[--tls starttls|tls|none] [--smtp-username <name>] [--smtp-password-file <path|->]] # prints the channel id
yuva channel create-chat --workspace <id|name> --inbox <id|slug> --name <name> --origin <origin>... \
[--allow-anonymous] [--ask-email-offline=false] [--greeting <text>] # prints the channel id and public key
yuva channel list --workspace <id|name> --inbox <id|slug> # never a password
The slug is made from the name when omitted. The SMTP password is read from a file or, with -,
from stdin, never from the command line; the auto-reply stays off. The inbox’s identity secret is
not printed; rotate it when an app needs one.
Unlike the commands above, the MCP bridge needs no database or server configuration; it runs on the machine of whoever uses an assistant (see “MCP for local clients”):
yuva mcp stdio --url <server> --key <key> # or YUVA_URL, YUVA_API_KEY; stdout carries only MCP
Headless access
Everything the panel does is reachable without it: scripts, bots and other UIs use /v1 with
scoped API keys, and every key-authored message names its bot.
Scopes. A key holds a list of scopes; every /v1 operation a key may call needs exactly one:
| Scope | Operations |
|---|---|
conversations:read |
list, get and count conversations; list messages and pending drafts; attachments, message e-mail and raw source; list labels and canned replies |
conversations:write |
create, update (status, assignee, snooze, priority, labels), move and bulk-update conversations |
messages:write |
outgoing and incoming messages, drafts: create, edit, discard |
drafts:send |
send a draft (POST /v1/messages/{id}/send), together with messages:write |
notes:write |
notes |
contacts:read |
list, look up and get contacts, presence |
contacts:write |
create, update, delete and merge contacts |
inboxes:read |
workspace, members, inboxes, inbox members, channels |
inboxes:manage |
create, update and delete inboxes and channels, inbox access, secret and key rotation |
labels:write |
create, update and delete labels |
canned_replies:write |
create, update and delete canned replies |
webhooks:manage |
webhooks, their deliveries and attempts |
workspace:manage |
update the workspace, usage |
migrations:manage |
migrations: detect, create, change, connect, test, scan, start, pause, resume, cancel, finish, remove imported history, errors, probe, uploads |
feedback:write |
feedback |
lists:read |
lists, subscriptions, growth, consent export, imports |
lists:write |
lists, subscriptions, confirmations, imports |
broadcasts:read |
broadcasts, deliveries, reports, designs, templates, images, previews |
broadcasts:write |
drafts, designs, images, test sends |
broadcasts:send |
schedule, unschedule, pause, resume, cancel (only while the workspace allows keys and assistants to) |
analytics:read |
analytics properties, queries, realtime, goals, funnels, segments, annotations, health, exports (read) |
analytics:write |
server-side analytics events (API keys only) |
analytics:manage |
create, change and delete properties, keys, goals, funnels, shares, exports, data deletion |
roadmap:read |
roadmap boards, stage history, linked counts |
roadmap:write |
links between feedback and ideas, linked replies, board settings for keys |
roadmap:stage |
move an idea’s stage (never implied) |
changelog:read |
What’s new feeds and entries |
changelog:write |
feeds, entries and translation drafts |
changelog:publish |
publish, schedule, unpublish and delete published entries (never implied) |
audit:read |
the workspace audit log (never implied; owner-only, see Audit log) |
integrations:read |
GitHub and Linear integrations |
integrations:manage |
connect, change and disconnect GitHub and Linear, webhook secrets |
issues:write |
create, link and unlink GitHub and Linear issues on feedback and ideas |
A call without its scope gets 403 insufficient_scope with the missing scope in scope. Keys made
before scopes existed hold every scope above. Scopes added later (lists:*, broadcasts:*, integrations:*, issues:write) are never
added to existing keys, and broadcasts:send, status:manage, roadmap:stage, changelog:publish and audit:read are never implied: a key made without
naming its scopes holds every scope but those. yuva api-key create takes --scope (repeatable, default
every scope but those five) and --inbox (repeatable).
A key may be limited to some inboxes. It then sees what an agent with access to exactly those
inboxes sees; it cannot hold inboxes:manage, webhooks:manage, workspace:manage, migrations:manage, integrations:manage or audit:read (refused when
the key is made). An inbox that is deleted drops out of the limit; a key whose every inbox is gone
sees nothing. A key may have an expiry; after it, the key gets 401 api_key_expired. Scopes, inbox
limit and expiry are fixed when the key is made; a different set needs a new key. Name, bot name and
bot avatar can be changed (PATCH /v1/api-keys/{id}).
Bot authors. Every key is a bot: a display name (the key’s name unless one is given) and an
optional avatar, an https image URL. Messages, notes and conversation events written with a key
have author type bot and point at the key; the bot’s current name and avatar are shown in the
panel, the widget, the SDKs and webhook payloads. Outgoing e-mail from a bot uses the inbox’s From
address with the bot’s name as display name. Rows written by keys before this have author system
and stay so.
Drafts. An outgoing message can be a draft (draft: true on create). A draft is only on /v1:
never on /client/v1, never e-mailed, never a notification, unread count, preview, first response,
usage or search hit. A draft written by a key (author.type bot) is visible to the members who see
its conversation and to keys, so a member can review it. A member’s draft, written in the panel or
through an OAuth client (via set), is private to that member: for everyone else, members and keys,
it is not in GET /v1/drafts or the message list, PATCH/DELETE /v1/messages/{id} and
POST .../send answer 404, and its draft.* events reach no one else and no webhook. It stays
private when its author leaves the workspace (it keys on author_type = 'member'). The SQL
functions draft_visible_to(draft, author_type, author_member_id, viewer) and
conversation_visible_to(draft_of, viewer) (migration 00134) hold the rule once; every query that
lists messages, drafts or conversations calls them with the viewer’s member id (null for a key),
and later rules (delegates of a personal mailbox) add their own conditions next to them.
A conversation a member’s new mail draft creates (POST /v1/conversations/mail with draft: true)
carries draft_of = that member and is hidden from list, counts, search, home and GET (404) for
everyone else, and from the contact on /client/v1. While draft_of is set, every event about it
(stored events and typing signals) carries only_member = the author, taken from the conversation
in hand where the event is built (eventBatch.conversation, typing): realtime, /v1/events and
MCP subscriptions deliver it only to the author, /client/v1 realtime to no one, and it queues no
webhook, rule or notification. Discarding its draft deletes the conversation in the same
transaction (conversation.deleted to the author only); removing the author, or deleting their
account, deletes their hidden conversations with their stored files (the draft_of foreign key
cascades as a backstop). The first send clears
draft_of and emits conversation.created before message.created, so rules and webhooks see it
then.
A draft can be edited (PATCH /v1/messages/{id}, also while scheduled; no audit row or timeline
event); a member’s own unsent new mail (draft_of set) also takes to, cc, bcc and
subject there, checked as in composeMail (a key’s new mail draft answers
409 not_a_private_draft). A new first To becomes the conversation’s contact, the subject the
conversation’s, which emits conversation.updated; the contact it replaces is deleted in the same
transaction when it was created after the draft and has nothing else (name, attributes, other
addresses, conversations, messages, notes, subscriptions, sessions, deliveries). A draft’s
recipients are contacts like any others and are seen workspace-wide, as contacts are (Team mail);
the draft itself, its subject, body and that it exists stay its author’s. Its stored lists
come back as recipients on the message in /v1 answers only, never in events, with bcc empty
for API keys other than the draft’s author and for OAuth tokens. A draft is
discarded with DELETE /v1/messages/{id}; both answer 409 not_a_draft for anything else.
POST /v1/messages/{id}/send delivers it: the message becomes a normal outgoing message with the
send time as its time, sent_by the member who sent it, and the draft author kept as author.
Events: draft.created, draft.updated, draft.deleted on realtime and as webhook types an
endpoint subscribes to; sending emits the usual message.created.
GET /v1/drafts lists the drafts waiting in the conversations the caller can see, newest first,
each with a conversation summary (id, inbox, subject, status, contact) and composed (a new
mail draft rather than a reply draft), filtered by inbox_id,
conversation_id, mine=true (the caller’s own), scheduled=true|false and author: bot
(written with a key), assistant (a member through an OAuth client, via set) or member (the
panel); total counts the matches over all pages for a badge. Keys and tokens call it with
conversations:read. A client keeps it current from the draft events above and message.created
(a sent draft keeps its id), plus conversation.updated, conversation.moved and
inbox_access.changed.
Send later. A member session (keys and tokens get 400; MCP has no tool for it) passes send_at
(RFC 3339, at least 1 minute and at most 366 days ahead, else 400 invalid_send_at) on a new
message, a new mail or POST /v1/messages/{id}/send. A scheduled message is the member’s own draft
with scheduled_at and scheduled_by; the Cc, Bcc and from_address given for its send are kept
with it (scheduled_cc, scheduled_bcc, scheduled_from, scrubbed with the contact’s other
addresses) and checked again when it goes. A new mail draft keeps no Cc or Bcc override: those
given with send_at replace its stored lists, so recipients always shows what goes. A new mail’s
hourly recipient budget is charged from the lists read under the draft’s row lock in the send
transaction, so a concurrent edit cannot grow a send past it. PATCH with send_at moves it,
DELETE /v1/messages/{id}/schedule cancels it (it stays a draft), deleting the message discards it.
Scheduling and moving emit draft.updated to the author; no audit. The conversation filter
scheduled=mine lists the conversations holding the caller’s scheduled messages, soonest first,
each with scheduled_at, the earliest.
Each schedule inserts, in its transaction, a River job scheduled_send {workspace_id, message_id, send_at} at send_at. The worker locks the message row and sends only while it is still a draft
whose scheduled_at equals the job’s send_at, through the same path as POST .../send, as
scheduled_by, clearing scheduled_at in that transaction; a moved, cancelled, discarded or sent
message and a second worker on the same job send nothing. A permanent refusal (member_inactive,
inbox_access_lost, conversation_trashed, conversation_unavailable, from_not_allowed,
no_recipient, any 4xx) leaves a plain draft with send_error
(code, detail), clears scheduled_at and notifies the author (scheduled_send_failed, push and
e-mail on by default); 429, 5xx and other errors retry with River’s backoff and count as permanent on
the last attempt. Undo send needs nothing on the server.
The workspace setting bots_may_send (off for new workspaces; on after the upgrade for workspaces
that had an active key, so their integrations keep working) decides whether keys deliver at all.
Off: a key’s outgoing message must be a draft, else 403 bot_sending_disabled, and a key cannot
send drafts. On: a key with messages:write sends directly and one that also has drafts:send
sends drafts. Members always may. Owners and admins change it with a member session; a key, even
one with workspace:manage, cannot, so a bot never lets itself send.
Idempotency. Every authenticated POST on /v1 and /client/v1 accepts an Idempotency-Key
header (1 to 255 printable ASCII characters). The key is remembered for 24 hours per caller (API
key, member or contact) together with the method, path, a SHA-256 of the body and the response. The
same key with the same request returns the stored response with Idempotent-Replayed: true; with a
different request 409 idempotency_key_reused; while the first is still running
409 idempotency_key_in_use. 5xx answers are not stored, so the request can be retried.
Unauthenticated endpoints (sign-in, client session) and those that act on the signed-in person rather
than a workspace (/v1/me/..., sign-out) ignore the header, since every stored key belongs to a
workspace. The existing client_id on messages stays as it is.
Event feed. GET /v1/events?after=<id>&limit=<n> returns the events realtime and webhooks
carry, in id order, filtered exactly as the caller’s realtime stream is (inbox access, key inbox
limit, scopes: a caller sees an event only if it holds conversations:read; subscription events also
need lists:read, broadcast events broadcasts:read, and contact events contacts:read). after is the last event id the caller handled; the answer carries
next (the last id returned) and has_more. Events are kept 7 days (realtime replay uses the same
rows). An after older than the oldest kept event answers 410 cursor_expired: the caller
resyncs from the lists and continues from GET /v1/events/latest’s id. Keys and tokens open
/v1/realtime with Authorization: Bearer. Details: after=0 starts at the oldest kept event and
never expires; a workspace with no kept events answers 410 to any other after, so a caller
idle through a silent week resyncs once. limit is 1 to 500 (100 by default). Events the caller
may not see are skipped, so next can be past the last returned event (the last one examined) and
a page can be short while has_more is true; one call examines at most 5000 events. The expiry
check runs after the page is read, so a cleanup in between cannot drop events silently.
/latest returns the workspace’s newest id whatever the caller may see (0 when none).
API-only mode. YUVA_PANEL=off stops serving the panel (and so the OAuth consent page:
/oauth/authorize then answers temporarily_unavailable; API keys still work). YUVA_WIDGET=off
stops serving the widget scripts. The API, realtime, ingress and /mcp stay. With the panel off,
its paths answer 404 and /oauth/authorize checks the client and redirect_uri as usual, then
redirects back with error=temporarily_unavailable. /client/v1 stays with the widget off.
JS packages. The JS SDK is published to npm as the unscoped package useyuva (yuva is refused by npm as too
close to other names, and the @yuva scope belongs to someone else), MIT, versioned with the repository:
useyuva:createYuvaClient(), the contact side (/client/v1) without DOM: sessions, identity tokens, conversations, messages, attachments, typing, read state, realtime with resume.useyuva/chat: the<yuva-chat>element, built on that client; the script-tag build stays.useyuva/react:YuvaProvider,useConversations,useMessages(React is an optional peer).useyuva/nuxt: a Nuxt module withYuvaChat,YuvaPageFeedbackandYuvaPageQuestionscomponents (@nuxt/kitand Vue are optional peers).useyuva/api: a typed/v1client for TypeScript backends, generated from the contract.
Server helpers. useyuva/server signs identity tokens, verifies webhooks and queues server-side
analytics events with only Web Crypto, Request and fetch; useyuva/h3 wraps it as h3 v2
handlers and a middleware; useyuva/nitro is a Nitro v3 module, and the Nuxt module installs the
same server part on Nitro v2 or v3. That part serves GET /_yuva/identity (a token for what the
app’s server/yuva.ts returns from user(event), which the Nuxt components then use on their own)
and POST /_yuva/webhook (verified, then dispatched to that file’s webhooks by type), each added
only when its secret is known at build time and answering 404 while it is empty at runtime, and
flushes server analytics through waitUntil per request and on Nitro’s close hook. The runtime
handlers talk to Nitro through a generated module that adapts h3 v1 (toWebRequest) or v2
(event.req) to Web Request and Response. The identity secret, webhook secret and analytics
API key live only in the server runtime config (yuva.identitySecret, yuva.webhookSecret,
yuva.analytics.apiKey and propertyId, overridable as NUXT_YUVA_* or NITRO_YUVA_*), never in
the public config or a client bundle.
sdk/go gets a /v1 client generated from the contract (sdk/go/client), next to identity and
webhook.
MCP for local clients. yuva mcp stdio --url <server> --key <key> (or YUVA_URL,
YUVA_API_KEY) bridges stdio to a server’s /mcp over HTTP; it needs no database. Releases attach
an MCP Bundle (yuva.mcpb, the bridge for macOS, Linux and Windows, asking for the server URL and
key) and the repository keeps server.json for the MCP Registry, describing the remote endpoint
with the server URL as a variable and the stdio bridge as a package.
- The bridge relays JSON-RPC messages unchanged, so every protocol version and method the server
speaks (including
subscriptions/listen) passes through.--urlis the server’s public URL;/mcpis appended unless it is there. The key is sent asAuthorization: Bearerand may be an API key or an OAuth access token. A call that fails gets a JSON-RPC error on stdout and a log line on stderr (JSON); an unreachable server fails each call but keeps the bridge running. A401(wrong, expired or revoked key) ends it with exit status 1; end of stdin with 0. - The bundle follows MCPB manifest 0.3 (
deploy/mcpb/manifest.json) and is packed by the release workflow with@anthropic-ai/mcpb2.1.2. Server typebinary:server/yuvais a POSIX shell launcher that picksserver/<os>-<arch>/yuva(darwin arm64 and amd64, linux amd64 and arm64); Windows runsserver/yuva.exe(amd64).user_configasks forurlandapi_key(sensitive) and passes them asYUVA_URLandYUVA_API_KEY. The binaries are the fullyuvawithout the built panel, so the bundle stays near 60 MB. server.jsonuses the registry schema2025-12-11. The remote ishttps://{yuva_host}/mcpwithyuva_hostas a required variable (the registry refuses a remote URL another server already lists, andhttps://{host}/mcpis taken) (the schema allows a variable in the host, not yet a whole base URL). The package isregistryType: mcpbpointing at the release’syuva.mcpb. The file in the repository has nofileSha256; the release workflow fills the version, the asset URL and the hash and attaches thatserver.jsonto the release; for a stable tag theregistryjob publishes it with GitHub OIDC (no token), asio.github.productdevbook/yuva. Its version and the manifest’s move with the repository version.
OAuth and MCP
Authorization server. Yuva is its own OAuth 2.1 authorization server, for MCP clients and for
the native member apps planned in M10. Authorization code with PKCE (S256 only), no implicit or password grant.
Client metadata must list authorization_code among its grant_types; other types it lists are
ignored (claude.ai lists jwt-bearer), and registration answers with the two Yuva offers.
- Metadata:
/.well-known/oauth-authorization-server(RFC 8414) and/.well-known/oauth-protected-resource/mcpplus/.well-known/oauth-protected-resource(RFC 9728). A401on/mcpcarriesWWW-Authenticate: Bearer resource_metadata="…". - Clients: dynamic registration at
POST /oauth/register(RFC 7591, public clients, no secret), and Client ID Metadata Documents (aclient_idthat is anhttpsURL, fetched with the same private-address rules as webhooks and cached for 24 hours; itsclient_idmust equal the URL and it must be a public client). Redirect URIs must behttps, orhttpon loopback, or a private-use scheme for native apps; matched exactly, except that anhttpURI on a loopback host (127.0.0.1,[::1], andlocalhost, which Claude Code registers) matches on any port, at authorize as RFC 8252 §7.3 and OAuth 2.1 ask (the token request must repeat the URI the authorization request used: when that request carriedredirect_uri, the token request must repeat it exactly, else400 invalid_grant;oauth_requestsandoauth_codeskeepredirect_uri_sent).redirect_urimay be left out only when the client has one. Registration answerstoken_endpoint_auth_method: nonewhatever was asked, allows 20 registrations per address and hour, and clients that never got a grant are deleted after 30 days. Client ids areyuva_client_<random>. GET /oauth/authorizechecks the request and sends the browser to the panel’s consent page (/oauth/consent?request=<id>). The panel signs the person in if needed (code or passkey), shows the client’s name and redirect host, lets them pick one workspace, and shows the scopes. Approving returns the redirect with a code (single use, 60 seconds). The panel reads and answers the request withGET /v1/oauth/requests/{id},POST …/approve(workspace and scopes) andPOST …/deny, all with a member session; a pending request lives 10 minutes and is used once. Every redirect back carriesstateandiss(RFC 9207).POST /oauth/token:authorization_codeandrefresh_token. Access tokens are opaque, 1 hour; refresh tokens 30 days, rotated on every use, and reusing a rotated one revokes the grant, as does using a code twice. Both are stored as hashes (yuva_at_…,yuva_rt_…) and looked up by hash alone, like API keys.POST /oauth/revoke(RFC 7009): a refresh token revokes the grant, an access token only itself.- Resource indicators (RFC 8707) are required.
<YUVA_PUBLIC_URL>/mcpgives a token for/mcponly;<YUVA_PUBLIC_URL>gives one for/v1,/v1/realtimeand/mcp, and only to the server’s own member apps: the client ids (for the apps, their Client ID Metadata Document URLs) listed inYUVA_OAUTH_FIRST_PARTY_CLIENTS(comma- or space-separated, matched exactly, empty by default) (#186). Any other client asking for it getserror=invalid_targeton the redirect, never a silent downgrade to/mcp. A trailing/is ignored. A/mcp-only token on/v1gets401 token_wrong_resource; an expired one401 token_expired. Accepting a/v1token at/mcpis intentional: MCP acts as the member with the same scopes. - Scopes are the API key scopes. A token acts as its member: what the member’s role and inbox access
allow, narrowed by the granted scopes, never more. A member who leaves or is removed loses every
grant. Management scopes a member’s role cannot use are not offered on the consent page: agents
are not offered
inboxes:manage,labels:write,canned_replies:write,webhooks:manage,workspace:manageandmigrations:manage, and nobodyfeedback:write(API keys only). A token may call exactly the operations an API key may; the rest (read state, typing, notification settings,/v1/me, members, keys, Connected apps, the consent endpoints) need a member session, and a token never changesbots_may_send. - A grant is one member, one workspace and one client; approving the same client again in that workspace replaces the grant’s scopes and resource, and its live tokens follow. The 600 requests a minute are counted per grant (its tokens rotate hourly), in the process like the other rate limits, before scope checks. Settings → Connected apps lists a member’s own grants (client, scopes, created, last used, request count this month) and revokes them; owners and admins see and revoke every grant in the workspace.
- Registered clients and Client ID Metadata Documents belong to no workspace (a client is used by
many); they are the exception to the
workspace_idrule, as are pending authorization requests, which exist before the person picks a workspace. Grants, codes and tokens carry the workspace.
Writes through a client. Everything a token writes records the client: messages, notes,
drafts and conversation events get via (the client name at the time), and the timeline shows
“Ayşe via Claude Code”. via is on the message’s author, and a draft sent with a token also gets
it on sent_by. Delivery from every OAuth token follows bots_may_send like an API key (off, an
outgoing message must be a draft), except a <YUVA_PUBLIC_URL> token of a first-party client,
which sends as the member (deliversAsBot: an API key, a /mcp-only token, or a grant whose client
is not first-party). This covers every sending path (REST sends and draft sends, forwards, linked
replies, re-read on replay, MCP send_reply, send_draft, forward_conversation, discussion
replies), and grants for <YUVA_PUBLIC_URL> made before the list existed keep /v1 but deliver as
drafts. The consent request (GET /v1/oauth/requests/{id}) carries first_party and, per
workspace, may_send.
MCP endpoint. /mcp in the same binary, Streamable HTTP, MCP specification 2026-07-28, built
on github.com/modelcontextprotocol/go-sdk (MIT/Apache-2.0). Bearer is an OAuth token or a scoped
API key. YUVA_MCP=off turns it off (the OAuth endpoints stay for the apps). The transport is
stateless, as 2026-07-28 requires: there are no MCP sessions, every request is authenticated and
metered on its own and gets a server built for its principal. Older protocol versions work request
by request; their resources/subscribe is refused, so subscriptions use subscriptions/listen.
A listen is fed from the realtime hub (any instance the stream is on), filtered like /v1/realtime,
re-checks its token every 30 seconds and ends when the token stops working. The endpoint sends
Access-Control-Allow-Origin: * and skips the SDK’s localhost Host check: it takes no cookies.
- Tool results are Yuva’s own shapes, not the
/v1schemas: ids, enums, counts and times at the top level, customer text undercustomer_content; names written by members (inboxes, labels, canned replies, bots) stay outside. Schemas have one type per field, withoutnullunions, so clients with a single-type dialect (Gemini) accept them; absent fields are left out. - Mappings that are not one operation:
get_conversationis the conversation plus its latest 50 messages oldest first (next_cursorpages back) and, withcontacts:read, the contact’s name and address;list_feedbackisListConversationswithkind=feedback;add_labelsandremove_labelsareBulkUpdateConversationswith one id.merge_contactsis listed only to owners, admins and keys without an inbox limit. - Setup tools:
list_channels(ListChannels; kind, name, public key, allowed origins, anonymous, discussions, e-mail addresses, never secrets),create_inbox(CreateInbox; the slug is made from the name as the panel does, with-2,-3… when taken; the identity secret is not returned),create_chat_channel(CreateChannelwith kindchat; anonymous on and discussionsoffunless given),update_chat_channel(GetChannel, thenUpdateChannelwith the current chat settings and the added and removed origins, anonymous, discussions and greeting changed),create_app_channel(CreateChannelwith kindapp; platforms both and anonymous off unless given),update_app_channel(GetChannel, thenUpdateChannelwith name, platforms and anonymous as given) andget_install_snippet(GetChannel; the code forhtml,react,nextjs,nuxt,vue,astro,shadcn, thedocs-variants and thesubscribe-variants forhtml,react,nuxtandshadcnwithlist_ids(public lists of the channel’s inbox), filled withYUVA_PUBLIC_URLand the public key, annpm install "useyuva@>=<server version>"line where needed, where it goes and the guide on GitHub). The templates live in the server (mcp_setup.go) with the panel’s wording. The three writes are listed to owners, admins and keys withinboxes:manage. Calling a tool that is not listed answersinsufficient_scopenaming the scope to reconnect with, or the role orbots_may_sendreason. - Broadcast tools:
list_mailing_lists,list_broadcasts,get_broadcast(with the review and the audience for a draft) andget_broadcast_reportare listed by scope (lists:read,broadcasts:read);list_email_templatesandpreview_design(the HTML as an embedded resource) withbroadcasts:read, andcreate_design,update_design(withbase_version),create_broadcast_draft,update_broadcast(the draft’s fields or a running broadcast’s pace; it answers with the review again) andsend_test_broadcastwithbroadcasts:write, are listed only to owners, admins and keys. A test through an OAuth token goes to the caller only; keys name members.schedule_broadcastis listed only to principals withbroadcasts:sendwhile the workspace allowsbroadcasts_by_keys, and needssend_atandconfirm_recipientsequal to the audience count it was shown; the approval gate applies. Reply contacts in reports are customer content. Resourceyuva://broadcast/{id}; promptsdraft_newsletter(never schedules) andbroadcast_report. - Migration tools (
detect_mail_source,list_migrations,get_migration,create_migration,update_migration,test_migration_connection,scan_migration,preview_migration,start_migration,pause_migration,resume_migration,cancel_migration,finish_migration,retry_migration_items,list_migration_errors,send_migration_probe,remove_migration_history) are listed to owners, admins and keys withmigrations:manage. None takes a credential:create_migrationreturns the panel link where the person connects.remove_migration_historycarriesdestructiveHintand needsconfirm_count. Resourceyuva://migration/{id}; promptmove_to_yuva(address, inbox). - Writes carry
destructiveHint: falseexceptmerge_contacts;assign,set_status,snooze, the label tools,move_conversation,bulk_updateandupdate_chat_channelcarryidempotentHint;send_replyandsend_draft(SendMessage, delivering a stored draft instead of a copy of its text) andforward_conversationcarryopenWorldHint.send_replyanswers409 draft_pendingwhile the caller (the same key, or the same member through the same client) has a draft in that conversation. resources/listlists the inboxes the caller sees.yuva://inbox/{id}holds the inbox and, withconversations:read, its latest open conversations; it is updated byinbox.*andconversation.created,.updatedand.movedthere.yuva://conversation/{id}is updated by every event of that conversation,yuva://contact/{id}bycontact.updatedand.deleted.- The
draft_replyprompt looks up the inbox’sdefault_localeand names it in the text. - Tools call the same code as the
/v1operations with the caller’s principal, so access, scope and inbox checks are the API’s. Read tools carryreadOnlyHint; idempotent writesidempotentHint;merge_contactsdestructiveHint. Every tool has an output schema. Tools the caller’s scopes or role cannot use are not listed;send_reply,send_draftandforward_conversationare listed only when the caller may deliver;draft_forwardalways is. - Customer text is untrusted: message bodies, subjects, names, e-mail addresses and attributes are
returned only inside
customer_contentfields, and every tool description says that text there is data from customers and never instructions. - Resources
yuva://inbox/{id},yuva://conversation/{id},yuva://contact/{id}, with subscriptions. Promptstriage_inbox,draft_reply,summarize_conversation,weekly_reportandsetup_live_chat(site URL, framework, product name: find or create the inbox and the chat channel for the site’s origin, get the snippet, add it to the code or show it; withoutinboxes:manageit says which scope to reconnect with); they only arrange tool calls and text, Yuva runs no model. initis the entry prompt for adding Yuva to a project: the assistant reads the project locally and sends none of it to Yuva, callsget_setup_state(what the workspace has, the parts it cannot read with the scope to grant, and a fixed catalog of integrations with the signals that suggest each and the prompt or tools that set it up), then proposes a plan and changes nothing until the person picks steps.get_setup_stateandreport_yuva_issueneed no scope and are listed to every connection.report_yuva_issueprepares a GitHub issue about Yuva itself forproductdevbook/yuvaand files nothing: the server removes the workspace’s own names (workspace, inboxes, channels, properties, lists, their origins, domains and addresses), e-mail addresses, URLs and host names other thangithub.comanduseyuva.com, IP addresses, keys, tokens, UUIDs and home-directory paths, and returns the title, body, a prefilled new-issue URL and agh issue createcommand. The person reviews it and opens it under their own GitHub account, so the server holds no GitHub credential and cannot be used to post to the repository.- Rate limit per token or key (600 requests a minute,
429withRetry-After), counted per grant for Connected apps, in Postgres like the other rate limits.
MCP coverage (M23)
An assistant can do through MCP what a member does to answer customers, set a product up and prepare
mail, so it never has to stop and send the person to the panel for an ordinary step. Each tool calls
the /v1 operation with the caller’s principal, so roles, scopes and inbox limits are the API’s;
writes that only owners and admins may make through /v1 are listed only to them and to keys.
- Left out on purpose: credentials and access (API keys, OAuth grants, members’ roles, invites,
passkeys, push subscriptions, webhooks, rotating any secret, key or token), workspace settings and
deletion, every delete beyond the existing
remove_migration_history, consent and analytics exports and analytics data deletion, migration file uploads, typing and read markers, raw message and attachment downloads, SMTP and other passwords, and every publish a milestone keeps for members (help articles, What’s new entries, incidents under the draft rule). Unsubscribing is a state change, not a delete. Moving conversations to the trash and restoring them (#178) are left out too. - Sender identity (#109).
update_inbox_sender(UpdateInboxwithsenderonly: legal name, postal address, registration, contact; owners, admins and keys withinboxes:manage). Its description says every value comes from the person and is never invented.list_inboxesreturns each inbox’ssenderandsender_ready;get_setup_statenames inboxes with lists but no sender. - E-mail channel (#107).
create_email_channel(CreateChannelwith kindemail): the address and name, no SMTP account, ascreate_migrationdoes; the answer carries the forwarding address for inbound mail andchannel_settings_urlwhere the person sets SMTP.get_deliverability(GetDeliverability, andCheckDeliverabilitywithcheck: true) returns the DKIM record to add and what each check found or is missing;create_dkim_key(CreateDkimKey) makes the key whose record it lists. - Lists and subscribers (#107).
create_mailing_list,update_mailing_list(lists:write, owners, admins and keys);list_subscriptions(ListSubscriptions, addresses and names incustomer_content);add_subscription(CreateSubscription;consent.confirmedfalse unless the person states that the subscriber already agreed, with the statement and where they agreed in their own words, where they agreed going into the consent’sreference);unsubscribe(UpdateSubscriptionstateunsubscribed). - CSV import (#107).
create_list_importtakes the CSV as text (at most 5 MB, the same multipart upload the panel sends) withattestationandconsent_source, which the description says to take from the person word for word and never to write;get_list_import,list_list_imports,update_list_import_mapping,get_list_import_errors(the refused rows,customer_content),cancel_list_import. Through/mcpthe CSV text anddata_base64below fit only up to about 5 MB (the request limit is 8 MiB).start_list_importneedsconfirm_countequal to the import’scounts.valid, as the person was shown, and answers409 count_mismatchotherwise. - E-mail images (#108).
list_email_images(ListEmailImages) andupload_email_image(UploadEmailImage’s code):url(httpsonly, fetched through the webhook client that refuses private and reserved addresses, 10 seconds, the upload’s size and type limits) ordata_base64; the answer is the image idupdate_designtakes. Owners, admins and keys,broadcasts:write. - Designs and broadcasts.
list_designs,get_design(ListEmailDesigns,GetEmailDesign,broadcasts:read),duplicate_design(broadcasts:write);pause_broadcast,resume_broadcast,unschedule_broadcastandcancel_broadcast(destructiveHint, needsconfirm_nameequal to the broadcast’s name) withbroadcasts:send, listed under the same rule asschedule_broadcast.request_broadcast_approval(RequestBroadcastApproval) is listed only to an owner’s OAuth connection withworkspace:manage, the scope of the workspace row whose broadcast status it changes;/v1takes the owner’s session or OAuth token, and refuses API keys, which have no person behind them. Its description sayswebsite,sender_descriptionandconsent_descriptioncome from the person and are never invented; the operator’s notice names the owner’s address. - Team, contacts, conversations.
list_members(ListMembers: id, name, role; addresses only to owners and admins), soassignhas ids.search_contacts(ListContacts),create_contact,update_contact(names and attributes;contacts:write),list_contact_notes,add_contact_note,list_contact_subscriptions.start_conversation(CreateConversation): the first outgoing message is a draft unless the caller may deliver andsend: trueis given.list_drafts(ListDrafts) lists drafts waiting for review.create_label,create_canned_reply,update_canned_reply. - Discussions.
list_discussions,get_discussion(posts incustomer_content).reply_to_discussion(CreateDiscussionPost) andmark_discussion_answer(AcceptDiscussionAnswer,ClearDiscussionAnswer, idempotent) takemessages:writeand an OAuth token, which acts as its member; API keys are refused, since a post has no bot author. A post written with a token keepsvia(discussion_posts.via) and shows it onauthor.viaon/v1only. Both are public at once and notify followers, so they are listed only when the caller may deliver (bots_may_sendfor a/mcptoken, which the operations also check:403 bot_sending_disabled). - Setting up the other products.
create_status_page,create_status_component,create_status_monitor,update_incident(a draft’s or a published incident’s title and impact; text goes throughpost_incident_update);create_help_center,create_help_collection;create_changelog;create_roadmap_board;create_funnelandanalytics_retention. Each takes the scope and role of its/v1operation (status:manage,help:write,changelog:write,roadmap:write,analytics:manage,analytics:read); creating a help center needshelp:publishand a changelogchangelog:publish, and help centers, changelogs and boards take no OAuth token, only owners, admins and keys. Nothing created here is published.create_status_monitorreturns the push token and URL once, for the person to put in their job. - The server instructions name each group’s tools, and the prompts use them:
draft_newslettercreates a list, imports or adds subscribers and fixes the sender before the draft when they are missing, and still never schedules.
Identity
The host app’s backend knows who its user is; Yuva trusts it through a short-lived identity token:
a JWT (HS256) signed with the inbox’s identity secret, with sub (the host’s user id), optional
email, email_verified, name, locale and attrs (plan, app version, anything the panel
should show), and exp at most 10 minutes ahead. The client exchanges it at /client/v1/session for a contact
session. sdk/go signs these tokens and verifies webhooks.
The token is checked strictly: alg must be HS256 (anything else, none included, is
refused), the signature must match the inbox secret, exp is required and at most 10 minutes
ahead, sub is required. A token with a jti is accepted once: its id is remembered per inbox
until the token expires (tokens without one can be replayed until exp). The contact is found by sub among the inbox’s external ids, then by the
token’s email when the token says email_verified: true and the contact with that address has no
external id in this inbox, or created; a contact already bound to another sub of the inbox is
never taken over. name, locale and attrs are saved on the contact; when it was found by
e-mail and has external ids in other inboxes, they only fill what is missing. A verified email becomes
one of the contact’s addresses. Unverified e-mails (email_verified absent or false) are stored
like a typed address but never used to link a contact. Contact
sessions are opaque tokens, stored as hashes, valid for 7 days after their last use.
Channels can allow anonymous visitors (web chat on a public site). An anonymous visitor is a
contact plus a random visitor id that the browser keeps; the id resumes that visitor, and only in
the inbox that issued it. When the same browser later sends an identity token with its visitor id,
the visitor’s conversations move to the identified contact (or, for a contact Yuva has not seen
yet, the visitor becomes it) and the visitor id ends. E-mail addresses are matched to contacts only
when they arrive by e-mail or inside a valid identity token: an address a visitor types in the
widget or the feedback form is kept apart (typed_email), and nothing but its confirmation link is
mailed to it: replies (continuity mail) go only to the contact’s own addresses. It becomes one of
their addresses only when someone opens the confirmation link Yuva mails to it and confirms there.
The link (/email/confirm?token=…, valid 24 hours, not sent for an address a contact already has)
is limited (#185) to 3 rows per contact and hour and, taken all or nothing after the transaction
commits when a mail is due, 3 a day per normalized address and caller network (IPv4 /24, IPv6 /48),
10 a day per normalized address across the server, 6 a day per contact, 30 a day per workspace and
network, and 2,000 a day per workspace (no per-channel cap: outsiders could silence a channel).
Addresses are normalized for these keys: lowercase, +tag stripped, the domain in IDNA ASCII,
googlemail.com as gmail.com and dots removed for gmail.com. A mail held back sets
email_confirmations.held_at and the state limited (no expires_at) until the row expires. An
unverified identity-token email gets one link per contact and address (none while the contact’s
latest confirmation is for it), under the same limits. The mail shows the inbox name as one line of
at most 60 characters. The link opens a page whose button posts the token, so a mail scanner that
fetches links confirms nothing; the mail names the inbox and never repeats visitor text. Answering
a reply e-mail does not confirm the address. Such an answer (from the typed address, naming the
visitor’s thread, while no contact has the address and DMARC does not fail) joins the visitor’s
conversation as their message, marked unverified_sender (its from is not one of the contact’s
addresses, computed when read), and links nothing; once the address is confirmed it is the
contact’s and the mark goes away.
The visitor, not the inbox, learns what became of the link. Each request leaves an
email_confirmations row (deleted by the event cleanup job 30 days after it expires) and the client contact carries
email_confirmation {email, state, expires_at}: sent (with the link’s expiry), undeliverable
or confirmed (only while that address is still the contact’s first). Before mailing, one helper
reads the address’s suppression in the workspace, for the chat form and the feedback form alike: a
bounce of any scope is public knowledge (anyone can mail the address) and the row is stored bounced
and shown undeliverable, with nothing sent; a complaint or manual suppression stores an ordinary
row and sends nothing, so the answer is sent exactly as for a clean address and the endpoint tells
nobody what is on the suppression list. Confirmation mails go out through the server mailer with
their own Message-ID (confirm.<random>@<sender domain>), stored on the row with the id a relay
put in its place (Amazon SES names its own in the reply to DATA and in its delivery reports). A delivery report
(inbound DSN after the reply, broadcast and notice lookups, under the same null-sender and
Final-Recipient rules, the address compared without case) or an SES notification (server mail,
so no tenant check) finds the row by that Message-ID or the relay’s. A permanent failure of its own
address always suppresses the address with scope confirmations (the bounce is about the address,
not the row), and marks the row bounced and tells the visitor only while it is unconfirmed,
unexpired, the contact’s latest and still their typed address. The scope stops confirmation mails
and nothing else (replies, notices,
broadcasts, list imports and the contact’s undeliverable list ignore it; any wider suppression
replaces it and it never narrows one). Such a bounce expires after 30 days (ignored, then deleted by
the cleanup job), so a mailbox that did not exist yet is not locked out. A complaint about a
confirmation (SES notification or ARF report) suppresses the address with the same scope, reason
complaint, which never expires, and ends a live link: it stops working and the visitor sees what
the silent case shows. Temporary failures change nothing; no report about a
confirmation opens a conversation or a contact. Every change reaches the visitor’s
/client/v1/realtime as a stored contact.updated frame carrying the ClientContact, sent only
when what it shows changed. The row is found across workspaces (FindEmailConfirmationByHeaderAnyWorkspace),
an exception to the workspace_id rule: the server mailer sends every workspace’s confirmations
from one address, so the report arrives at whichever workspace owns that address, and SES names
only the message. The Message-ID is random and given only to the one recipient, the report must name
that recipient, and everything after the lookup is scoped by the row’s own workspace_id.
Inbound:
- A Cloudflare Email Worker (
edge/) receives mail for the support addresses and POSTs the raw message with the envelope recipient and sender to/ingress/email, signed with HMAC-SHA256 underYUVA_INGRESS_SECRET(one per install; the request format is inedge/README.md). Thev3signature carries two MACs: one over the timestamp, both envelope addresses and theContent-Length, checked with the timestamp (within 5 minutes) before a byte of the body is read, so an unauthenticated request never makes the server buffer a body; and one that adds the body, checked once it is read. The body must arrive within 30 seconds. The olderv2, a single MAC over the timestamp, both envelope addresses and the body, is accepted only whileYUVA_INGRESS_ACCEPT_V2is on (off by default; for a Worker not yet redeployed); the oldestv1, which leaves the envelope sender out, only withYUVA_INGRESS_ACCEPT_V1, and then the envelope sender is not trusted (an empty one marks nothing as a delivery report or automatic). At mostYUVA_INGRESS_MAX_CONCURRENT(8) messages are processed at once per process, counted from the signature header check, before the body is read; more are answered 503. A Message-ID already stored for the channel is accepted again without a second copy. When the server cannot be reached (5xx, network error, no answer within 20 seconds) the Worker forwards the message to an optional fallback address (FALLBACK_FORWARD, a verified Email Routing destination) instead of failing the delivery; refusals (4xx) still bounce. Any other MTA can do the same; the endpoint is not tied to Cloudflare. An MTA that pipes into a command usesyuva ingest-email --to <address>, which exits with sysexits codes (67 unknown recipient, 77 refused, 75 try later). - The recipient selects the channel, but only through an address its workspace has proven
(below): the forwarding token first (any channel, proven or not: the secret token names nobody’s
address), then the proven exact address (case-insensitive), the proven
local@forlocal+tag@, and the proven catch-all of the domain. A channel with the address*@domainis the domain’s catch-all: it receives mail to every address of the domain that no channel holds exactly. Its conversations remember the address the contact wrote to, and replies go out from that address (FromandReply-To), so its SMTP account must be allowed to send from the whole domain; itsfrom_addressis used only for a conversation without such an address (a chat that continues by e-mail), and without either the reply is refused (email_no_sender). Because that account sends from the whole domain,from_addressoncreateConversation,composeMail,createMessage(drafts too),PATCH /v1/messages/{id}(drafts) andsendMessagemay name any plain address of the catch-all’s domain, for members, API keys and connected apps alike (MCPstart_conversation,compose_mail,draft_reply,send_reply,send_draft,update_draft). An address that is one of the caller’s own member addresses (below), or the mailbox owner’s, in any state, goes through the member flow only and gets its answer; any other address goes through the domain rule, which refuses an address another e-mail channel of the workspace receives at or sends from or another member of the workspace has verified (409 from_not_allowed, as is another domain). Only creating a conversation (createConversation,composeMail) stores it as the conversation’s address (conversations.email_address), which later replies go from. OncreateMessageandsendMessageit applies to that one message, resolved when it is sent; a draft keeps any acceptedfrom_address, the member’s own included, inmessages.draft_from(changed or cleared withPATCH /v1/messages/{id}, replaced by afrom_addressgiven tosendMessage). It is the one source of the From for scheduled drafts too: scheduling writes itsfrom_addressthere,PATCHon a scheduled draft changes it, unscheduling keeps it and the scheduled job sends without its ownfrom_address, sodraft_from_addressis what goes out. At send a kept address that no longer fits (the conversation moved channel, the channel is no longer a catch-all of that domain, the address is refused, or the reply is not e-mailed) is ignored and the usual sender used; an explicitfrom_addressonsendMessageis still refused. A member’s own address with no conversation address on the catch-all is also the envelope sender. Writing an outgoing e-mail message or draft that has nothing to send from (no conversation address on the domain, no channelfrom_address, nofrom_addressfor it) is refused withemail_no_senderat once; a conversation created without a message, notes and other channels are never refused for it. MCPstart_conversationchecks this before it creates the conversation. An inbox’s chat continuity prefers an exact-address channel over a catch-all. Threading usesIn-Reply-ToandReferencesagainst stored Message-IDs of the inbox (at most the first fiveIn-Reply-Toids, and the first and the last 49Referencesids; ids longer than 998 bytes dropped, read from at most 64 KiB at each end of the header); our outbound Message-IDs are<token.random@sending domain>where the token is an opaque random value stored on the conversation, so a reply finds its conversation even when the client dropsReferencesor a relay rewrites the domain. A relay that replaces our Message-ID (Amazon SES writes<id@region.amazonses.com>,email.amazonses.comin us-east-1, from the id in its reply toDATA) has that id stored next to ours asrelay_message_id, and threading, broadcast replies and delivery reports match either. Otherwise a new conversation starts, with the subject of the mail. A closed, pending or snoozed conversation that gets a reply is reopened. The sender is matched to a contact by address or becomes a new contact; mail from a blocked contact is refused, mail from the channel’s own address is dropped. A thread joins only a conversation of the sender’s own contact, or, for mail that passed DMARC, one whose active participants include the sender’s address (below): anyone else who holds one of our Message-IDs (a Bcc recipient, a forward) could otherwise write into a customer’s conversation. Mail that names the thread of another contact’s conversation opens a new conversation for its sender, counted against the hourly limit, withrelated_conversation_idpointing to the conversation it named; the panel shows that link, and nothing is added to the other conversation.Fromcan be forged, so a reply whose trusted DMARC result fails never joins a conversation that is not flagged spam either: it opens a new spam conversation withrelated_conversation_id. Participants: theToandCcof inbound mail (and theccof members’ replies) are kept asconversation_participantsrows (workspace, conversation, lowercased address, rolecc, status, first seen; the contact is found by address when there is one, else the row is a bare address), at most 100 per conversation. Never kept: the sender, the conversation contact’s own addresses, any forwarding address,YUVA_SMTP_FROM, and the same workspace’s channel addresses (with tags), catch-all domains (not shared ones) andfrom_address, proven or not: proof decides routing and other workspaces, never what a workspace counts as its own. Other workspaces’ addresses are ordinary addresses. Mail that fails DMARC or is automatic adds no one.Fromcan be forged wherever DMARC is not enforced (a domain without a DMARC record, or an install withoutYUVA_INGRESS_AUTHSERV_ID), and a forged mail “from” the customer could otherwise name an attacker inCcand have every reply copied to them; so header addresses areactiveonly when the mail’s trusted DMARC result ispass, andsuggestedotherwise: shown to members, never copied, never allowed to answer into the conversation. A later mail that passes makes a suggested address active. Addresses a member names in a reply’sccor adds withPOST /v1/conversations/{id}/participantsare active;DELETE /v1/conversations/{id}/participants/{email}removes one (a later inbound mail naming it adds it again). Changes emitconversation.participants(data: the conversation id and the full list) on realtime and/v1/eventsonly: no webhook, nothing on the contact’s stream. Mail that passes DMARC from an active participant’s address and names the thread joins the conversation as a message from the participant’s contact (created by address like any sender); the conversation’s contact stays. It passes the same rules as the contact’s own mail: blocked senders, loop and auto-reply handling, and the hourly sender cap, which counts inbound mail by its author. Any other mail from them, and answers from Bcc recipients (never participants), opens a new related conversation.GET /v1/conversations/{id}/participantslists them with their status. A participant’s role iscc, orforwardedfor the recipient of a forward (below) and the addresses their mail names; aforwardedparticipant is never copied by default, and their mail joins only as a members-onlyforward. A member naming one inccor adding them, or a verified mail from the contact copying them, makes themcc. The add endpoint answers an address the workspace counts as its own (as above) like an invalid one (400 validation_failed, same text), as doccandbcc. Every e-mail channel also has a forwarding address,<token>@<YUVA_FORWARDING_DOMAIN>(16 random characters, rotatable), for mailboxes that forward to Yuva instead of moving their MX; ingress resolves a recipient on that domain by token before the address lookup. Without the setting there is none. Address proof (#182):email_channels.verified_atandverified_by(code,dns,operator). An unproven channel receives only at its forwarding address and still sends through its own SMTP account (the relay decides who may send as which address). Code, for an exact address not on the forwarding domain:POST /v1/channels/{id}/verification-codemails an 8-digit code through the server mailer (address_code, naming neither workspace nor inbox), valid 1 hour and 5 tries, a new one replacing it; at most one a minute per channel, 20 a day per workspace and 5 a day to one address across the server (lowercased, without+tag;429 rate_limited), andPOST /v1/channels/{id}/verifywithcodeproves it. A code mail that comes back through the channel’s own forwarding address (our Message-ID or the relay’s) proves the channel itself and is dropped; one that arrives directly (MX) is never taken, since anyone could claim an address whose MX is this server. DNS, any address and the only proof of a catch-all or of an address on the forwarding domain: the TXT record_yuva-mail.<domain>holdingyuva-mail-verify=<hex>, an HMAC of the workspace id and the domain under a key derived from the master key, so one record proves every channel of that workspace on the domain and nothing is stored or rotated;POST …/verifywithoutcodelooks it up (10 s; 30 checks an hour per workspace) and a miss leavesproblem. Owners, admins and keys withinboxes:manageprove; MCP does not (proof is access, like rotating secrets). Any number of workspaces may claim an address (UNIQUE (workspace_id, address)) and one holds it (a partial unique index onaddresswhereverified_atis set). The latest prover wins: under an advisory lock on the address a proof clears the previous holder (problemtaken,channel.address_lostbysystemin its workspace, the one write across workspaces, keyed by the address like the ingress lookup) and recordschannel.address_verified; when no channel held the exact address, the other workspace’s provenlocal@or catch-all that received its mail getschannel.address_lostwithvia. Losses are kept inemail_address_losses(mailed rows for 30 days) and the River jobaddress_loss_mailmails the losing workspace’s owners at most once a day. A proof shows control now; domains and mailboxes change hands, so a stale holder must not block the owner, and pending claims block nobody (409 email_address_takenanswers only the same address twice in one workspace). Changing a channel’s address starts its proof over. A catch-all on a shared domain (YUVA_FORWARDING_DOMAIN, or a public mail provider fromemail.PublicMailDomain) is refused on save and on verify and never looked up, so mail to an unknown or rotated forwarding token answers 404. Nothing is grandfathered (migration 00127): stored mail cannot tell delivery by MX from delivery through a forwarding address, which anyone can send to themselves, so every existing channel starts unproven and the migration writes one operator noticeemail_unprovenper channel of a live workspace, naming the command that vouches for it (withoutYUVA_OPERATOR_EMAIL, logged once at warn level).yuva channel prove --channel <id|address> [--workspace <ws>] [--yes [--address <address>]]andyuva channel prove --all-unproven --workspace <ws> [--yes --plan <code>]let the operator vouch (verified_byoperator, auditchannel.address_provenwith actoroperator). Without--yesit lists channel, workspace, address and result and exits non-zero while anything would be proven. The proof is bound to what was listed: by channel id--addressmust equal the listed address,--all-unprovenneeds the plan code the listing printed (a hash of the channel ids and addresses), and each proof refuses when the address changed since it was read. It never takes from another workspace: it refuses an address another workspace proved and one whose mail reaches another workspace’s provenlocal@or catch-all today, so it never causeschannel.address_lost; shared-domain catch-alls are refused as for any proof, and an address several workspaces claim needs--workspace. Its lookup across workspaces (OperatorEmailChannels) and the “proven elsewhere” check are exceptions to theworkspace_idrule, like the ingress lookup. - MIME parsing with enmime; visible text with quotes and signatures stripped (our own Go
implementation in
api/internal/email/reply, tested against a fixture corpus, which scans only the first 64 KiB of the text: when nothing is hidden there the whole text is shown); the quoted containers that clients mark in HTML are removed too; HTML sanitized with bluemonday for display. The full text and full sanitized HTML stay available, and the original message is kept in object storage for members to download. Attachments and inline images follow the server’s attachment size and type rules; the rest is skipped (it stays in the original). Inline parts keep theirContent-ID(content_id,inlineon the attachment) and the sanitized HTML keepscid:image sources, so the panel can show them from the attachment. Remote images stay in the stored HTML;has_remote_imageson the message’s e-mail data tells the panel to block them until the member asks. - Loops: messages with
Auto-Submittedother thanno,Precedence: bulk|junk|list|auto_reply,X-Autoreply,X-Autorespond,X-Auto-Response-Suppress(other thanNone),List-Id, a null sender, a delivery report, or our own Message-ID domain are stored but never trigger an automatic message. Mail from the receiving channel’s own address orfrom_address, fromYUVA_SMTP_FROM, or from any channel address orfrom_addressof the same workspace (proven or not) is dropped, so notifications and replies that reach a catch-all never loop; another workspace’s addresses never drop mail. Volume never loses mail: a sender opens at most 20 new conversations per channel and hour, and further mail in that hour is added to the sender’s latest conversation on the channel (reopened if needed, no greeting) instead of opening a new one. We chose this over a separate “bulk” state because it needs no new view and keeps every message in front of a member. Only a sender over a hard cap of inbound mails per hour in the workspace (YUVA_EMAIL_SENDER_HOURLY_CAP, default 500) is refused (429rate_limited). Mail that passed DMARC and other mail are counted separately (#190), so forged mail in a customer’s name fills only the unauthenticated count (a domain without DMARC shares it with forgeries of its addresses). Before the body is parsed,/ingress/emailreads only From and Authentication-Results (email.HeaderSender, after the 25 MiB size check) and refuses an existing contact over the cap; the check in the ingest transaction is the one that counts. enmime’s HTML-to-text conversion is off: for a message without a text part the server converts at most the first 1 MiB of HTML, and HTML over 2 MiB (maxFullHTMLBytes) is neither quote-stripped nor sanitised (the message keeps its text and the raw.eml, nohtml,full_htmlororiginal_html). Cloudflare Email Workers can only refuse a message permanently (setReject; a temporary failure is not documented), so that refusal is permanent and its text says the message was not accepted. - Spam: the receiving server’s verdict (the topmost
Authentication-Results) is stored and shown, and its DMARC result is used only when the header’s authserv-id isYUVA_INGRESS_AUTHSERV_ID(mx.cloudflare.netbehind Cloudflare Email Routing); any other header could have come with the message, so without a match DMARC isunknown. A sender can also write a header with the trusted authserv-id, and the receiver need not remove it (RFC 8601 §5 is a SHOULD and Cloudflare does not document doing it), so when more than one header carries that id DMARC isfailif any of them fails andunknownotherwise, and a deliverability probe reads as untrusted. This needs nothing from the MTA beyond putting its own header on top; the edge Worker cannot do better, since it sees the same headers and observes no verdict itself. A new conversation whose first mail fails DMARC is flaggedspam, which keeps it out of lists and counts (they have a spam view) and away from automatic replies; contacts can be blocked. The trusted header is parsed per RFC 8601 (#183): split into resinfo at;outside comments (nested, with quoted-pairs) and quoted strings, comments dropped and quoted strings never matching; each resinfo must bemethod[/version]=result, at most onereason=value, then onlyptype.property=pvalue, and only that leading methodspec is read, so admarc=passinside an address, a DKIM identity or a reason never counts. An open comment or quote, or any resinfo of another shape, makes the headerunknown; severaldmarcresults givefailif one fails, their common result if all agree, elseunknown. Apasscounts only for a message with exactly one From address in one From header (RFC 7489 §6.6.1), else it isunknown. Only mail through our own receiver (/ingress/email,yuva ingest-email) is believed: the migration sync and imports store DMARCunknownwhatever the headers say. Automatic mail goes only to senders that passed: the greeting only for a new conversation whose first mail passed, a rule’ssend_replyis refused withauto_replywhen the triggering contact message is an e-mail that did not pass (chat and API messages are unaffected), and a rating request is e-mailed only when the latest contact message is not such an e-mail. WithoutYUVA_INGRESS_AUTHSERV_IDnone of them reach e-mail senders, and the startup warning says so. The greeting’s subject isRe:and the sender’s subject with control and format characters (Unicode Cc and Cf) turned into spaces, whitespace collapsed and cut to 60 characters at a word break past the 30th with…; it is not fixed because clients that thread by subject would split it from the customer’s mail, and only a DMARC-passing sender reads their own text.
Outbound: SMTP per channel (works with SES, Postmark, any relay); the password is stored
encrypted under the master key and never returned, and it is only sent over TLS. The SMTP host is
resolved once per send and refused when it resolves to a loopback, private or other non-public
address (unless YUVA_SMTP_ALLOW_PRIVATE) or to a link-local or cloud metadata address (always),
like webhooks, so a channel cannot probe the server’s network; a literal address or localhost
that would be refused is already refused when the channel is saved. A member’s reply
in a conversation that started on an e-mail channel goes out through a River job: From is the
channel address (or its per-channel sending address) with its display name, Reply-To the channel
address, To the address the conversation’s contact last wrote from among the contact’s own
addresses (or the contact’s first address) and never another sender in the thread, Cc the
conversation’s active participants unless the reply names its own cc ([] copies no one), Bcc never
as a header, Subject Re: …, and In-Reply-To and
References keep the thread. A reply (createMessage, sendMessage for a draft, MCP
send_reply and send_draft, so members, keys with send rights and assistants while sending is
allowed) may set cc and bcc, at most 50 addresses each. Each address is validated, may not be
an address of this server (answered like an invalid address), and is refused with 409 email_undeliverable when it has a suppression
of scope all (a hard bounce, or a complaint about transactional mail); a broadcast-only
suppression (a complaint about or unsubscribe from a broadcast) does not stop a reply, since the
person is part of a conversation, not a list. Default participants with a suppression are left out
silently. The contact’s address is dropped from both lists and an address in both stays in cc.
Addresses in cc become participants. bcc is stored on the message’s e-mail row for members:
it is in the message’s email.bcc only in answers to /v1 requests (message list, create, send),
never in events (so never in /v1/events, realtime, webhooks or the contact’s stream), never on
/client/v1 and never in the stored or sent headers; the sender passes To, Cc and Bcc as
envelope recipients (suppressions are checked again at send time and drop a copy, not the
reply), and a relay that refuses one recipient fails the whole send. The stored e-mail keeps
to, cc and bcc for the thread view. Automatic mail copies no one: greetings, rating
requests, chat continuity and automation rule replies, since an automatic Cc to addresses taken
from inbound headers would turn every rule into a way to send mail to strangers. Reply-To stays the channel address. Notes are never sent. The message carries its delivery state
(queued, sent, failed with the error), reported live as message.updated; temporary SMTP
errors are retried, 5xx replies fail at once. An e-mail channel can greet new conversations once
per contact within a set interval; the greeting is a system message with
Auto-Submitted: auto-replied.
Signatures (Y-168): each member has an own signature per inbox (/v1/me/signatures, Markdown; an
empty body means none) and an inbox has a default (Inbox.signature, set by owners and admins) with
{{member.name}} and {{member.title}}, whose values are flattened to one line and have every ASCII
punctuation mark escaped. The server adds the signature, not the composer, so its images render and
the API and MCP get it too: when a member’s reply that goes out by e-mail is created or stored as a
draft, the effective signature (own, else the default) is rendered with hard line breaks, images
other than the workspace’s e-mail images turned into links, and stored on the message
(signature_html, signature_text); signature: false leaves it off. Notes, chat, app and API
channel replies, forwards and bot, rule and key messages carry none. The mail build adds the last
message’s signature once per batch after -- , before a trailing quote block in both parts; with
the message’s own HTML it goes before </body> and at the end of the text. Images in a signature
count as used (cleanup and image_in_use), and sending one sets sent_at. Any member may upload an
e-mail image for this; listing and deleting stay with owners and admins.
New mail (Y-166, POST /v1/conversations/mail, MCP compose_mail): a member, or a key or token
with conversations:write, messages:write, contacts:write and send rights, starts an e-mail
conversation and its first message in one step, through the named e-mail channel of the inbox or its
first with an SMTP account (409 email_not_configured without one), in a support or mail inbox.
to (1 to 50), cc and bcc (up to 50 each) are checked like a reply’s cc, suppressions in one
query; an address in several lists keeps the first of to, cc, bcc. The first to is the
contact, found by address or created. The workspace keeps one contact per address: a contact the
caller cannot see (its conversations are in inboxes the caller has no access to) is used all the
same and becomes visible to the caller through the new conversation, exactly as a mail from that
address into the inbox would make it. When the mail is sent, the other to and every cc become
contacts when unknown and active participants, so their answers join under the participant rules;
bcc is never a participant or contact and stays out of events, headers and /client/v1 as on a
reply. The mail goes To every to, Cc the cc, Bcc as envelope only, with the subject as
written (no Re:), a new Message-ID and no In-Reply-To or References; the sender delivers to
every To of the stored e-mail row. A hard bounce or complaint for one recipient suppresses that
address, and the message fails only when every To bounced; delivery reports keep the one-recipient
rule above, so a report about mail with several recipients changes nothing. In a mail inbox the
calling member is the assignee (keys assign no one) and the conversation starts pending, so it
waits under Sent and the first reply reopens it into the Inbox. A draft makes only the conversation and its
contact; it keeps its to, cc, bcc and subject in composed_mails (workspace, message, inbox,
optional client_id; deleted with the message, scrubbed with the other recipient lists when a
contact is deleted), and sendMessage sends exactly that mail, cc and bcc given there replacing
the kept lists, every address checked again, and 409 no_recipient when no to is left. A repeated
client_id in the inbox answers 200 with the stored conversation and message before any limit
(unique in composed_mails, since messages have no index for it across conversations). Per member or
key: at most 60 composed mails a minute, and at most 300 recipients an hour of sent new mail, counted
when the mail or its draft is sent (429).
Sending as the member (Y-167): in a mail inbox a member’s mail (reply, sent draft, new mail, forward) goes
From the channel’s sending address with the name <member name> (<channel display name or name>),
the channel name alone without a member name; bot, rule and key mail and support inboxes keep the
channel’s name (a member’s forward from a support inbox keeps the member’s name alone). A member
may also send from an own address: member_addresses (workspace, id, member, lower-cased address
unique in the workspace, verification code or approval, verified time, code hash, expiry,
attempts, sent time; deleted with the member) is managed with /v1/me/addresses by member sessions
only. Only a plain address is taken: no display name, a dot-atom local part (no quoted local parts,
spaces, commas or a second @), not *@. Adding one mails a 6-digit code through the server mailer (member_address_code, valid 10 minutes and 5 tries,
only its HMAC stored); a new POST for the same unverified address mails a new code, at most one a
minute per address, 10 an hour per member and 5 a day to one address across the server (shared with
channel codes), counted on the DB limiter before the transaction; at most 10 addresses per member. An
address that is a channel or sending address of the workspace, a proven channel address anywhere on
the server, YUVA_SMTP_FROM, on the forwarding domain, or verified by another member is
409 address_taken, checked when it is added and again when it is verified (under the address’s
advisory lock); another member’s pending claim is replaced, since pending claims block nobody. When a
channel of the workspace catches all mail of the address’s domain (*@domain), the code would land in
an inbox every member may read, so no code is mailed: the address is verification: approval and an
owner or admin lists it with GET /v1/members/{id}/addresses and approves it with
POST /v1/members/{id}/addresses/{addressId}/approve (no rate limit is taken). Audit:
member_address.added, .verified (with by: approval for an approval), .removed (target the
member). A verified address is usable for an e-mail channel when its domain is the channel’s sending
domain and the channel’s latest deliverability check of that domain is received with an aligned
DKIM pass and DMARC pass, was started at most 30 days ago and after the channel’s
sending_changed_at (set when its address, sending address or SMTP account changes)
(usable_channel_ids, each channel’s check read once per request). A blank from_address form field
counts as absent, and from_address is checked before the recipient quota of a new mail is taken. from_address on createMessage (and its form), sendMessage and
composeMail picks one for the mail (409 from_not_allowed naming the reason; keys and connected
apps 400, MCP tools included; a draft keeps it in messages.draft_from for its send). Catch-all channels also take any address of
their domain from every caller, as described under e-mail ingress, without a member address row. The message’s e-mail row keeps it as
from_address with member_address_id; the mail goes From the member’s name and address,
Reply-To the channel’s address, the envelope sender stays the channel’s sending address so bounces
reach the channel, the Message-ID carries the conversation token on the same domain, and the signature
is unchanged. The send job checks again that the address still exists, is the sender’s and verified,
and is usable, and otherwise fails the message for good. Replies come back through Reply-To; mail
addressed to a verified member address is taken only when no channel takes the recipient and it names
a conversation token of that workspace in In-Reply-To or References: it is ingested through the
conversation’s e-mail channel under every rule above (loop, spam, DMARC, participants, sender cap) and
lands in that conversation’s inbox. Every other outcome on that path (no token, a blocked or capped
sender, unreadable or dropped mail) answers exactly like an unknown recipient.
Forwarding (POST /v1/conversations/{id}/forward): a member sends one message or the
conversation (its latest 100 messages to and from the contact; never notes, drafts, events or other
forwards) to 1–10 outside addresses with a note on top. It is stored as a message of the members-only
kind forward (direction out, body the note, forward = scope, message ids, recipients and
whether files went, and a message_emails row with the recipients in to), sent by the same River
job as replies through the conversation’s e-mail channel or else the inbox’s first (an exact address
before a catch-all; none with SMTP is 409 email_not_configured). Headers: From the channel’s
sending address with the member’s name (a key’s bot name), Reply-To the channel address, To
every recipient, Subject Fwd: and the conversation’s subject, a new Message-ID with the
conversation’s token, and neither In-Reply-To nor References, so recipients learn no id of the
customer’s thread. The body is composed when the job runs, under the forwarded messages’ share
locks, so a message redacted meanwhile is left out: the note, then each message as text under a
---------- Forwarded message ---------- header (sender, date, subject, To, Cc; never Bcc);
the HTML part is that text escaped, the original HTML is never sent. Files go when attachments
(default true) and total at most 20 MiB (413 forward_too_large). Recipients are checked like
cc (valid, not this server’s, same answer for both), the contact’s own and typed addresses and the
conversation’s active cc participants, who already get its replies, are refused (400, reply
instead) and suppressions of scope all answer 409 email_undeliverable; at send
time suppressed recipients are dropped. Forwards are rate-limited per member or key (20 an hour)
and per workspace (200) by the DB limiter, checked before the transaction. A forward is never a
reply: it does not touch SLA, status, first response or last_message_at, copies no one, and
LatestThreadEmail skips forward rows, so customer replies never name it. It is emitted as
message.created on realtime and /v1/events; webhooks get it (and its draft events) only on
endpoints with include_notes, and /client/v1, the contact’s stream, previews, unread counts for
contacts, SLA and automation triggers only see message rows. An answer to a forward notifies,
as the member notification forward_answer (push and e-mail fallback, both on by default), only
the member who sent the forward it names and the conversation’s assignee, while they can see the
inbox and have the event on; never the inbox’s other members or Slack. Members may; keys and
OAuth tokens need conversations:read and messages:write (no separate scope: those rights can
already mail a conversation’s text to a bcc), and bots_may_send unless draft: true. A draft
forward is sent with POST /v1/messages/{id}/send, which rechecks recipients, files and limits and
takes the conversation as it is then. MCP: draft_forward always, forward_conversation only while
the caller may deliver. Answers: mail that passes DMARC from a forward’s recipient and names that
forward’s Message-ID (or its relay id) in In-Reply-To or References joins the conversation as a
forward with direction in from the recipient’s contact, members-only like the forward and not
counted as the contact’s message (it reopens the conversation like any reply); the recipient becomes an active participant with role
forwarded, and the other addresses that mail names become forwarded and suggested. Any
verified mail that answers a forward its sender received joins this way, whatever participant row
the sender has, and even from the contact’s unconfirmed typed address: a suggested address becomes forwarded and active, an active cc stays cc.
Later verified mail from a forwarded participant joins the same way; anything else from them opens a
related conversation. Contact deletion removes their address from forwards’ recipients like from
participants, and GET /v1/contacts/{id}/participations lists conversations whose forwards (also
drafts) named them.
Mail through Amazon SES can carry the SES tenant of the channel’s inbox (see Broadcasts and e-mail
designs › Amazon SES tenants): every send path (replies, greetings, rating requests, continuity,
broadcasts, tests, list mails, both probes) adds X-SES-TENANT and X-SES-CONFIGURATION-SET through
one helper when the account used is an SES endpoint; server mail (YUVA_SMTP_*) never does.
Bounces: an inbound delivery report (multipart/report; report-type=delivery-status) to a channel
address counts only when its envelope sender is empty (the null reverse-path RFC 5321 §4.5.5
requires of delivery reports), it names a message we sent from that workspace (its Message-ID in the
returned headers, In-Reply-To or References) that went to exactly one address, its
Final-Recipient is that address, and no other stored mail that refers to that Message-ID went to,
came from or was copied to another address (otherwise someone else holds the Message-ID and could
name it); then it fails the message and marks the recipient undeliverable. An ARF complaint about
transactional mail follows the same one-recipient rule. Anything else is stored as an ordinary automatic mail from its sender and changes
nothing; a blocked sender is refused before the report is looked at. Amazon SES bounces and
complaints arrive at /ingress/ses through SNS: the SNS signature is checked against the AWS
certificate, only topics listed in YUVA_SES_TOPIC_ARNS are accepted, a subscription is confirmed
only on an sns.<region>.amazonaws.com URL, a notification whose Timestamp is more than an hour
old (or ahead) is refused as a replay, and a notification counts only for a message we sent
and for its recipients (To, Cc and Bcc; the message fails only when every To recipient bounced). Suppressions have a scope: a hard bounce or a complaint about a reply
stops all mail to the address; a complaint about a broadcast stops broadcasts only (see Broadcasts).
Undeliverable addresses are shown on the
contact, replies to them are refused until a member clears them.
Mail the server writes itself (sign-in code and pause notice, invite, member notification, address
confirmation, discussion digest, rating request) is multipart/alternative: the text part from
api/internal/mail/templates/<locale>/<name>.txt, unchanged, and an HTML part from <name>.html
in the same locale (en, tr, de; English when the locale has no text template) inside one shared
layout (templates/layout.html, Go html/template, so every value is escaped). The layout is
table-based with inline CSS, at most 560px wide, a system font stack, no remote images, fonts or
tracking; a prefers-color-scheme media query is the only <style> and only darkens it. Mail to
members and people signing in carries the “Yuva” wordmark in the panel’s brand colour; mail sent to
a contact on behalf of an inbox (address confirmation, discussion digest, rating request) carries
the inbox’s name and branding.color (else #2563eb) and never names Yuva, with a readable
button and text colour derived from it. List-Unsubscribe links also appear as footer links. Both
parts are quoted-printable UTF-8 through the server mailer (YUVA_SMTP_*); the rating request goes
out through the inbox’s e-mail channel like a reply, its HTML stored as the message e-mail’s
full_html while the message itself stays text. List confirmation and welcome mails (list_confirm,
list_welcome) are rendered the same way under the inbox’s brand and go out through the list’s e-mail
channel, never through the server mailer. The continuity mail renders only its subject (its
body is the members’ replies) and push payloads stay text.
Live chat and async messaging (web)
sdk/js ships a framework-free web component, <yuva-chat>, in Shadow DOM, translated with Lingui,
loaded by one script tag. Two layouts: a floating launcher for websites, and embedded for an
inline thread inside a product’s own panel.
-
The panel is the “lined” design: rules 20px in from each side with a “+” where section rules meet them, numbered mono section labels, Geist and Geist Mono when the host page loads them (else the system fonts; the widget never fetches fonts), the channel’s colour as accent,
prefers-color-schemefor light and dark. It opens on Home (availability, the latest conversation, a button for a new message); a thread follows shadcn’s message and bubble patterns. The e-mail confirmation card readsemail_confirmationon the client contact and thecontact.updatedframe:sent(untilexpires_at, then it asks for the address again),undeliverable(an inline field to fix the address) andconfirmed(a quiet line). -
Each panel language is its own content-hashed chunk (
/widget/yuva-panel-<locale>-<hash>.js), so/yuva-chat.jscarries no catalog and a visitor downloads one. -
Home offers apps inside the same panel, loaded on first use from a chunk of their own (
/widget/yuva-chat-apps-<hash>.js, with one catalog chunk per language): Feedback (POST /client/v1/feedbackwith the inbox’sfeedback_categories, files as multipart), Status (inbox.status, and the page JSON at/client/v1/status/{slug}withinbox.status.slug, which works on a custom domain too) and Get updates (/client/v1/channels/{key}/listsand/subscriptions). A tile appears only when its API answers for the channel; a help center has no client API yet and has no tile. The Roadmap tile (inbox.roadmap, public boards only) and the What’s new tile (inbox.whats_new, with an unread count) appear when their APIs answer;announce_updateson the channel puts the update count on the launcher badge. -
The server hosts the widget scripts itself at
/yuva.js,/yuva-chat.jsand/yuva-docs.js(cached five minutes, ETag). What a script loads on first use (the discussion thread, composer and preview of/yuva-docs.js) is a content-hashed chunk at/widget/<name>-<hash>.js, cached as immutable; a request for a previous build’s hash of a known chunk is redirected to the current one. -
Public channel settings come from
GET /client/v1/channels/{key}without creating a contact. -
A
chatchannel has a public key (not a secret; it is embedded in pages and can be rotated), the exact origins whose pages may use it, whether anonymous visitors may chat, whether to ask for an e-mail address when nobody is available, a greeting and launcher overrides./client/v1answers browsers only from origins some chat channel allows (CORS) and then checks the session’s own channel: a request for a chat channel must carry one of its origins, and one without anOriginheader is refused. The server’s own origin (YUVA_PUBLIC_URL) counts as allowed for every chat channel, so the panel can show a live widget (the setup page’s preview) without changing the channel; a same-origin request withoutOrigincounts as that origin only when it carriesSec-Fetch-Site: same-origin. Session starts and contact writes are rate limited per IP address (per /64 for IPv6) and from a per-channel budget (see Server (api/), budgets: 120 session starts and 240 writes a minute per network, ceilings 6,000 and 12,000). An IP address starts at mostYUVA_ANONYMOUS_CONTACTS_PER_HOUR(20) new anonymous visitors per channel and hour (429 anonymous_limit); resuming a visitor does not count. -
Contacts see their own conversations of the inbox, messages only (no notes, no internal events), conversation status, and of members only the display name and initials.
-
liveinboxes show who is available: members with access to the inbox, with an open/v1/realtimeconnection, not set toaway, while the inbox is within business hours. They also show members typing and how far members have read. -
asyncinboxes show the expected reply time instead and no presence. -
When a member changes the inbox or the session’s chat or app channel, open client connections of that inbox get an
inbox.updatedframe with the same public settings asGET /client/v1/channels/{key}(sent only when they differ from what the connection last saw). The frame has no id and is not replayed (a channel change travels as a signal like typing), so a connection that resumes withlast_event_idgets oneinbox.updatedframe with the current settings and status right afterready, whatever it missed while away. -
If the contact has left when a reply arrives and an e-mail address is known, the reply is e-mailed after a delay; their e-mail answer continues the same conversation. A River job checks the conversation
YUVA_CHAT_EMAIL_DELAY(5 minutes by default) after a member’s reply and after the contact’s last connection closes: the members’ replies the contact has not read, once the oldest is that old and the contact has been gone that long, go out as one e-mail through the inbox’s e-mail channel, threaded so an answer finds the conversation, at most one e-mail per delay. Notes are never sent. The subject is the inbox name and a fixed “new reply” phrase in the contact’s language (else the inbox’s), never visitor text, and it goes only to the contact’s own addresses, never to an unconfirmed typed one. The contact’s last seen time is saved before their connection is removed, so a check never finds them both disconnected and not recently seen.
In-app messaging (mobile)
sdk/swift(Swift packageYuvaKit): a headless client plus SwiftUI screens (conversation list, thread, composer, attachments, feedback form, the rating card and the status line), mailing list subscriptions, opt-in shake to send feedback, and analytics (YuvaAnalytics).sdk/kotlin: the same for Android, Compose UI.- The apps talk to
/client/v1with the public key of anappchannel: like a chat key it starts contact sessions and can be rotated, anonymous use is off unless the channel allows it, and the channel lists the platforms it ships on. Native apps send noOrigin, so app keys are not tied to origins and skip the origin check (a browser on an origin no chat channel allows is still refused by CORS). App channels share the chat channels’ settings table, with no origins. - The host app gets an identity token from its own backend and opens Yuva’s screens or drives its own UI from the client.
- The SDKs send the app’s and device’s details as
client_infowith the session and refresh them on later conversations and messages; see “Client details” under Feedback. - Push: Yuva sends
message.createdwebhooks to the host backend, which already holds the device tokens and APNs/FCM keys. The payload’scontact.onlinesays whether the contact had a live/client/v1/realtimeconnection (seen in the last 75 seconds) when the webhook was prepared; when it is false the app is closed or in the background and the host sends its push. The host puts the conversation’s id (data.message.conversation_id) in the push payload asyuva_conversation_id(APNs: a top-level key next toaps; FCM: adataentry);Yuva.handleNotificationin both SDKs reads it and returns the conversation to open.GET /v1/contacts/{id}/presenceanswers the same question on demand. - Push sent by Yuva (optional, off by default, so hosts that push after the webhook keep working):
an
appchannel’spushholds an APNs token key (.p8, key id, team id, bundle id,sandboxorproduction) and an FCM service account (JSON key file, project id), each sealed underYUVA_MASTER_KEY, write-only (the answer says which areset; an absent key or file keeps the stored one, an empty one removes it; changes are audited aschannel.credentials_changed), plusshow_content. The SDKs register the device withPOST /client/v1/push-devices(platform, token, the app’s bundle or package id) on every start and token change and remove it on sign-out (DELETE …/{id}); a contact keeps its 20 newest devices, a token registered by another contact of the channel moves to the new one (its registration time restarts), and devices follow a contact merge. A member’s or bot’s reply that is not e-mailed queues a River check when the contact has a device on an app channel of the inbox with push on. The check pushes the newest reply the contact has neither read nor been pushed (push_throughon the conversation) and was created after the contact’s first device registration (so turning push on never pushes old history), unless they have a live/client/v1/realtimeconnection; a conversation is pushed at most every 30 seconds (later replies wait for the window and go as one push) and a newer push replaces the older one (apns-collapse-id, FCMcollapse_keyandtagare the conversation id). The contact’s last connection closing, or lapsing, queues the same check for replies that arrived while they were connected. The push’s title is the inbox name, its body the start of the reply (140 characters) whenshow_content, else a fixed “new reply” line in the contact’s language, rendered when the send job runs (the job carries the message id and the badge, never text, and ignores any text an older job stored), and nothing is sent when the reply was redacted or trashed, its conversation is trashed or spam, or the contact is deleted; the badge is the contact’s number of unread conversations in the inbox; the payload carriesyuva_conversation_idexactly as a host-sent push does. iOS devices whose app id is not the channel’s bundle id are skipped. One River job per device, naming the contact it was meant for (a token that moved since gets nothing), sends it with the standard library (an ES256 provider token for APNs over HTTP/2, an RS256 assertion exchanged at Google’s token endpoint for FCM HTTP v1; both cached in memory). APNs 410 and FCMUNREGISTEREDdelete the device. APNsBadDeviceTokenandDeviceTokenNotForTopicdelete it only once an APNs push has succeeded with the channel’s current APNs settings; before that they usually mean the wrong environment, so the token stays and the answer becomespush.last_error. 429, 5xx and network errors retry (5 attempts); other answers (a refused key, FCMSENDER_ID_MISMATCHfor a service account of another project) keep the tokens and are kept on the channel aspush.last_erroruntil the next success or save.
Webhooks
Endpoints belong to the workspace (all events) or to one inbox (that inbox’s conversations, and
contact events for contacts with an external id or a conversation there). Each has a URL, the event
types it subscribed to, whether message.created includes members’ notes (never by default;
internal events are never sent), an enabled flag and a signing secret: 32 random bytes shown once
as whsec_<base64>, stored encrypted under the master key, rotatable. After a rotation the old
secret keeps signing next to the new one for 24 hours.
Events: conversation.created, conversation.updated, conversation.rated, message.created,
feedback.created, contact.updated, contact.deleted, subscription.created, subscription.updated,
broadcast.updated, discussion.stage_changed, changelog.entry.published,
changelog.entry.unpublished, changelog.entry.deleted, issue_link.created, issue_link.updated,
issue_link.deleted. Payloads follow Standard Webhooks: {type, timestamp, workspace_id, inbox_id, data}, with the conversation, message and contact in data; the contact
carries external_ids (so the host maps it to its own user) and online. contact.deleted
carries the external ids the contact had.
Delivery: the transaction that writes an event also queues a River fan-out job when the workspace
has an enabled endpoint; the job builds the payload once and creates a delivery per matching
endpoint, each sent by its own job. Requests are signed per Standard Webhooks (webhook-id, the
same on every retry; webhook-timestamp; webhook-signature: v1,<base64 HMAC-SHA256 over id.timestamp.body>, space-separated during a rotation). A 2xx answer succeeds; anything else is
retried after 5 s, 1 min, 5 min, 30 min, 1 h, 2 h, 4 h, 8 h and 9 h (up to 10% jitter), about 24
hours in all. An endpoint whose every attempt has failed for 24 hours, or that answers 410 Gone,
is disabled with the reason shown to members; enabling it again clears the reason, and any
delivery can be sent again by hand with the same webhook-id. The delivery log keeps the newest
100 attempts per endpoint (status code, latency, the first 1 KiB of the answer, the error);
finished deliveries are kept 7 days.
Outbound requests never reach internal networks: the URL must be http(s) without credentials, and
on every attempt the host is resolved once, refused when any address is loopback, private,
link-local (cloud metadata included), CGNAT, multicast or otherwise reserved, and the connection
goes to that resolved address only. No proxy, no redirects (a 3xx is a failure), a 10 second
timeout and at most 64 KiB of the answer read. YUVA_WEBHOOK_ALLOW_PRIVATE=true lifts the address
check for development (the dev compose file sets it); never set it on a shared server. Link-local
and cloud metadata addresses (169.254.0.0/16, fe80::/10, fd00:ec2::254, Azure’s 168.63.129.16,
Alibaba’s 100.100.100.200, IPv4-mapped forms included) are refused even then, when the endpoint is
saved and on every attempt; every outbound client shares this list (webhook.NeverAllowed).
sdk/go/webhook verifies the signatures for Go backends.
Panel (web/)
React, Vite, shadcn, TanStack Query, Lingui; built to static files and embedded in the binary.
The server sends the panel with X-Frame-Options: DENY, Referrer-Policy: same-origin and a CSP
that allows only its own scripts, connections and workers, no framing (frame-ancestors 'none') and
no plugins; inline styles and any http(s) image stay allowed for the sandboxed e-mail frame, which
inherits the policy. Every response carries X-Content-Type-Options: nosniff.
Languages: the panel ships 47 languages, one list in web/src/localeList.ts that web/lingui.config.ts
and the loader both read; adding a language is one line there plus its six catalogs
(messages, analytics, designs, help, roadmap, changelog). Catalogs load lazily per locale (import.meta.glob), only the
active language is fetched, and the service worker precaches just en and tr. Before sign-in a lang
query parameter (the marketing site’s choice, matched the same way, unknown values ignored) wins on the
first load, is remembered like a picker choice and is removed from the address bar; otherwise the
yuva_locale cookie, then the saved choice, then the browser’s languages pick the best match (exact, alias such as zh-TW or no, base language, then
en); after sign-in the person’s locale rules, and every picker lists languages by native name and
saves to it. Every language change also writes yuva_locale (locale code, Path=/, one year, SameSite=Lax,
Secure on https): with Domain=<locale_cookie_domain> from GET /v1/version when the server reports one, so a
site on the same parent domain shares the choice, otherwise host-only. The write waits for /v1/version (start-up
never does) and a host-only cookie is expired once a domain is known. <html lang> follows the language and dir is rtl for ar, he and ur; shared
shells use logical Tailwind utilities (ms, pe, start, end, rtl:). Dates, numbers and
relative times format with the active locale.
Home and setup (M17): owners and admins open / on Home, agents on the inbox; the managers’ inbox
lives at /conversations. Home’s own content is one request, GET /v1/home (member sessions
only), for a period of days (7, 14 or 30, by default 14) ending today in timezone, optionally
narrowed to one inbox with inbox_id (404 for an inbox the member cannot see). It answers the
period and the previous one of the same length; inbox counts, open feedback and the five
conversations that have waited longest (open, not spam, with a contact message after the last reply
from a member or bot; notes and automatic replies are not replies), with their contact, channel kind
and last contact message; the period’s activity (conversations started, first replies with their
median time and ratings, counted as GET /v1/stats counts them) in total, for the previous period
and per day, each day’s conversations split per inbox; per inbox its open conversations and the
period’s conversations and ratings; open conversations per assignee; each status page with its
state and its visible components’ worst state and uptime per day of the period; the five published
ideas with the most votes that are not shipped or closed; the next five of scheduled broadcasts,
open incidents, maintenance not completed and scheduled what’s new entries; visitors today, in the
last 30 minutes and per day for seven days for each property the member may see; the last sent
broadcast’s recipients, sent, clicked and replied (there is no open tracking); and, for owners and
admins, the setup checklist, which inbox_id does not narrow. Every block is gated like the
endpoint it mirrors: only the inboxes the member can see, and ideas, broadcasts, what’s new and
analytics only when the server has them. At most fourteen queries whatever the workspace’s size,
each bounded by the open backlog, the period or the workspace’s configuration, never by its
history: conversations started are found through the activity index, ratings through the rated
index, first replies through the messages’ time index, uptime from the status component spans. It
is read from the counters, rollups and indexed tables the server already keeps, so it spends none
of the workspace’s analytics query slots; blocks the member may not see are left out. What the
shell already loads on every page stays out of it and Home reads it from there: inbox names and
colours (GET /v1/inboxes), members and their live presence (GET /v1/members and realtime), and
mentions (GET /v1/me/mentions, whose seen state changes live); the conversation a teammate is
looking at is named from the open conversations list, as in the team menu. The checklist is the same setup state
the MCP get_setup_state tool returns. /setup is one hub of cards (live chat, e-mail, mobile
app, documentation pages, analytics, newsletter); a card that is set up links to its place, one that
is not runs its flow inside the setup layout, and /analytics/new opens the same analytics flow. The
panel no longer jumps to /setup on its own; Home shows what is left.
Home data added in M41.2. GET /v1/conversations/counts adds unassigned_inboxes: unassigned
per inbox, read from the same grouped query as outbound_inboxes, so no extra query; MCP
get_counts returns it. Recent is GET /v1/activity?inbox_id&limit&cursor (member sessions only,
like GET /v1/home, so no scope and no MCP tool): conversation.closed, conversation.rated,
incident.updated, article.published and broadcast.sent, newest first by (at, id), 20 per
page and at most 50, cursor-paged like the audit log. It is one read-only union over rows the
server already keeps, nothing recorded for it: the status_changed (to closed) and rated events
in conversation timelines, status_incident_updates of published incidents,
help_article_revisions of kind publish, and broadcasts in state sent at finished_at; each
branch filters by workspace_id, applies the cursor and its own limit before the union. Permission
rule: every kind belongs to one inbox (a conversation’s, its status page’s, its help center’s, the
broadcast’s), and an item is shown to whoever can see that inbox, the rule GET /v1/home and the
status page, help center and broadcast endpoints already apply; a personal mailbox’s broadcasts only
to its owner. Conversation items follow Home’s conversation rule: support inboxes only, spam, trash,
imported history and other members’ private drafts left out, feedback never rated. Articles and
broadcasts are left out when the server has no help center or sends no broadcasts. actor is the
member who closed, posted, published or scheduled; it is absent for ratings (the contact is not
named) and for what automation or an API key did.
E-mail HTML has two views, both in a sandboxed srcdoc iframe under a CSP of its own (no
scripts, no forms, images only from data:, the server’s attachments and, once the member allows
remote images, http(s)):
-
Reading: the sanitized HTML (
html,full_html; bluemonday’s UGC policy, so no styles or colours survive) drawn in the panel’s own type and theme colours, light or dark, redrawn when the theme changes. It never scrolls sideways: tables,widthattributes and images are held to the frame’s width and long words break. Table cells are padded, rows divided by a thin line in the theme’s border colour, and header cells bold. Images sit on a light plate so dark-on-transparent logos stay visible in the dark theme. -
Original (the default when the message has one):
original_htmlfromGET /v1/messages/{id}/email, sanitized with a second policy that keeps inline styles limited to an allowlist of CSS properties and the colour, background and size attributes, never<style>blocks, scripts, forms or external stylesheets. In the light theme it is drawn on white, as the sender designed it. In the dark theme it is darkened automatically before it reaches the frame (the frame runs no scripts): colours from inline styles andbgcolor/colorattributes are mapped in OKLCH, light backgrounds to dark ones of the same hue, text lightened until it reaches WCAG 4.5:1 against the background it sits on, borders alike; elements without a colour take the theme’s; images are left as they are. A button shows the mail as sent, on white, when the conversion gets one wrong. Content wider than the frame is scaled down to fit (to 60% at most) and only beyond that scrolls inside the frame, never the page; a soft fade on the edge that has more to scroll shows that it does. -
Which e-mail view opens first is a per-device preference next to the theme (Settings › Appearance: Original or Reading, Original by default); each message can still be switched.
-
Setup: a full-screen page with no app header or sidebar (a step line, one plain form per step, and the live preview below the form behind “Show the preview”, open by itself where it is the point, as on the first message) takes an owner or admin from an empty workspace to its first conversation: name the inbox, pick a channel (website chat, e-mail, app or documentation site), install it (snippet, forwarding address, SDK lines or the documentation elements), then wait live for the first message, which the preview’s own chat widget can send. A documentation site asks for the site’s name and address, creates a chat channel named after it with that origin and anonymous visitors allowed, and shows the elements for plain HTML, Nuxt and Fumadocs/React filled with this server’s URL and the channel key, with a link to the guide. Nothing is created until the channel step is submitted: the name, language, time zone and channel fields live in a per-tab draft (
/setup/new/...), then the inbox and its channel are created withIdempotency-Keys; a failed channel POST keeps the inbox id in the draft so a retry sends only the channel, and Cancel deletes an inbox that got no channel. The inbox settings start the same flow for chat, app or docs on an existing inbox with a trimmed step list (sites or platforms, install, first message), and the last step offers inviting the team and the inbox settings. Home’s checklist links to it (it no longer opens on its own), and adding an inbox later uses the same page (/setup/new). E-mail has its own five steps (Address, Replies, Receiving, Test, Done; after Name and Channel for a new inbox): the channel is created when Replies is submitted (Amazon SES, another SMTP server, or receive only), the SMTP password lives in component state and never in the draft, and anemail_address_takenanswer sends the user back to Address. From Receiving on the channel exists, earlier steps are unreachable and Cancel reads “Finish later”; Test reuses the deliverability check, the SES tenant status and the DKIM section. The inbox settings’ “+ E-mail” opens this flow; “+ API channel” is an inline form. Adding a webhook endpoint is a three-step wizard (/setup/webhook,?inbox=locks the inbox: Endpoint, Events, Done) with a per-tab draft; the endpoint is created when Events is submitted (a private or invalid URL sends the user back to Endpoint), and the signing secret is shown once on Done and never stored in the draft. A mailing list is a four-step wizard (/setup/newsletter,/sender,/rules, then Done; “New list” in Broadcasts opens it): list, sender (the inbox’s e-mail channels, “None for now”, or a detour to set up e-mail that returns to Sender with the per-tab draft kept), sign-up rules;POST /v1/listsruns when the rules are submitted,name_takensends the user back to the first step. A list’s settings are sections that save on their own: name and description with Save, the sender and each sign-up switch at once with a toast. A new API key is a four-step wizard (/setup/api-key: Name, Access, Review, Done) with a per-tab draft; Access offers the presets Read only, Support bot, Everything and Custom, and inboxes (workspace-wide scopes drop out when inboxes are limited). The key is created when Review is submitted; its secret and acurlline are shown once on Done and never stored in the draft. The key dialog only edits name and bot. -
Connect an assistant (Settings › Connected apps): one page per client (Claude, Claude Code, Codex, ChatGPT, Cursor, VS Code, other MCP clients) with the server’s own
/mcpURL, a copyable command or config, install links where the client has them, and the steps; a new grant shows up there live. -
Main screen (M41,
docs/specs/panel-redesign.md): every page except setup, the OAuth consent page lives in one shell, built from shadcn components. A 40px header that does not stick holds the Yuva mark (to Home), the workspace and product selector, “/”, the current page as a menu of every page in three groups (Work: Home, Inbox, Mail, People; Reach: Broadcasts, Analytics, Feedback and roadmap, Help center, Status; Workspace: Reports, Team, Settings, Imports), each with itsGshortcut and, for Inbox, Mail and Feedback, the count already loaded; then search, which opens the command palette (⌘K), a bell with the latest mentions from/v1/me/mentions(unseen ones marked, a dot while any is unseen, mark all as read, all mentions), and the avatar menu (availability, theme, Getting started for owners and admins, account, sign out). The menu follows the product filter and permissions: Home and Imports for owners and admins, Mail when a mailbox exists, Analytics when a property does. Inside a section a 232px sidebar lists the section’s places under small headings with plain counts where the data is already loaded, exactly one highlighted (aria-current="page"); filters and scopes never go in it, they stay above the list or page they narrow. Inbox has its views (Mine, Unassigned, Waiting, My teams, Snoozed, Done, All, Spam, Trash as the role allows, with the counts from/v1/conversations/counts), replies to mail we sent, Mentions, Assistants (pending drafts from/v1/drafts), the saved views and one item per support inbox; Mail its folders and mailboxes; Settings its places in Workspace, Channels, Conversations, Developer, Security and You; Imports the list and New import; Home has none. A Settings place is a plain page: its title and one line on what it holds, then forms with the label above each 36px field, help below it and the buttons at the bottom. Adding a product, channel, API channel, label, saved reply, macro, field, reply-time policy, automation rule or issue tracker opens an inline form above the list, never a dialog (Mail’s “Filter messages like this” keeps its dialog); API keys and webhook endpoints keep their setup steps. A product, channel, webhook endpoint or assistant opens as a page with a back arrow in the header; a product’s and a channel’s own tabs are the only tab rows. Imports (/settings/migrations) is one bordered list filtered by All, Active or Finished, each row with its source, product, state, progress and menu; a new import walks “1. Source · 2. Connect · 3. Choose · 4. Start” (Map is part of Choose, Review is Start) with the read-only notice on every step, and from Copy on an import is a detail page with its facts and its step’s actions, all inside the shell. Below 900px the sidebar is a horizontal strip under the header. Contacts (/contacts), Team (/team: each member’s presence, what they are looking at and their open load fromassigneesin/v1/conversations/counts), Reports (/reports: today’s/v1/stats, trends, ratings, per member) and Settings open their pages in the main area at the same URLs as before; Mentions and Assistants refresh from the realtime events named with their endpoints, and a row opens its conversation at the note or draft (?m=<message id>, loading older pages until it is there). On a phone every list section has the two screens of the conversations: the list first, then the chosen page with a back button in the header. The conversations list has new conversation and a menu to the command palette and the shortcuts; a search field (Postgres FTS over people and messages); filter chips (All, Unread, Mine, Unassigned, Snoozed, Done, which are the list filtersstatusandassignee, Unread filtering the loaded rows byunread) and an inbox picker; a Filter popover after the chips narrows by type (Live chat, E-mail, App:kind=conversationwith thatchannel_kind; Feedback, Question: thatkind) and by site (site=<origin>, which keeps the feedback and questions sent from that site’s pages; the sites come fromGET /v1/docs/sitesand the chat channels’ origins), kept for the session; then the conversation list, most recent activity first, paged as it scrolls and kept current from the realtime connection. A row shows the contact, the last message (marked when a bot or the team wrote it, replaced by the member’s unsent draft or by “typing…”; a team reply in a chat or app conversation shows ✓, or ✓✓ oncelast_read_by_contact_atreaches it), the time, an unread mark, the channel, the assignee and a green dot when the contact of a chat or app conversation is online. It also says where the conversation came from: a source badge (Live chat, E-mail, App or API from the starting channel’schannel_kind; Feedback and Question take precedence) and, for feedback and questions, the page’s host and path, for chat and app conversations the channel’s name. A contact with neither name nor e-mail is “Visitor ·” with a neutral avatar, never initials; the conversation header shows the same name, badge and place. ↑/↓ move through the list, Enter opens, J/K open the next or previous one. Each member can pin conversations to the top of their own list and mark one unread again, from the row’s context menu or the conversation’s menu (P, U): PUT/DELETE /v1/conversations/{id}/pinandPOST /v1/conversations/{id}/unread, kept per member inconversation_member_statesnext to the read cursors. The list item carriespinned_atfor the caller,pinned=true|falsefilters on it, a mark shows asunreaduntil the member reads the conversation or writes in it, andconversation.pinandconversation.readevents reach only that member’s connections. Pinned conversations of the current filter stand in their own section above the rest. The list also filters by where a conversation came from:kindandchannel_kind(several values, repeated or comma-separated) andsite, the origin of a feedback’s or question’s page. Each conversation carrieschannel_kind, the kind of the channel it started on (stored on the conversation when it is created and kept when the channel goes or the conversation moves), so a row shows its source without another request; a page’s URL and title are underfeedbackorquestion. In the middle, the open conversation (/conversations/:id, M42) as a page in the shell: a back link to the list with “n of m in” and previous/next ( k/j, which still step through the list when it is hidden), the title (subject, or the contact’s name), one meta line (status, the contact, source, inbox, place, labels, high priority and the SLA chip with its popover, then imported, broadcast, related and the other links), and a toolbar: the assignee (avatar and first name; teams are in that menu and the side panel) and Snooze as compact controls, Close as the only primary button (Reopen when closed), everything else in one more menu, then the side-panel toggle (C). Header and title stay put; under them one bordered box holds the collision line, for a chat or app conversation the visitor line (online, typing, last seen, the page they are on, the device fromclient_info, the country and their local time from the time zone), the thread scrolling on its own, the closed line (“Closed. A reply opens it again.” with Reopen) and the composer pinned at the bottom. The thread is built on shadcn’s chat components (message, bubble, marker, attachment, message scroller): chat and app messages are bubbles grouped by sender, the avatar on the group’s last one, time and Sent/Read on the last; a chat opens at its newest message, sticks there while the member is at the bottom and loads older pages on scrolling up. E-mail conversations are a stack of mails: the last one, the one asked for in?m=and any with a delivery error open, the others one line each (sender, snippet, attachment mark, time), and with four or more mails the middle ones fold into one “n earlier messages” line (Eexpands or collapses all); an open mail shows who sent it, its From, To, Cc and Bcc, time and read state, Reply, Reply all (when there are several recipients,R) and Forward, then the subject when it changes, the body (original or reading view), quoted text behind “•••”, the signature, attachments as file chips and the.emldownload. A note is a bubble in the note colour; drafts keep Send / Edit / Discard; events are markers. When the visitor of a chat has left (offline in/v1/contacts/{id}/presence), one quiet line at the end of the thread says so; the reply then goes by e-mail whencontinuitywould send it (an address of the contact, the inbox has an SMTP channel, the address is not suppressed): the composer tab reads “Reply by e-mail” with a To line and “Send e-mail”, otherwise the reply waits in the chat. Another member on the conversation is one line with “I’ll reply” and “Leave it to”. The composer has Reply (Reply in chat, Reply by e-mail) and Internal note tabs, the From picker and Cc/Bcc for e-mail, attach, emoji ( :), one insert menu (;) for canned replies, macros and a help article, quick canned replies above it in an open chat, and a split Send whose menu holds send and close and, for e-mail, send later. The side panel (320px, 280px under 1320px wide; a sheet below 1180px and on a phone, opened from the header) scrolls on its own and has folds, remembered per browser: Person (details, products, new conversation, merge, open in People), This conversation (status, product, assignee, channel, started, team, priority, labels, fields, participants, device, media), Earlier conversations and Notes. On a phone the conversation is a detail page: no section strip, the back arrow in the app header. Mail threads (/mail/...) are the same page: subject and a lede (status, person, address, message count, labels), star, Snooze, Archive or Move to the Inbox as the primary button and a more menu (unread, labels, forward, filter messages like this,.eml, trash), the same mail stack, a Reply / Reply all / Forward / Note for the team row over the composer, and folds for This mail, In this thread and Earlier; writing a new mail is an inline page (From, To, Cc and Bcc, Subject, Message, Attachments; Send, Send later, Save draft, Discard), never a floating window. With nothing open the middle shows what the team did today fromGET /v1/stats: replies sent by members, conversations closed and the median time to the first reply, per member too, over the inboxes the caller can see. Nothing is stored for it: it is counted frommessageson each request (indexed by workspace and time) for a window of at most 366 days; “today” starts at midnight in thetimezonethe panel sends (the browser’s), since members and workspaces have no time zone of their own. -
Acting on a conversation never opens another one. Close, snooze and hand-off apply at once and offer an undo in a toast. A reply is held for a few seconds before it is posted, shown in the thread as sending, so it can be undone; “send” also sets
pending, “send and close” setsclosed. A bot’s draft is offered as the suggested reply. Live conversations are different: a conversation from a chat or app channel whose contact is online right now is talked through. Its replies are sent at once (no hold) and leave the statusopen. In every chat or app conversation, online or not, Enter sends and Shift+Enter starts a new line; in e-mail ⌘/Ctrl+Enter sends and Enter starts a new line. A note takes the same keys as its conversation. The hand-off menu shows each teammate’s presence and open load (assigneesin/v1/conversations/counts, over the inboxes the member can see). Everything else is in a command palette. -
Conversation: reply and note in one box, canned replies on
/, attachments (picked, pasted or dropped anywhere on the conversation), an emoji picker (frimousse, MIT; its Emojibase data is served by the server itself under/emojibase/, loaded on first use and not precached), keyboard shortcuts, contact details with identity attributes, the contact’s other conversations, the conversation’s media, links and documents (from the loaded messages), channel delivery state, ✓/✓✓ read receipts on the team’s chat and app messages, actions on each message (reply with a quote, copy, forward to a teammate as a note that mentions them), a search within the loaded messages of the open conversation that highlights the matches and jumps between them, and a notice when another member types a reply in the same conversation or has it open. The panel reports the conversation it shows with aviewingframe on/v1/realtime; the server keeps it on the connection’s row (see Member notifications), sends aviewingnotice to the other members who can see the conversation when a member opens or leaves it (hiding the page and disconnecting count as leaving), and answers the frame with the members already there. -
Settings: inboxes, channels, members and access, labels, canned replies, business hours, auto-replies, webhooks, API keys, retention and deleting the workspace; deleting one’s own account in the profile. A channel has its own page,
/settings/inboxes/:inboxId/channels/:channelId, with one card per topic (general, receiving, replies, Amazon SES, broadcast sending, deliverability, DKIM, auto-reply for e-mail; sites, visitors, look, discussions, install for chat; access, install for apps; settings for API channels; remove for all). Each card saves on its own and sends only its fields on top of the latest stored channel, so another card’s unsaved text and the stored SMTP passwords are untouched; cards with only switches save on change. The inbox page lists channels as links to it; adding a channel is an inline form. A webhook endpoint page works the same way: endpoint (URL, description), events, sending, signing secret, deliveries, attempts, how to verify and remove, each saved on its own. -
Installable PWA with Web Push (VAPID), so members get notifications on phones without a native app. E-mail notifications as a fallback (see Member notifications).
-
Sign-in sessions (#192):
sessions.user_agent(migration 00119) names the device.GET /v1/me/sessionslists the person’s sessions (method,current, device, created, last seen, expiry), most recently seen first;DELETE /v1/me/sessionsends every other session with its push subscriptions and reader tokens (their realtime streams close at the next 30 s re-check), and removing a passkey does the same in its transaction. Both need a member session. -
Sign-in with an e-mailed one-time code and passkeys. Sign-up is a server setting,
YUVA_SIGNUP, reported to the panel without sign-in onGET /v1/version(signup).invite(the default): the first owner is created withyuva bootstrap, everyone else is invited, and a code goes only to a person or an invited address.open: a code goes to any address (same rate limits, same fixed delay, same202), verifying it creates the person with no workspace, andPOST /v1/workspaceslets a signed-in person create a workspace they own, through the same store path asyuva bootstrap. The workspace records who created it and from which IP address (IPv6 /64); a person may haveYUVA_SIGNUP_WORKSPACES_PER_PERSON(3) live workspaces they created (403 workspace_limit) and one address may createYUVA_SIGNUP_WORKSPACES_PER_IP(5) in 24 hours (429 rate_limited). Underinvitethat endpoint answers403 signup_closed. A code request carries the sign-in page’slocale, kept on the code row: for an address with no person and no invite it is the code mail’s language and the new person’s locale; a person keeps their own and an invite’s locale wins. Underopen, an address with no person and no invite (a reader’s too, since a reader may create a workspace) is also refused when its domain (or a parent domain) is on the embedded disposable-domain list (CC0, disposable-email-domains) or inYUVA_SIGNUP_BLOCKED_DOMAINS(comma-separated), or when it has no MX record or only a null MX (.); a DNS lookup that times out or fails temporarily lets the address through. A refused address gets the same202after the same fixed delay, no code row and no mail, and only the domain is logged.YUVA_OPERATOR_EMAIL(comma-separated, unset = off) tells the server’s operator about growth: a new person created by verifying a code (no person, no invite; readers marked) and a workspace created withPOST /v1/workspacesare written as anoperator_noticesrow in the same transaction (address, workspace name, client IP, and the country only fromCF-IPCountrywhenYUVA_CLIENT_IP_HEADERisCF-Connecting-IP, since Cloudflare overwrites it). A River job, periodic every minute, sends one English e-mail (operator_digest) to every address with the unsent rows, at most once per 5 minutes after the last one, so a burst becomes one mail. Sent rows are deleted after an hour; they are kept only to know when the last mail went out. No conversation, message or contact content goes into it. The panel followssignup: withopenits sign-in page says a new address gets an account (/?signup=1opens it as “Create your Yuva account”), a person with no workspace is asked to create one (name prefilled from the e-mail domain) and goes on to setup, and the workspace switcher offers “Create workspace” (/workspaces/new); withinvitethe page says the server is invite only and a person with no workspace sees that they are not in one yet. A person whose memberships are all gone can still sign in, to see that and to delete their account. Sign-in and invitation e-mails are sent directly, not through the job queue, so a code never lands in job arguments; a code request answers after the same fixed delay for every address and its mail goes out after the answer, so timing does not reveal members. Each code takes five attempts; after 20 wrong codes for an address within 24 hours its codes are refused (429 sign_in_paused) and the member gets one e-mail about it. Passkeys are not affected. The sign-in page asks for the e-mail first and sends people of a domain claimed for single sign-on to its identity provider (see Single sign-on (M33)). A request refused with403 sso_requiredopens a dialog that sends the person to the provider; one refused with403 sso_session_scopeopens one that signs out and goes to the sign-in page for a code or a passkey, or goes back to the workspace the session belongs to.
Member notifications
Six events notify members: the first message of a conversation, from the contact, in a live
or an async inbox (every member with access is a candidate); a later contact message in a
conversation assigned to the member, or in an unassigned one (every member with access);
someone else assigning a conversation to the member; and someone else mentioning the member in a
note. A note names its mentions as member ids (mentions on POST .../messages, each a member
who can see the inbox), stored on the message; the server does not parse @ in the text. A River job queued in the transaction that
stored the message picks the recipients. Nobody is notified about their own action, about a
conversation marked spam, or about a conversation their open panel shows: the panel reports it
with a viewing frame on /v1/realtime, stored on the connection’s row and trusted while the
connection is fresh (75 seconds). A member set to away gets only the events about
conversations assigned to them and mentions.
Each member chooses push and e-mail per event, and can override events per inbox. Defaults by
role: push for everything, except that agents get no push for new async conversations and for
messages in unassigned conversations (owners and admins triage those); e-mail only for messages
in conversations assigned to the member, for assignments and for mentions, for every role, since
being assigned or asked makes anyone responsible.
GET /v1/me/mentions lists the notes that mention the calling member, written by someone else,
newest first, in the conversations the member can see now (losing an inbox hides its mentions), each
with a preview of the note, its author and a conversation summary. A mention is seen once the
member’s read position in that conversation (the same cursor as unread, moved by reading or
writing there) reaches the note; there is no separate mark. unseen in the answer counts the
unseen ones over all pages. Mentions belong to a member, so the list needs a member session; keys and
OAuth tokens get 403 member_session_required. A partial GIN index on messages.mentions for notes
serves it. A client keeps it current from message.created (a note whose mentions holds the
member), conversation.read, conversation.moved and inbox_access.changed.
Web Push follows RFC 8030, 8291 and 8292 through webpush-go, with the server’s VAPID keys
(YUVA_VAPID_PUBLIC_KEY, YUVA_VAPID_PRIVATE_KEY, YUVA_VAPID_SUBJECT; yuva vapid-keys makes
a pair; push is off without them). A subscription belongs to the browser and to the session that
registered it, so sign-out ends it; it receives notifications from every workspace of the person.
One River job sends each push, with a TTL (4 hours for live inboxes, 24 for async), an
urgency (high for live) and the conversation as Topic, so a newer push replaces an
undelivered one. The payload is minimal: inbox and contact name, the start of the message (140
characters), the conversation’s path, a per-conversation tag, the conversation, inbox and
workspace ids. 404 and 410 from the push service delete the subscription, 429, 5xx and network
errors are retried (5 attempts), other answers are recorded on the subscription. Push endpoints
pass the webhook address checks: https only, never a private or link-local address, resolved
and checked on every attempt.
While the panel is open, each browser can also alert in the tab itself (Settings ›
Notifications, off by default, kept on the device): while the tab is hidden, a contact’s new
message in a conversation assigned to the member or to nobody (only the assigned ones while away)
plays a short sound and, once the member has allowed it with the button there (never asked on
load), shows a desktop notification with the same tag as the Web Push one, so the two replace
each other instead of stacking.
E-mail fallback: an event with e-mail on schedules one check per member and conversation after the member’s delay (15 minutes by default). If the conversation still has contact messages (or an assignment, or notes mentioning the member while they have e-mail on for mentions) newer than the member’s read position and the previous notification e-mail, one e-mail through the server’s own mailer, in the member’s locale, lists them and links to the conversation and to the notification settings; at most one per member and conversation per hour. A member’s own message or note moves their read position to it, so the e-mail never lists what they already answered.
Slack (M32)
A workspace connects one Slack workspace (a Slack team belongs to one Yuva workspace at a time)
through Slack’s OAuth v2 with the app the server’s operator registers (YUVA_SLACK_CLIENT_ID,
YUVA_SLACK_CLIENT_SECRET, YUVA_SLACK_SIGNING_SECRET, all or none; without them Slack is off,
GET /v1/slack answers available: false and the other endpoints 409 slack_not_configured). The
manifest and scopes are in docs/slack.md. Self-contained: no shared integrations table (#158 builds
its own).
- Tables.
slack_installations(one per workspace: team, app, bot user, the bot token sealed under the master key with the workspace id as context, granted scopes,reply_commanddefault!reply, the last post error),slack_connect_states(one pending install per workspace, the state’s hash, 10 minutes),slack_inbox_settings(per inbox: the channel for new conversations, the channel for mentions,include_contentoff by default),slack_threads(channel and thread ts of each post Yuva made, to the conversation),slack_member_links(member to Slack user, one each way),slack_link_codes(a pending code’s HMAC, 10 minutes, 5 tries) andslack_events(event ids seen in the last 24 hours, pruned on insert). All carryworkspace_id. - Install.
POST /v1/slack/connect(owners and admins, member session) returns Slack’s authorize URL with a state that names the workspace and member plus 32 random bytes, of which only the hash is stored, as for migration sign-ins.GET /slack/oauth/callbacktakes the state once, needs the same member session, exchanges the code atoauth.v2.access, requires a bot token with every scope (else revokes it,scope_missing), refuses a team another workspace has (team_taken), and redirects to the panel’s/settings/slack?result=…. Connecting another team drops the previous team’s channels, threads and links.DELETE /v1/slackremoves everything and revokes the token atauth.revokeafter the commit (a failure is logged). Audit:workspace.slack_connected,workspace.slack_disconnected(bysystemwithreason: uninstalledon Slack’sapp_uninstalledortokens_revoked),member.slack_linked,member.slack_unlinked. - Posts. The notification job (
notify) queues aslack_postjob, unique by message and event, for a contact’s first message (new_conversation) and for a note with mentions (mention) when the inbox names a channel for it. A post carries the event, the subject, the contact’s name, the inbox and<public URL>/conversations/<id>, and the start of the text (300 characters) only withinclude_content; every value from people is escaped (&,<,>), so customer text cannot become a Slack link, mention or@channel. A mentioned member with a linked Slack user is mentioned as<@U…>. A mention goes into the conversation’s existing thread in that channel, else starts one; every top-level post is recorded inslack_threads, and every post (migration 00119slack_posts: channel,ts, conversation, message, whether it carries text) so it can be rewritten later. - Posts follow redaction, trash and deletion. Slack keeps what was posted, so Yuva rewrites it
with
chat.update(decision: update, notchat.delete, so a thread keeps its replies): in the transaction of the change, the post rows are taken out ofslack_postsand oneslack_scrubjob per post is queued on theoutboundqueue (5 attempts; a rate limit snoozes it; the job carries the post’s address and a reason, never text). Redacting a message rewrites the posts that carried text for it, and SLA posts of that conversation that carried text, to “Message removed.” with the link to the conversation; trashing a conversation rewrites all its posts to “This conversation is in the trash.” with the link (restoring does not bring the text back); deleting a conversation for good (trash purge, retention, migration cut-over) or deleting its contact rewrites them to “This conversation was deleted.” without a link. None of the placeholders holds a name, subject or text. A post Slack no longer lets the bot edit (message_not_found,cant_update_message,edit_window_closed,channel_not_found,is_archived,not_in_channel) is left; nothing is queued, and a job that finds Slack disconnected does nothing. Replies written in Slack are Slack’s own and stay. - SLA posts.
slack_inbox_settings.sla_channelandsla_warnings(migration 00111). Thesla_checktransaction that marks a target breached (or warned, only withsla_warnings) also queues oneslack_sla_postjob, unique by its arguments, when the inbox has an SLA channel; the mark happens once, so the post is never repeated across replicas or retries. The post names the target, the lateness (or time left), the assignee (mentioned as<@U…>when linked) or team, the subject, contact, inbox and link, and the latest customer-visible message start only withinclude_content. It joins the conversation’s thread in that channel or starts one, so replies behave as in other threads. Delivery, rate limits and error recording are those ofslack_post. - Outbound. Only
https://slack.com/api/(tests point the client elsewhere). Each call is tried up to three times: a 429 whoseRetry-Afteris at most 10 seconds is waited out, a 5xx or failed connection after 1 and 2 seconds. A longer rate limit snoozes theslack_postjob forRetry-After; other temporary failures retry the job (5 attempts); a refusal that will not pass (not_in_channel,channel_not_found,invalid_auth, …) is recorded as the connection’slast_errorinstead, cleared by the next post that succeeds. - Events.
POST /ingress/slackverifiesX-Slack-Signature(HMAC-SHA256 ofv0:<timestamp>:<body>with the signing secret, compared in constant time) and a timestamp within 5 minutes before parsing, answersurl_verification, finds the installation byteam_id(andapi_app_id), claims theevent_idinslack_eventsand queues aslack_eventjob in the same transaction, then answers200(Slack retries carry the same id and change nothing). The job carries theteam_idandevent_timeit was routed by and drops the event when the installation now belongs to another team;app_uninstalledandtokens_revokedare also dropped when the installation is newer than the event, so a queued uninstall never removes a reconnect. The job acts only on a plainmessagein a thread Yuva posted (no subtype, no bot, not the bot user). - Replies. The Slack user must be linked to a member; the reply runs
CreateMessageas that member’s principal withvia: Slack, so inbox access, the send rules and the events are the panel’s. Without the command it is a note (Slack mentions of linked members who see the inbox become itsmentions); withreply_command(!and 1 to 20 letters; Slack keeps/for its own commands) it is an outgoing message, refused with an ephemeral explanation while the conversation is marked spam (a note stays allowed).client_idslack:<channel>:<ts>makes a retried job idempotent. An unlinked user, a member without access to the inbox (or a deleted conversation) and any other refusal get an ephemeral explanation and nothing is written; so does a member covered by the workspace’ssso_required(#181), since a Slack reply never comes through the identity provider. The text is Slack’s mrkdwn turned into plain text (links aslabel (url), entities decoded); it is the member’s own text, not instructions to anything. - Member links.
POST /v1/me/slack/link(member session, 5 an hour per member, DB-backed limit checked before any transaction) finds the Slack user by the member’s address (or a given one) withusers.lookupByEmailand DMs a 6-digit code;POST /v1/me/slack/link/confirmlinks it.GET/DELETE /v1/me/slack. - Access.
GET /v1/slack,GET /v1/slack/channelsandGET /v1/inboxes/{id}/slackneedinboxes:readfor keys and tokens;PUT /v1/inboxes/{id}/slackowners and admins orinboxes:manage(a channel must be one the bot is in); connect, change, disconnect and the/v1/me/slackendpoints need a member session. No new realtime or webhook events: notes and replies from Slack emitmessage.createdas any other.
Satisfaction ratings
An inbox can ask contacts to rate their conversations (ask_for_rating, off by default). A
contact rates a closed conversation good or bad, with an optional comment of at most 2,000
characters, once per close: a message from the contact reopens it and the next close allows a new
rating. A close can be rated for 30 days, and only a close after the inbox started asking
(inboxes.rating_since, set when ask_for_rating turns on and cleared when it turns off), so
turning it on never offers old conversations. Ratings are not stored for spam.
- Conversations keep
closed_at(set when the status becomesclosed) and the latest rating (rating,rating_comment,rated_at); a rating counts for the current close whenrated_atis not beforeclosed_at. The rating is also aratedevent message in the thread, authored by the contact, with the comment as its body; contacts never see event messages. - Widget and SDKs:
ask_for_ratingon the inbox’s public settings,can_rateandratingon eachClientConversation(and on the realtime status frame when a conversation closes), andPOST /client/v1/conversations/{id}/rating. - Members see it on the conversation (
rating,closed_at) and in the thread;conversation.ratedgoes to webhooks;/v1/statscounts ratings given in its window, in total and per inbox. - E-mail contacts: two minutes after a member or API key closes an e-mail conversation (time to
undo), a River job checks that it is still closed and unrated, a member or bot replied in it and
the address is deliverable, then sends one automatic reply in the thread (
Auto-Submitted, in the contact’s language, else the inbox’s) with two links,/r/{token}?rating=good|bad, once per close. The token seals the workspace, the conversation and the close time under the master key, so nothing is stored for it and a later close makes it invalid; the request is a message in the thread, so members can see the links. /r/{token}is a page the server renders itself: no scripts or external assets, the inbox’s name and branding colour, English, Turkish or German by the inbox’s language. Opening it stores nothing, since mail scanners open links: it shows the chosen rating preselected and a comment field, and only its POST rates. A POST for a close that is already rated stores nothing and answers the same page with “already rated” (200, since it is a browser form); the client API answers409 already_rated.
Documentation pages
Products keep their documentation on their own sites (Nuxt Content, Fumadocs, Starlight,
VitePress, plain HTML). Yuva adds two elements to those pages and stores nothing of the
documentation itself. Both use an existing chat channel: its public key, its origins and its
rate limits, so a docs site is set up like a site with the chat widget, and the same channel may
serve both.
- A page is the page’s URL without query and fragment, and its origin must be one of the
channel’s origins (
400 page_originotherwise). The title is what the page sent last. The elements follow the URL themselves, since documentation sites navigate without reloading; apageattribute overrides it. - Page ratings.
<yuva-page-feedback>asks whether the page helped:upordown. A rating alone creates no contact and no conversation:POST /client/v1/channels/{key}/page-ratingsneeds no session and adds one to a per-page, per-day counter (page_ratings: workspace, inbox, channel, page, title, day, up, down). Nothing about the visitor is stored; the element remembers the visitor’s rating in the browser and a changed mind moves the count (one off the latest day that has it), and the endpoint is rate limited per IP address and channel like session starts. - Page feedback. After a rating the element offers a text field and, optionally, an e-mail
address. Sending it is
POST /client/v1/feedbackfrom a visitor session on the chat channel, afeedbackconversation like the app’s, withpage_url,page_titleandratingin its feedback metadata and categoryotherunless the visitor picked one. It is answered like any feedback; replies reach the visitor by e-mail when they allowed it. - Page questions (M11, replaced by discussions). Until M12 a visitor could ask a private
question from a page (a conversation of kind
question) and members published an edited question and answer back to the page (page_answers). Migration 00029 turned every published answer into a discussion and everyquestionconversation into an ordinaryconversation; conversations keeppage_urlandpage_titleas columns (page feedback uses them too) and show them aspageon the conversation, so the panel still filters and counts conversations per page. - Sites. A site is the origin of page URLs, per inbox: one product’s documentation.
GET /v1/docs/siteslists every origin that has pages in the window (asGET /v1/docs/pagescounts them) and every origin allowed on a chat channel of the visible inboxes, with zeros for a site added but not yet used, named by the chat channel that allows it, with its page count and summed counts.site=<origin>narrowsGET /v1/docs/pages,/v1/docs/summary,/v1/docs/page,GET /v1/discussionsandGET /v1/conversationsto one site. - Panel. A Docs view is per site: it starts from the sites list and lists pages of the inboxes
the member can see with their up and down counts over a window (7, 30 or 90 days), the share of
down, open feedback and the page’s discussion counts now: open threads (published, no accepted answer, not locked), unanswered threads (open and nobody replied) and pending posts (GET /v1/docs/pages), sorted by mostdown(default), mostup, most helpful (share ofup, first among pages with at least 5 ratings in the window, so a singleupnever leads) or most activity (ratings plus open feedback, open threads and pending posts). The list is an aggregate, so its cursor is a position within one sort and window. Above it, totals over the window and a zero-filled series per day of ratings, page feedback and new threads (GET /v1/docs/summary) feed the charts. A site picker at the top of the Docs column (all sites, or each site by its channel name and host, fromGET /v1/docs/sites) passessite=to the list, the summary and the page; changing it while a page is open goes back to the overview. A page shows its ratings per day (GET /v1/docs/page), its feedback (GET /v1/conversations?page=) and its threads (GET /v1/discussions?page=). - Ratings are counters, so they send no events or webhooks; page feedback is a conversation and sends the same ones as any conversation and feedback.
Discussions (M12)
Discussions replace page questions and published answers. A documentation page gets a public
discussion area like GitHub Discussions: threads, replies, votes, an accepted answer, followers.
Private help stays private: page feedback, live chat and e-mail are unchanged. A kind separates page
threads (page) from roadmap ideas (idea, M21); page queries and counts see page threads only. Decisions:
- Model. Discussions are not conversations: a conversation is one contact and the team,
private; a discussion is public and has many authors.
discussions(workspace, inbox, channel, page, page title, title, opening post, state,locked_at,answer_post_id,answered_at, votes, reply count, pending and hidden counts, source conversation, last activity) anddiscussion_posts(discussion, author, body as Markdown,opening,parent_post_id, statepublished|pending|hidden, votes, edited and deleted times), plusdiscussion_votesanddiscussion_follows. The thread’s body, author and votes are those of its opening post, a post like the replies, so editing, deleting, voting and moderating work the same for both;discussions.statefollows the opening post’s state and is changed with it in one transaction. Replies are one level deep: a reply to the thread has no parent, a reply to a reply points at it, and a reply to a reply to a reply is refused. The accepted answer is a published reply to the thread. Stateopen|answered|locked|hiddenfrom the plan is split intostate(published|pending|hidden),answer_post_idandlocked_at, since a thread can be answered and locked at once. Every table hasworkspace_id; every query filters by it. - Authors. A post’s author is a member or a contact (
author_typemember|contact|anonymous, with the ids nulled on delete: a removed member or a deleted reader shows as deleted, like deleted members in conversations). The public sees a display name and initials only: a member’s name, a reader’s person name (live, so renaming the account renames their posts), else the contact’s name; no e-mail addresses, ids or avatars from elsewhere.anonymousis used only for threads migrated from published answers, whose visitor was never named. - Bodies are stored as Markdown and served with
body_html, rendered on the server by goldmark (no raw HTML, GitHub-flavoured tables, strikethrough and autolinks) and sanitized with bluemonday’s UGC policy (rel="nofollow noreferrer",target="_blank"withnoopeneron links to other sites), so every client can show it without a Markdown library. Titles 3 to 200 characters, bodies up to 20,000. - Migration. Each
page_answersrow became a published discussion on its page, inbox and channel: the question as ananonymousopening post, the answer as an accepted reply by the publishing member (anonymousonce that member is gone),conversation_idkept. Everyquestionconversation becameconversation, keeping its page columns (see “Documentation pages”).kind=question,/v1/conversations/{id}/publish,/v1/page-answers*,/client/v1/questionsand/client/v1/channels/{key}/page-answersare removed from the contract andpage_answersis dropped; this is pre-1.0 and they shipped in M11. - Readers. A reader is a person with a server-wide account (
people, the table members sign in with): one account per Yuva server, signing in by e-mail code or passkey on the server’s own page, never on the documentation site.POST /v1/auth/codewithreader: truesends a code to any address (same rate limits; the code row records it) and verifying that code creates the person, whateverYUVA_SIGNUPsays; a member signing in there is the same person. The reader’s account page and its popup are panel routes (/account,/account/connect) served like the OAuth consent page, with the person’s session cookie. - Reader tokens.
<yuva-discussions>opens/account/connect?channel=<key>&origin=<origin>in a popup. Once signed in, the page callsPOST /v1/account/reader-tokenswith the key and the origin; the server refuses an origin that is not exactly one of the channel’s allowed origins (403 origin_not_allowed) or a channel with discussions off, and the page posts the token towindow.openerwith that origin astargetOrigin, so no other page can receive it. A token (yuva_rd_…, stored as a hash inreader_tokenswith the workspace, channel, person and the session that made it) lives 24 hours, is bound to its channel (its origin check is the channel’s, like a contact session), and ends with that session (sign-out), with the account, or withDELETE /client/v1/reader-token. When it expires the element opens the popup again, which answers at once while the person is still signed in on the server. - Readers in a workspace. A reader token acts in its channel’s workspace as the contact linked to
the person (
contacts.person_id, unique per workspace), created on the first write: a contact of the workspace with the person’s e-mail address and no person is linked, else a new contact is made with that address and the person’s name. So the team sees the name and e-mail address of readers who write in their workspace, and the connect page says so; other workspaces see nothing of it. A person who is a member of that workspace with access to the inbox writes as that member instead. Host apps with their own login keep using identity tokens: a contact session started with an identity token writes as its contact; anonymous visitor sessions only read. - Reading is public and needs no session:
GET /client/v1/channels/{key}/discussions?page=and…/discussions/{id}, cacheable for a minute, authors shown by display name and initials only. A reader token or contact session of that channel adds the caller’s own pending posts and themine,votedandfollowingflags, and the answer is thenprivate, no-store. Threads are listed per inbox and page, so two chat channels of one inbox that allow the same origin show the same threads; the channel decides whether discussions are on. - Writing needs a reader token, an identity-token contact session or a member (
/v1). Per chat channeldiscussions: off|moderated|open(defaultmoderated). Moderated: a reader’s post waits (pending) until one of their posts in the workspace has been approved, after which they publish at once; identity-token users and members publish at once. Open: everyone publishes at once. Marking a post spam hides it and the author’s other pending posts and setscontacts.discussions_blocked_at, after which the author’s posts always wait. Pending posts are seen only by their author and members, hidden ones only by members. Authors edit their posts for 30 minutes (members their own without limit) and delete them at any time: a post with replies stays as deleted without body or author, the thread goes when nobody else wrote in it. A locked thread takes nothing from readers (posts, edits, votes, answers); members still may. The thread’s author or a member accepts an answer. Rate limits: 10 posts a minute and 60 an hour per author, and the client write limits per IP address and channel. - Team.
/v1/discussionslists threads per inbox, site, page and state;/v1/discussion-postswithstate=pendingis the moderation queue. Members approve or hide posts (PATCH), mark spam, lock and retitle threads, reply, vote, accept and clear answers, and start threads. Reading needsconversations:read(keys and tokens too); writing needs a member session. Agents see the threads of their inboxes only; another inbox or workspace answers404. - From a conversation.
POST /v1/conversations/{id}/discussionstarts a published thread with the title and body the member writes (and optionally an accepted answer by the member); nothing of the conversation becomes public. Its contact is the author only when it is linked to a person or has an external id in the inbox (they are a known user and can see and edit the thread); otherwise the member is. One thread per conversation. - Notifications. Followers are contacts (members see threads in the panel). An author follows
their thread and any thread they reply to. A published reply (on creation or on approval) and an
accepted answer add a
reader_notificationsrow for every follower linked to a person (except the author) and queue a River job per follower and thread, unique by its arguments forYUVA_DISCUSSION_EMAIL_DELAY(10 minutes by default). The job sends at most one e-mail per follower and thread per delay, listing the replies and the answer since the last e-mail, through the server’s own mailer in the person’s locale (else the contact’s, else the inbox’s), to the person’s address when they keptemail_notificationson, or to an identity-token contact’s first address. Each e-mail carriesList-UnsubscribewithList-Unsubscribe-Post: List-Unsubscribe=One-Click(RFC 8058) pointing at/u/{token}: the token seals the workspace, thread and contact under the master key like rating links; opening the page changes nothing and its button (or the one-click POST) unfollows. Reader notifications are kept 90 days. - Events.
discussion.created,discussion.post_created,discussion.answeredanddiscussion.updated(moderation, edits, deletes, lock, a cleared answer) are stored events for members who can see the inbox and webhook types under Standard Webhooks like the others, with{discussion, post}as data. Pending posts send them too, with their state. - Reader account.
/accounton the server, inweb/, separate from the team panel: my discussions, followed threads, notifications, e-mail settings, delete account (/v1/account*,DELETE /v1/me). A person who is also a member reaches the team panel from it. - Docs counts.
/v1/docs/pagesand/v1/docs/sitescount open threads, unanswered threads and pending posts per page instead of open questions and published answers;/v1/docs/summarycounts new threads per day and pending posts now. - UI for sites.
<yuva-discussions>(web component, Shadow DOM, in/yuva-docs.jsanduseyuva/docs, replacing<yuva-page-questions>; Nuxt and React wrappers as today) and a shadcn registry for React sites that want the code in their own design system: components built on shadcn/ui primitives and the headlessuseyuvaclient, sources insdk/shadcn/(MIT), served as registry JSON by the site sonpx shadcn add <site>/r/discussions.jsoninstalls them.
Broadcasts and e-mail designs (M13)
A workspace sends e-mail to many contacts at once: newsletters, product updates, announcements. Every broadcast is sent on behalf of an inbox through one of its e-mail channels, and a reply becomes a conversation in that inbox. Plan in issue #25; it ships in steps M13.1–M13.7 in the roadmap. Decisions:
-
Lists.
mailing_listsbelong to an inbox: name, public description,double_opt_in(on by default),public(offered on forms and the preference page),commercial(marketing content, for the consent export),welcome(a receipt after subscribing) and the e-mail channel that sends its confirmation and welcome mail. Owners and admins manage lists; agents read the lists of their inboxes.mailing_lists.kindislist, orstatusfor the subscriber list a status page makes (M19); a status list is not offered, audience-selectable or importable and sits outside the opt-out register. -
Subscriptions and consent.
list_subscriptions(list, contact, address,pending|subscribed| unsubscribed, sourceform|identity|api|member|import|preferences) and an append-onlyconsent_eventslog (what happened, when, IP, user agent, page, the label the person saw, the member, key or import). Consent is never assumed: API calls and imports declare it (an import needs the importer’s attestation and where people agreed, stored with every row). Only the person moves anunsubscribedsubscription back, through a confirmation. Unsubscribing from all of an inbox’s lists, a complaint and deleting a contact who had objected leave anemail_optoutsrow (a keyed HMAC of the address, nothing else) that the API and imports respect. Pending subscriptions go after 30 days (one that was unsubscribed before and asked again returns tounsubscribed, so the objection stays); unsubscribed ones and their events after 3 years, leaving an opt-out. -
Signing up.
<yuva-subscribe>(/yuva-subscribe.js,useyuva/subscribe, React and Nuxt wrappers, shadcn registry items) on an existing chat channel’s key and origins; anonymous forms post toPOST /client/v1/channels/{key}/subscriptionswith a sealed form token, a honeypot and per-IP, per-channel and per-address limits, and get the same answer for every address. Identity-token sessions subscribe at once when the contact has a known address (verified by the token, or given by a member or an e-mail conversation), else through a confirmation, as does a subscription the person left before (PUT /client/v1/subscriptions/{list}). Double opt-in mails a link to/s/{token}, a server-rendered page like/r/{token}whose button confirms (opening it changes nothing). Host backends use/v1/lists/{id}/subscriptions; the panel imports CSV files (below). -
Importing. A CSV upload (
/v1/lists/{id}/imports, at most 20 MiB andYUVA_IMPORT_MAX_ROWSrows, default and maximum 100,000, one running import per workspace) needs the importer’s attestation and where people agreed, both stored on every consent event with the import’s id. The file goes to object storage and is first validated without writing anything: the encoding (UTF-8 with or without BOM, UTF-16 with BOM, else Windows-1254 when the bytes include a letter only Turkish uses there, else Windows-1252), the delimiter (,,;or tab) from the header row, a guessed column mapping and the counts a member confirms. It refuses invalid addresses, domains that take no mail (no MX or a null MX), role addresses, duplicates and every opted-out, unsubscribed or suppressed address. Importing writes 1,000 rows per transaction and snoozes every ~30 s; progress reaches/v1/realtimeonly (list_import.progressat most once a second,list_import.updatedon each state change), never as stored events, webhooks or asubscription.*event per row. Imports send no welcome mail; in re-confirm mode every row becomespendingand gets a confirmation, spread over the days by the workspace’s daily broadcast limit. The upload is deleted when the import ends, refused rows stay 7 days for the error CSV, and an import never started is cancelled after 7 days. -
Unsubscribing. Every broadcast and welcome mail carries
List-UnsubscribewithList-Unsubscribe-Post: List-Unsubscribe=One-Click(RFC 8058) and footer links to/m/{token}: a page with “unsubscribe from this list”, the inbox’s public lists and “unsubscribe from everything”; opening it changes nothing, its one-click POST unsubscribes at once./m/of a status list shows only that list (unsubscribe, its component choices, a link back to the page). Tokens seal the workspace, list, contact and broadcast under the master key and never expire while the contact exists. -
Designs. A design is a JSON document (
EmailDesignDocumentin the contract,schema: 1with upgrade steps on read) of blocks (section, columns, heading, text, image, button, divider, spacer, social, footer) and a theme (colours with dark overrides, a fixed font stack, width, radius, direction). Rich text is a stored subset of HTML checked by a bluemonday policy on every write; there is no raw-HTML block and no remote image.api/internal/mail/designrenders it to table HTML with inline styles (hybrid columns, dark-mode classes, Outlook wrappers, a preheader) and a text part; a document may carry versions in other languages (translations, below); it shares its colour and button code with the server’s ownlayout.html. Merge fields{{ contact.first_name | "there" }}are checked on save, and a broadcast is not scheduled while a field without fallback would be empty for anyone. A required footer (the inbox’s legal name, postal address, registration and contact, why the person gets the mail, unsubscribe and preference links) is always added.email_designskeep a version for concurrent edits and up to 50 snapshots. -
Languages (M13.9). A design document may name its base language (
locale), afallback_localeand up to 100translations, each with block texts by block id (headingtext, text and footerhtml, buttonlabel, imagealt), its preheader and optionally its writing direction; the document may then be 1 MiB (300 KiB withouttranslations). Layout, theme, images and block links are shared; links inside a translated text are that text’s. A block without a translation shows the base text (warningtranslation_missing, never a blocker).schemastays 1; an update whose document lackstranslationskeeps the stored ones, so older clients cannot erase them ({}removes them). A document with alocaleand no translations is single-language. A broadcast keeps subject and preheader per version (translations; a version without its own takes the broadcast’s, the preheader the design version’s first). When the audience is taken each contact gets one version, stored on the delivery (locale): their exact tag, else a shorter tag by RFC 4647 lookup (es-MX→es), else the same language in another region (es→es-MX,pt-PT→pt-BR), else the fallback; contacts without a locale get the fallback. The required footer is in the version’s language when the server has its words (en, tr, de), else English, with a warning (footer_language). The review checks every version (size, merge fields, alt texts, links) and warns about missing texts and subjects. Gallery templates share block ids across languages, so one template becomes one design with several versions (template.locales). What’s new broadcasts stay single-language. -
Designs in conversations (M13.10). A design with exactly one
messageblock (top level or in a section, never in columns; no text, no translation entry) can be offered in conversations (email_designs.for_conversations, set by owners and admins). An e-mailed outgoing message (a reply, the first message afterstart_conversation, new mail with onetoand nocc) may name one (design_id, optionaldesign_locale): the contact’s version, chosen as for broadcasts, is rendered when the message is handed to the outbox, with the body escaped into themessageblock followed by the help cards and the signature, and stored onmessage_emails(full_html,full_text,design_id,design_version,design_locale); the send job sends those parts unchanged. The text part is the whole mail as text, so both alternative parts carry the same content;messages.bodystays what was written and is all the panel thread, widget, events and webhooks show. Merge fields are the contact’s;list.name,unsubscribe_urlandpreferences_urlare refused, and a field without fallback that is empty refuses the message. Headers, recipients, threading, the SMTP account (the channel’s support account) and the provider’s DKIM are a reply’s. The footer has three modes:list(broadcasts),reply(the contact has written in the conversation: the identity line only) andoutreach(the contact has not: the identity line, an unsubscribe link andList-Unsubscribewith one-click, whose POST writesinbox_mail_optoutsfor the inbox and contact). Outreach with a design is refused for an address with a suppression of either scope or an opt-out (409 email_opted_out), limited to 20 per member or key an hour and 200 per workspace a UTC day, and needs approved broadcasts on a server inapprovalmode; replies with a design have no extra gate. Members who see the design’s inbox, and keys withconversations:read, list, read and preview offered designs (POST /v1/conversations/{id}/design-preview); editing stays with owners, admins andbroadcasts:write. A broadcast’s review blocks a design with amessageblock. Designs never go into notes, chat or app conversations, continuity mail, forwards, rule replies, greetings or rating requests. -
Images are uploaded (PNG, JPEG, GIF, WebP; never SVG), re-encoded without metadata at most 1,200 px wide (WebP stored as PNG or JPEG) and served publicly at
/i/{token}with immutable caching and nothing recorded per request: the one exception to “objects are never public”. What’s new entries (M22) keep their images too: the weekly cleanup skips images an entry or its draft refers to. -
Broadcasts. A draft names the inbox, the e-mail channel, lists (up to 10) with attribute and language conditions, the design, subject and preheader. Scheduling runs a review (sender identity, sender ready, approval, merge fields, HTML under Gmail’s clipping size, deliverability) and freezes the design. At send time
broadcast_startsnapshots the audience intobroadcast_deliveries(one per contact; suppressed, opted-out and unsubscribed addresses left out) andbroadcast_send, one job per sender channel on its own River queue (YUVA_BROADCAST_WORKERS, default 2), sends in batches over one SMTP connection at the channel’s pace, re-checking each address, so pause and cancel act within a batch. The channel’sbroadcast_smtp_*account is used when set, else its support account; confirmation, welcome, test and broadcast mail never use the server’s ownYUVA_SMTP_*. Test sends go to members only.YUVA_BROADCAST_DAILY_RECIPIENTS(0 = no limit) caps recipients per workspace and UTC day; a send that reaches it continues the next day. Implementation: each recipient’s mail is rendered from the frozen document with their merge values when it goes out (no stored HTML template). A batch is 50 mails or 5 seconds, whichever ends first, and the broadcast’s state is read again before every mail; the send job marks a broadcastsentitself once nothing is queued (there is no separate finish job), and a sweep every 5 minutes queues the job of any broadcast that should be moving. Recipients are checked again before their mail (still subscribed, not suppressed, not opted out) and skipped with the reason otherwise. Temporary SMTP failures are retried after 5 minutes, 30 minutes, 2 hours and 6 hours, then the delivery fails;5.1.xand5.2.1refusals are bounces; 20 refusals in a row, a refused account or TLS, or a server unreachable for 30 minutes pause the broadcast (sender_error, the SMTP answer instate_detail). Test sends: 20 mails an hour per workspace; their unsubscribe link names no list and its page says it was a test. Progress reaches/v1/realtimeasbroadcast.progress(counts, not stored, at most every 5 seconds). -
Pace. A broadcast may have its own pace (
pace:per_hour,per_day,per_month, each optional, 1 to 10,000,000), set when it is created, on a draft, and alone while it is scheduled, preparing, sending or paused (409 invalid_stateonce finished); a change applies to the next mail. Windows are rolling (any 60 minutes, 24 hours, 30 days) and the sender spaces mails evenly at the tightest gap (3,600 /per_hour, 86,400 /per_day, 2,592,000 /per_monthseconds), which keeps every window within its limit without bursts. With sending hours (below) a day is that day’s window:per_daycounts per window andper_monthspreads over 30 windows (gaps of window length /per_dayand 30 × window length /per_month);per_houris unchanged. The channel’sbroadcast_rateand the workspace’s daily limit stay upper bounds: the pace only slows sending. Before each mail of a paced broadcast the sender claims the slot with one conditional update ofbroadcasts.pace_next_at(taken when<= now, then set tonow + gapfrom the row’s current pace and the day length the sender passes: 86,400 seconds, or that day’s window), so two pods or a rescued job never send two mails in one slot; every SMTP attempt takes a slot, skipped recipients none. A wait longer than a batch ends the batch and snoozes the channel’s job until the slot, at most 5 minutes, so other broadcasts of the channel keep sending and a changed pace applies within 5 minutes. Pausing keeps the next slot (no catch-up burst on resume); changing the pace moves it to the last mail plus the new gap.pace_next_atis shown while sending with a gap of at least a minute;waiting_untilstays the daily limit’s. A send may take at most 365 days at its pace: the review’spaceitem blocks above that andPATCHrefuses such a pace on a started broadcast (409 pace_too_slow); the review’sduration_secondsestimates the whole send from the pace, the channel’s rate and the daily limit. -
Sending hours (M13.8). Every broadcast has an IANA
timezone, set from its inbox’s when it is created (the setup wizard takes the inbox’s from the creator’s browser) and changeable; offsets are never stored. An optionalsend_window(start–end, local wall-clock,endbeforestartcrosses midnight, at least 30 minutes; stored as minutes insend_window_start/_end) lets mail go out only inside the window each day, continuing the next day. The window keeps its local times when clocks change. One rule resolves local times in Go and the panel: a time the clocks skip moves forward by the jump, a time that happens twice is the first occurrence (a window’s close the second).POST /scheduletakessend_at_localin the broadcast’s zone as well assend_at; the resolved instant is stored, so later tzdata changes do not move it. The window is a gate: the audience is still taken atscheduled_at; the sender skips a broadcast whose window is closed (the channel’s job snoozes at most 5 minutes, so other broadcasts of the channel keep sending and changes apply within 5 minutes) and re-checks the window before every mail.window_opens_atis computed on read; nothing is stored for the wait. The workspace’s daily limit stays per UTC day, independent of the window. Zone, window and pace can change while scheduled, sending or paused. There is one zone per broadcast, not one per recipient: contacts have no time zone, and their language does not tell one. The server embeds the time zone database (time/tzdata), so every pod uses the same rules. -
Triggered e-mails (M40). A broadcast of
kindtriggeredsends its design once to each contact of its inbox,delay_minutes(0 to 365 days) after a trigger:contact_identified(the contact’s first external id in the inbox, from an identity token,/v1/contactsor a form that carries one), and from M40.3subscribed(a list subscription confirmed; a subscription an import created never triggers, not even when it is confirmed later) andattribute_changed(a write through an identity token,/v1/contactsor a subscription that creates its contact makes a contact newly match a condition; only for inboxes the contact belongs to, by an external id, a conversation or a subscribed list there, or the write came through; no back-fill). Lifecycledraft→scheduled→active⇄paused→cancelled(Stopped), neversent; pausing stops sending, not enrolling. The trigger’s transaction insertstriggered_enrollments (workspace, broadcast, contact, triggered_at, state waiting|queued|skipped|cancelled), whose primary key is the once-per-contact rule for as long as both exist, and queuestriggered_dueat the due time (unique per broadcast in every state including running, so a busy job snoozes up to 5 minutes; the 5-minute broadcast sweep re-queues it). The broadcast’s enrollment counts are brought up to date by that job, within 5 minutes, not in the trigger’s transaction, so triggers never lock the broadcast row.triggered_duetakes due enrollments 500 at a time, decides each once (blocked, no address, more than 7 days late for a live trigger, suppressed, opted out, stopped, not subscribed, not matching the audience conditions and locales) and creates thebroadcast_deliveriesrow the channel’sbroadcast_sendsends, triggered e-mails before one-off broadcasts, under the pace, sending hours, daily limit, warm-up and automatic pauses of broadcasts. Only triggers while it is active or paused enroll; starting may back-fill contacts triggered in the last 0 to 30 days, counted in the review, each due at the later of its trigger plus the delay and the start, never skipped as late; imports, help-desk migrations and merges never trigger, and/v1/contactswrites withskip_triggersdo not. The consent basis is explicit and fixed after the draft:marketingmails only contacts subscribed to its lists, with the broadcast footer and one-click from the list;service(mail about using the product) mails every matching contact, needsconfirm_servicewhen started (stored and audited), and has a footer saying the person uses the inbox’s product, the postal address and a one-click unsubscribe that writesinbox_mail_optouts, which stops the inbox’s service triggered e-mails and designed outreach. Both respect suppressions of either scope and opt-outs; complaints count as about a broadcast. Design, subjects and preheaders per language, merge fields, review, test sends, replies, click tracking and the per-language report are a broadcast’s; the report adds enrolled, waiting and skips by reason. Changeable while active: pace, zone, sending hours, delay; while paused also the content and audience conditions (resume reviews and freezes again); never the trigger, basis, lists, inbox or channel. At most 20 live per inbox.GET /v1/broadcasts/{id}/enrollments(broadcasts:readandcontacts:read, as deliveries) lists who waits and why others were skipped;DELETE …/enrollments/{contactId}drops one waiting contact. No event or webhook per enrollment. A merge field without fallback is a review warning, not a block, since the contacts are not known when it starts. Resume does not repeat the approval check in the review; the send gate enforces it. Starting one notestriggered_startedfor the operator. Counters survive delivery retention: a recount never lowers what retention purged. -
Amazon SES tenants. On a shared SES account one inbox’s bounces and complaints pause only its own SES tenant, never another inbox of the workspace or another workspace (M13.7). One tenant per inbox, not per workspace, because inboxes are where a workspace keeps its products. With
YUVA_SES_REGION,YUVA_SES_ACCESS_KEY_ID,YUVA_SES_SECRET_ACCESS_KEYandYUVA_SES_CONFIGURATION_SET(all or none; an IAM user limited to tenants namedYUVA_SES_TENANT_PREFIX, defaultyuva-, identity associations and that configuration set) the server manages the tenants; customers never enter AWS keys. A channel’s SMTP account is managed when its host is an SES endpoint in that region and its user name is an access key of the server’s own AWS account (sts:GetAccessKeyInfo), since customers with their own SES use the same hosts. Ases_tenant_syncjob per inbox (on saving or deleting such a channel, onbroadcasts approvefor every inbox of the workspace, and fromyuva inbox ses-tenant sync [--all], the back-fill; never at boot) creates the inbox’s tenant (ses_tenants, keyed onworkspace_idandinbox_id) with a random name, tags and tenant-level suppression (bounces and complaints stay inside the tenant), associates the configuration set and, per channel, the sending address’s identity and the most specific verified domain identity, and dissociates identities none of the inbox’s channels uses any more (never the configuration set, never a tenant Yuva did not create). A domain shared by two inboxes is associated with both tenants. Support mail is isolated from the first managed channel, not only after approval. Every tenant keeps SES’s Standard reputation policy. The configuration set is one, created by the operator with its SNS bounce and complaint destination; Yuva never sets an identity’s default configuration set. A channel whose sending domain is not a verified identity isidentity_missing: its mail goes out without the tenant (a header without the association would fail the send) and the review blocks its broadcasts. Mail through the managed account always carries the configuration set; the tenant header only once the tenant is ready. Apendingtenant (after a channel save) holds a running broadcast’s batch for 15 seconds instead of pausing it. A ready tenant absent from a complete listing and confirmed gone byGetTenantismissing: it blocks broadcasts, loses the header and a sync creates it again. Tenant names, the configuration set and AWS details reach owners, admins and keys withinboxes:manageonly. Once isolated, a managed channel’s mail always carries the tenant, also while it is paused. Without server keys a channel may name a tenant (and configuration set) of its own SES account, which Yuva only writes as headers. A periodic job every 5 minutes readsListReputationEntitiesunder the prefix (aggregate and both origins); optionally, an EventBridge rule on SES’s tenant events sent to an SNS topic inYUVA_SES_TOPIC_ARNSmakes/ingress/sesrefresh that tenant at once (its body is not trusted for the status). A paused tenant pauses that inbox’s running broadcasts through managed channels (pause_reason: ses_tenant), blocks their scheduling and resuming (409 ses_tenant_blocked), shows on the inbox (Inbox.ses_tenant), its channel pages and in the operator digest; the inbox’s replies are still attempted and fail with SES’s answer; other inboxes keep sending. Only the operator reinstates (yuva inbox ses-tenant reinstate, customer-managed statusREINSTATED); a pause by SES itself needs an AWS Support case. Deleting an inbox or a workspace deletes its tenants. An SES notification taggedses:tenant-nameof a managed tenant counts only for that tenant’s workspace and inbox. The status poll (ListSESTenantsAll), the event lookup (FindSESTenantByARN) and the operator back-fill (ListInboxesWithSESChannels) read across workspaces (SES names only the tenant), and every write that follows is scoped to the row’sworkspace_id: the written exception to the workspace filter. The AWS calls are a small client on minio-go’s SigV4 signer (already a dependency), using only operations without path parameters except the reinstate call.yuva inbox ses-tenant show --workspace <id|name> [--inbox <id|slug>] yuva inbox ses-tenant sync (--workspace <id|name> [--inbox <id|slug>] | --all) [--dry-run] yuva inbox ses-tenant reinstate --workspace <id|name> --inbox <id|slug> -
Headers.
Message-ID<delivery token.random@sending domain>(the conversation shape, so loop protection is unchanged),List-Unsubscribe,List-Unsubscribe-Post,List-Id,Feedback-ID(broadcast:list:workspace:yuvabroadcast),X-Auto-Response-Suppress: OOF, AutoReply; noAuto-Submitted. Mail through an SES account also carriesX-SES-TENANTand, when set,X-SES-CONFIGURATION-SET(Amazon SES tenants). -
Bounces and complaints. SES (SNS), delivery reports to the channel, SMTP 5xx at send time and ARF feedback reports find the delivery by Message-ID. A hard bounce suppresses the address for all mail; a complaint about a broadcast suppresses broadcasts only, unsubscribes every list of the workspace and writes an opt-out. A broadcast pauses itself at 5% bounces (after 200) or 0.3% complaints (after 1,000), counted since it started or was last resumed; a workspace whose 30-day complaint rate reaches 0.3% (over at least 1,000 mails) or bounce rate 8% (over at least 2,000) is suspended from sending and its running broadcasts pause. ARF reports count only from a sender whose trusted DMARC result is
pass. -
Deliverability. A check (six an hour per channel) sends a probe through the broadcast account to the channel’s own address; ingress knows it by its token (in the Message-ID or
X-Yuva-Probe), never makes it a conversation, and reads only the trustedAuthentication-Results(SPF, each DKIM signature with its domain and alignment, DMARC, whether the aligned signature’sh=coversList-UnsubscribeandList-Unsubscribe-Post) plus DNS (SPF, DMARC policy, MX of the reply domain, the Yuva DKIM record). Each channel keeps its latest result; a probe not back after 10 minutes reads astimeout, and the panel polls. The review warns when the channel was never checked, the check did not finish or cannot be verified, DMARC is missing, DKIM is not aligned withFromor the list headers are unsigned, and blocks when no DKIM signature passed. A channel may have its own DKIM key (RSA 2048, private key sealed under the master key, only the DNS record shown; enabling needs that record in DNS, a new sending domain turns it off, deleting allows a new key). Yuva then signs broadcasts, tests, probes, confirmation and welcome mail over the list headers; support replies keep their provider’s signature. The signature coversFrom,To,Subject,Reply-To,MIME-Version,Content-Typeand the list headers (absent ones listed too) but notMessage-ID,Feedback-IDorDate, which relays replace, and address headers are written in the minimal form normalizing relays leave alone (a display name quoted only when RFC 5322 needs it, a bare address without angle brackets). Amazon SES channels never get Yuva DKIM (enabling it is refused, an older enabled key is not used): SES rewritesFrom,To,Reply-ToandDateafter any signature added before it and signs every mail with the customer’s domain itself (Easy DKIM), list headers included. -
Replies. A reply to a broadcast finds its delivery by the token in
In-Reply-To/References(or by the relay’s Message-ID stored for the delivery) and opens (or continues) a conversation with that contact in the inbox withbroadcast_idand abroadcast_replymarker; someone else’s reply opens their own conversation; automatic replies are only counted (when they name no conversation). Notifications about replies to one broadcast are grouped per member every 10 minutes (one push “N new replies”; no e-mail fallback for them). -
Measuring. Per broadcast: recipients, sent, failed, bounced, complained, unsubscribed, replied, automatic replies, skipped by reason, and unique clicks only when the broadcast turns click tracking on (links go through
/c/{token}). There is no open pixel. Tracked links are the web links of the HTML part that are the same for every recipient (no merge field), found when the broadcast is scheduled; aHEADrequest and a third link of one mail opened within 2 seconds are not counted. A broadcast whose design has versions also reports per version (locales, and the whole report filtered with?locale=), counted from the deliveries and kept as long as they are (400 days). Tracked links are found per version (broadcast_links.locale,''for a design without versions, so broadcasts scheduled before M13.9 keep resolving); click tokens are unchanged and resolve through the delivery’s version; the whole report lists each URL once with the recipients who opened it in any version. -
Hosted servers.
YUVA_BROADCASTS=on|approval|off(unset:approvalwithYUVA_SIGNUP=open, elseon). Inapprovalmode a workspace asks the operator, who answers withyuva workspace broadcasts approve|deny|suspend|limit|show; approved workspaces warm up from 500 recipients a day, doubling after each clean day (at least 100 sent, bounces under 3%, complaints under 0.1%) and losing a doubling after a bad one. Only the operator lifts a suspension (approve). The operator digest reports approval requests, suspensions and auto-pauses without content.YUVA_BROADCASTS=offrefuses broadcast writes (403 broadcasts_disabled); lists and their forms keep working.YUVA_MAIL_LINK_URLputs/m/,/s/,/c/and/i/on a separate domain, which answers only those routes.yuva workspace broadcasts approve|deny|suspend --workspace <id|name> [--reason <text>] yuva workspace broadcasts limit --workspace <id|name> --daily <n> # 0 removes the limit yuva workspace broadcasts show --workspace <id|name> # status, limits, 30-day rates, last 10 -
Scopes, events, MCP. Scopes
lists:read,lists:write,broadcasts:read,broadcasts:write,broadcasts:send; keys and OAuth tokens schedule only while the workspace allows it (broadcasts_by_keys, off by default). Events and webhook typessubscription.created,subscription.updatedandbroadcast.updated(imports send none per row). MCP tools draft designs and broadcasts, preview, send tests to the caller and read reports;schedule_broadcastneeds the audience count it was shown.broadcast.updatedalso follows changes of the time zone or sending hours;schedule_broadcasttakessend_at_local. The MCP design tools read and write one language version bylocale; the broadcast tools take subjects per version and report per version. -
Law. Consent records and their export serve GDPR Art. 7 and 15 and KVKK; objections are kept after erasure; the welcome receipt and the footer follow Türkiye’s Regulation on Commercial Communication (Art. 7–10); links never expire (CAN-SPAM 30 days, CASL 60). Senders in Türkiye register their consents in İYS themselves; a list’s consent export with
format=iysgives İYS’s consent fields (recipient,typeEPOSTA,sourceHS_WEBfor forms and the preference page andHS_EORTAMotherwise,statusONAYorRET,consentDatein Türkiye’s time,recipientTypeBIREYSEL), leaving pending subscriptions out. -
Template gallery. Six starters ship in
templates/email/(MIT, listed inLICENSING.md; each a design JSON per language, assets and generated previews): newsletter, product update, announcement, welcome, event, digest. The panel shows them when creating a design; the website shows them at/templates(en, tr, de) with “Use this template”. New templates come by pull request (templates/email/README.md); there is no paid store.
Contacts directory
The panel lists contacts newest first or most recently active first (sort=last_seen), filtered
by kind (known: an e-mail address or an external id; visitor: neither) and by whether they
have an open conversation, with search over names, addresses and external ids.
contacts.last_active_atis the contact’s last message (any channel), rating or use of a widget or app session. It is kept by the queries that write those (message insert, session start, session use at most once per throttle period, realtime close), carried over on a merge, and indexed withcreated_atas fallback for the sort. It is the same for every member; an agent may see a contact rise in the order because of a conversation in an inbox they cannot see, but never that conversation. Pages follow it by keyset, as conversations followlast_activity_at; it only grows, so a contact active while someone pages moves above the pages already read and is neither repeated nor on the later pages, which the API reference says.activity(conversation counts, open ones, the last message time) is added only toGET /v1/contactsandGET /v1/contacts/{id}, by one grouped query per page over the conversations the caller can see, spam left out; events and webhooks carry the contact without it.GET /v1/contacts/{id}/summarycounts first replies with their median time and the latest rating of each conversation, over the same conversations, computed on request.- A contact’s conversations are
GET /v1/conversations?contact_id=with the usual filters. - Contact notes (
/v1/contacts/{id}/notes) are team-only notes about the person, not tied to a conversation: acontact_notesrow with the author (a member or an API key) and the text. Whoever can see the contact reads and adds them, under the same rule as the contact itself; only the author or an owner or admin deletes one. Contacts never see them, no event or webhook carries them, a merge moves them to the remaining contact and deleting the contact deletes them.
Moving to Yuva (M14)
A team brings its history from the service it uses today and then switches its mail over, without losing a message and without changing anything at the source. Decisions:
- Sources. Every mailbox is read over IMAP. Presets for Gmail and Google Workspace, Yandex,
iCloud, Zoho, Yahoo, Fastmail, GMX and any server connect with an app password or password.
Outlook.com and Microsoft 365 accept no passwords: “Sign in with Microsoft” obtains only an IMAP
token (
https://outlook.office.com/IMAP.AccessAsUser.Allandoffline_access, sent withAUTHENTICATE XOAUTH2) through the operator’s Entra app (YUVA_MICROSOFT_*) or, without one, an app registration the team created and entered on the connect page, as for help desks; the authority isconsumersfor Outlook.com addresses,organizationsfor domains whose MX is Exchange Online, elsecommon. The app is not publisher-verified, so Outlook.com and tenants that allow user consent connect, and other tenants use export files or an admin’s consent (the panel shows the admin-consent link). Export files (Google Takeout mbox, mbox, .eml or Maildir in a zip; no PST, for want of a permissively licensed reader) need no access to the account and are the fast way for very large Gmail mailboxes: Takeout first, then IMAP for newer mail and the cutover. Help desks: Zendesk with OAuthread, Help Scout, Chatwoot (an administrator’s access token, the install’s HTTPS base URL and the account number; conversations by last activity, messages backwards withbefore, 60 requests a minute); Intercom (a private app’s access token, see below); Crisp (a website token, identifier and key as Basic auth plusX-Crisp-Tier: website, and the website id; conversations ordered by last update a page at a time, messages read backwards withtimestamp_before, files fetched from Crisp’s storage host without the token, 5,000 requests a day of the token’s 10,000, and a 429 or 420 waits a minute and halves the pace); each team creates the OAuth client in its own help desk with Yuva’s redirect URL and enters its id and secret on the panel’s connect page (there is no operator-wide client), and a help-desk migration goes through the same cutover as a mailbox. Front connects with an API token a Front admin creates (feature Access resources, namespaces Global and Shared, permission Read only), sent as Bearer toapi2.frontapp.comonly; Front does not let a caller read a token’s permissions (GET /meanswers the company alone), so read-only rests on the GET-only transport and the guide. Front’s copy lists each inbox’s conversations (GET /inboxes/{id}/conversations, page token kept in the cursor, so a killed copy resumes where it stopped) and its sync searches each inbox (GET /conversations/search/inbox:… after:…, aGET, capped at 40% ofx-ratelimit-limitnext to the half of it the whole budget uses;retry-afteris honoured on 429); attachments are fetched by id from/download/{id}on the API host, never from the company subdomain URL a message names. Every help desk is one entry of a registry (internal/migrate/helpdesk): its API hosts, attachment hosts, auth kind (oauthortoken) and how the token is sent (Bearer, Basic or a named header), its limits with their windows (a minute, ten seconds or a day), limit and retry headers and default budgets, its contacts’ attribute prefix and how its changes are read after the scan; the preset, the sign-in, the reader and the copy read the entry, so a new help desk is a new entry. Atokendesk connects withPUT /v1/migrations/{id}/credentials(kind: token, the API token and, where the entry asks, a second secret, the account’s subdomain, the HTTPS base URL of a self-hosted install, an account number, the data region or a website id), sealed like OAuth tokens and deleted with them; the panel shows its form in place of “Sign in”. Freshdesk is a token desk: an admin’s API key (no scopes, no read-only key) sent as Basickey:Xto<subdomain>.freshdesk.comonly; tickets listed byupdated_atfromupdated_since, started again at the last change time after Freshdesk’s 300-page cut and deduplicated by id; attachment URLs are pre-signed, fetched without the key and read again once when expired; a budget of half ofX-RateLimit-Total(50 a minute until reported) and 20 list requests a minute. Intercom (internal/migrate/helpdesk/intercom.go) connects with the access token of a private app the team creates in its own workspace and a region (us,eu,au: the API host); it sends a pinnedIntercom-Versionand counts 10-second windows (X-RateLimit-Limit, half of it; a 429 waits untilX-RateLimit-Reset, a Unix time). Its search endpoints arePOST, so conversations are listed withGET /conversations(starting_after, 150 a page; Intercom documents no order, so every pass reads the listing to its end and keeps what changed since the cursor) and read withGET /conversations/{id}, which returns at most the 500 most recent parts (500 parts count as cut whatevertotal_countsays): a longer conversation imports those and records atruncatederror. Teams are the folders, with an “Unassigned” folder (id 0) for the rest; an incoming message’s author is its actual sender (a second contact), the requester only when the sender is missing; attachments are theuploadfiles Intercom lists, fetched without the token, and a link typed into a message is never fetched. Detection from the address and the domain’s MX picks the preset; autoconfig is read only from the team’s own domain. Provider mail APIs and other sign-ins were considered and rejected for one IMAP path. - Read-only, enforced three times. No credential a mailbox accepts is read-only (Microsoft’s
consent screen says “Read and write access to mailboxes via IMAP”), so Yuva enforces it. IMAP goes
through
internal/migrate/imapread, the only package that may import the IMAP client: it opens mailboxes withEXAMINEand fetches withBODY.PEEK, and a wire guard under the connection lets through onlyCAPABILITY,NOOP,LOGOUT,STARTTLS,LOGIN,AUTHENTICATE,LIST,STATUS,EXAMINE,UNSELECT,SEARCHandFETCHof non-marking items; anything else closes the connection before it is sent. Help-desk sources use a transport that refuses every method butGET(the token exchange and refreshPOSTto the provider’s token endpoint aside) and every host not on the source’s list; attachments the provider keeps on other public hosts are fetched by a separate client without the token. Atokendesk’s token goes only to its API hosts, never to an attachment host, and a team-entered base URL is dialled with the same address checks as an IMAP server (private addresses only withYUVA_MIGRATION_ALLOW_PRIVATE). A sign-in must grant exactly the requested scopes. Tests fail the build if a write command or method could be sent, and an integration test proves a Dovecot mailbox byte-identical after a migration. - Two phases. A scan reads headers only (the whole message only when it has no Message-ID, to take
the same hash the live ingest stores), joins threads (Takeout and help-desk thread ids, else
References/In-Reply-Towith the live bounds, never by subject) and gives an exact dry run: counts per folder, what is skipped and why, contacts, labels, storage and time. The copy then imports whole threads newest first. A thread is a conversation of the inbox’s e-mail channel whose address is the mailbox address; mail from a team address (the mailbox, aliases, members) is an outgoing message by the mapped member or, without one, by its original name and address (imported_author). Spam, trash, drafts and chats are never read; threads of only automatic or only internal mail are skipped by default. Labels and user folders become labels; a status rule closes old threads and leaves recent ones open or pending. - Imported history is quiet. Imported rows keep their original times and carry
imported_at(andmigration_idon conversations and created contacts). They write noconversation.*ormessage.*events, so no webhook, push, notification, auto-reply, rating request or continuity mail follows; they are never unread, are left out of/v1/statsand the bounce lookups, count inimported_*usage columns instead of the billed ones, and the retention clock starts at the import. Parsing, quote stripping, sanitising and attachments are the live ingest code’s. “Remove imported history” deletes the conversations nobody wrote in after the import. - Engine. River jobs on a queue of their own (
migrations,YUVA_MIGRATION_WORKERSper process, default 2) in 30-second slices, one job per migration (unique options and a lease), a watchdog every minute that resumes a migration whose process died. Checkpoints per folder (UIDVALIDITYand UIDs, file offsets, help-desk cursors); every item has a source id and a dedupe key (Message-ID, else the hash the live ingest uses), its rows get ids derived from both, and it is imported in one transaction, so a retry never duplicates. A message the channel already has, in either direction, is not imported again, which also lets a Takeout import and a later IMAP migration of the same mailbox meet without duplicates; a thread whose earlier messages the channel already has continues in that conversation, in every migration. Each source has a budget below its published limit (Gmail IMAP 1,500 MB a day, other servers one connection and 4 MB/s, help desks half their rate limit in its window, and half their daily limit next to it where they have one), kept on the migration row; limit answers (429, and420where a help desk sends it) andRetry-Afterare honoured. Microsoft tokens are refreshed before a connection and resealed. Pause stops after the batch in progress (at most 50 messages); any change to a ready migration’s options sends it back for a new dry run. Memory does not grow with the mailbox: the scan reads headers a page at a time, the plan joins threads in the database (migration_plan_nodes, union by size, a page of messages per step) and plans a batch of whole threads at a time, and the copy holds one batch and keeps a folder open across batches instead of opening it again for each. Progress reaches owners and admins asmigration.updated(stored) andmigration.progress(a signal, at most every two seconds); never webhooks. - Cutover. After the copy, sync runs every two minutes. The migration goes live when the copy ends:
mail received before that is history (mail that arrives during the copy is imported quietly); mail
after it is new mail and takes the live path (events, notifications), without the greeting. Every
e-mail channel has a forwarding address
<token>@YUVA_FORWARDING_DOMAINthat ingress resolves by token (rotatable); the forwarding domain may also carry ordinary channel addresses, so a local part that is no channel’s token falls through to the exact,local+tagand catch-all lookup. The team forwards the mailbox there (or routes it, or moves the MX). While waiting, Google’s forwarding confirmation to that address is shown on the migration (and sent as themigration.forwarding_confirmationsignal) instead of opening a conversation. A probe mail with an HMAC header (contextmigration-probe:) is recognised at ingress before the own-sender drop and verifies delivery. After verification and a quiet period (24 hours by default) in which sync found nothing ingress did not also deliver, the migration completes on its own; an owner may finish it earlier once delivery is verified, or without verification on purpose (force). The channel dedupe keeps one copy of mail that came both ways. “Remove imported history” also deletes the contacts the migration created that are left without a conversation; labels stay. - Credentials. Sealed under the master key (context
migration:+workspace+migration) inmigration_credentials, never in job arguments, events, logs or answers; deleted in the transaction that completes or cancels the migration, afterYUVA_MIGRATION_SYNC_MAX_DAYS(30) of sync, and with the workspace. Tokens are not revoked at the provider (that would take a method other thanGET); the completion screen and the guides say where to remove the OAuth client, the app or the app password. Sign-in uses PKCE, refuses a grant whose scopes differ from the requested set and, for Microsoft, a sign-in whose account cannot open the mailbox: when the token’s claims name another address or none (a Microsoft 365 UPN is often not the SMTP address), the mailbox decides by accepting the token inAUTHENTICATE XOAUTH2with its address as the user, and only its refusal isaccount_mismatch; the audit row names the account that signed in. Assistants never handle a password: MCP tools return a panel link where the person connects. - People in the work rows. The scan and the copy keep what they read about people in the
migration’s work rows:
migration_items.meta(a mailbox message’s addresses and subject, a help desk’s whole ticket with the requester’s name, e-mail address and phone),migration_threads.plan,migration_plan_names,migration_plan_nodesandmigration_errors.item_subject. The transaction that completes or cancels a migration clears all of them (metaandplanbecome{}, names and nodes are deleted, error subjects emptied); the item and thread rows stay, so the counts and the duplicate lookup do. There is no failed end state: a migration that needs attention keeps its rows until someone retries or cancels it. Deleting a contact clears, in every migration of the workspace, the items and thread plans that name one of its addresses and its plan names: planned items of such a thread are markedskippedwith reasoncontact_deleted(the thread’sdonecount follows), so a running copy does not import them. Error subjects of a running migration are not matched to a person and go when it ends. The 30-day sweep still deletes the rows themselves, and migrations that ended before this rule keep their rows until then. - Who. Owners, admins, and keys without an inbox limit or owner/admin tokens with
migrations:manage. Every action is inmigration_audit(actor, client), keptYUVA_MIGRATION_AUDIT_DAYS(365). Connection tests are limited (10 per migration, 30 per workspace an hour) so the server is no password-guessing tool. Hosted limits:YUVA_MIGRATION_SOURCES,YUVA_MIGRATION_MAX_ACTIVE,YUVA_MIGRATION_MAX_BYTES,YUVA_MIGRATION_UPLOAD_MAX_BYTES;422 hosted_limitnames the one reached in the problem’slimit. - Panel and MCP. A wizard in the setup layout (Source, Connect, Choose, Map, Review, Copy, Switch,
Done) with live progress, provider guides inline and in the docs (en, tr, de), Settings → Move to
Yuva for the list, a banner in the target inbox while it runs. The banner reads the inbox’s
import(address, state, percent), which everyone who sees the inbox gets;inbox.updatedcomes when it appears, changes state or ends, and the percent between those is read by refetching the inbox. MCP tools for every operation (create_migrationreturns the connect link) and themove_to_yuvaprompt. Like the wizard’s Map step,create_migrationgiven an inbox and no channel uses the inbox’s e-mail channel for the mailbox address or creates it (withinboxes:manage) without an SMTP account, and its answer tells the person to set SMTP in the panel; no tool takes that password.
Analytics (M15)
A workspace measures its own websites and apps: pageviews, screens, events, goals, funnels, revenue, sources, locations and devices, in the panel, the API and MCP. Plan in the M15 umbrella issue; it ships in six steps (M15.1–M15.6 in the roadmap). Decisions:
- Properties.
analytics_propertiesbelong to a workspace and optionally to an inbox (who sees them, what support data they join): name, a public key (yuva_ak_…, unique on the server, rotatable with 24 hours’ overlap), 1–50 domains (*.example.comallowed), platforms (web,ios,android), time zone (the property’s day), currency,collection(anonymousorconsent),consent_features(persistent,identify; none by default),audience(generalorchildren; children’s properties keep the country only, general ones keep the city), exclusions, path rules, up to 10 tracked props,retention_months(25). Owners and admins manage them; agents read the properties of their inboxes. - Default mode: nothing on the device, no IP stored. The address is shortened (IPv4 /24, IPv6 /48)
in the first function that sees it; GeoIP and the hash use only that. A visitor is
HMAC-SHA256(salt, property ‖ short IP ‖ user agent)truncated to 64 bits; apps hash a random key held in memory for the life of the process instead of the address. Salts are random, one per property and local day inanalytics_salts, deleted 2 hours after the day ends (YUVA_ANALYTICS_SALT_GRACE) and never derived from a persistent secret. So visitors are counted per day; a visitor over a range is the sum of daily visitors. A visit is a visitor’s events without a 30-minute gap within the day. Processes agree on a new visit throughanalytics_visit_claims: the first claim wins for 5 minutes (ClaimWindow, at most the visit gap); claims commit without waiting for the disk sync (a crash at worst splits a visit) and are deleted with the expired salts. A visit’s description (source, place, device) is the one its first event carries, even when another process wrote the visit first. - Law. Built to meet the CNIL audience-measurement exemption (purpose, no cross-checking, one
publisher, shortened IP, no tracker), PECR Schedule A1 (statistics with information and an
objection), the KVKK cookie guide’s Criterion B for first-party analytics, CCPA (no sale or sharing),
LGPD and COPPA (children’s properties keep country only, no props, no consent features). The EDPB
(Guidelines 2/2023) reads ePrivacy Art. 5(3) as covering any script that makes a browser send data, so
the docs say where a banner is still needed and
collection: consentsends nothing untilyuva.consent({analytics: true}). DNT and GPC stop collection unconditionally;yuva.optOut()stores the objection, the only default-mode write to the device. Raw rows are treated as pseudonymous personal data until the raw window ends; rollups are anonymous. - Consent features. Only for visitors who consented, through the host’s own consent tool:
persistentkeeps a random id on the device for at most 13 months (returning visitors, retention, cross-day funnels), hashed with a per-property key;identifysends the inbox’s identity JWT, checked like/client/v1/session, and links the visitor’s visits to the contact, shown on the contact page. Without consent no visitor is ever joined to a contact or conversation. - Collection.
POST /client/v1/analytics/{key}(one event, or up to 100 for apps), a plain handler outside the strict server;text/plainJSON so browsers send no preflight; its CORS branch matches theOriginhost against the property’s domains; no cookie, no session, request logs without addresses. It takes the visitor’s address fromX-Forwarded-Foronly when the connecting address is one ofYUVA_TRUSTED_PROXIES(empty trusts nobody): the rightmost entry that is not a trusted proxy, if it is a public address, otherwise the connecting address. A direct client’s header is ignored, so rate limits, GeoIP and the excluded-IP check cannot be steered by forged entries. Host backends sendPOST /v1/analytics/properties/{id}/eventswithanalytics:write, forwarding the visitor’s IP and user agent (never stored) or their own visitor key. Ingest scrubs e-mail-shaped values, keeps only UTM keys of the query string, parses the user agent (medama-io/go-useragent), looks up GeoIP (DB-IP Lite downloaded monthly by default under CC BY 4.0 with attribution, any MMDB file, or off; GeoLite2 only from the operator’s own account), drops bots (crawler list,webdriver, header and volume rules, referrer spam), and answers202before writing. - Storage. Events wait in a per-process buffer (
YUVA_ANALYTICS_BUFFER, full →503) and are flushed every second byCOPYintoanalytics_eventswith one upsert per visit intoanalytics_visits; both are partitioned by the property’s localday, created ahead and dropped afterYUVA_ANALYTICS_RAW_DAYS(90) by theanalytics_partitionsjob. Finished days are folded into rollups (analytics_dailyper dimension and value, top 1,000 values plus(other); hourly, goals, props, support) byanalytics_rollupjobs on theanalyticsRiver queue; late events and new goals mark days dirty. Queries add rollups for built days and raw rows for open ones; filter combinations the rollups cannot answer are served from raw rows inside the raw window only. The flusher also keeps each visit’s numbers per path (analytics_visit_pages), which page breakdowns and page filters read instead of the events. Every five minutes an open day is folded up to two minutes ago (analytics_partial_*) for the visitors whose every visit begun by then had ended half an hour earlier, so a query adds only the other visitors’ raw rows and takes away what the fold already holds of theirs, and a change to a folded visit (a delayed write, an engagement joining an old visit, a bot found later, a deletion) moves the day’s sequence so the fold stops counting until the next one. No Postgres extension. The query layer sits behind aStoreinterface so a column store can be added later without a contract change; Postgres is the only store in M15 and fits up to about 100M events a month per property. - Events, goals, funnels (M15.2). Custom and built-in events (
outbound_clickandfile_downloadwith an http(s)url,not_found,chat_open) carry up to 30 props (keys 1–300 characters, none starting with$oryuva_; text up to 2,000 characters; e-mail-shaped values dropped and counted as scrubbed; none on children’s properties but a built-in event’surl) and revenue in the currency’s minor units, never converted. Goals are a page view, an event with an optional prop equal to a value, or a scroll depth on matching pages; there is no separate revenue goal, because an event goal reports the revenue its events carry, per currency. A change to a goal or totracked_propsmoves the property’sgoals_version; a rolled-up day records the version its goal and prop rows were built with, so a goal is read from rollups only on days built at or after its own version and from raw rows elsewhere in the raw window, and the rollup scan rebuilds those days’ goal and prop rows without touching traffic rollups. Prop breakdowns read raw rows for any key inside the raw window andtracked_propsrollups before it. Funnels follow visits within a day over the raw window (90 days, or 31 when the property counted more than 10M events in the last 30), answers cached 10 minutes. Segments and annotations needanalytics:readand are edited by their author, owners, admins and keys without an inbox limit; Yuva’s own annotations (key_rotated,goal_created) cannot be edited. - Apps and servers (M15.3). An app screen is a page view of
app://<app id>/<screen>; the app id is the visit’s hostname and is not checked againstdomains. App requests have noOrigin, use the batch form{k, a, e}with one process key per request (a fresh UUID per launch, kept in memory only) and needa.platformin the property’splatforms; they skip the browser-header bot rules and the user-agent parser, the volume rules still apply. A late event (at most 72 hours old,tfrom apps,timestampfrom servers) is stored on its own day at its own time, hashed under its day’s salt while that salt exists and under the arrival day’s otherwise; visits, claims and bot counts use the event’s time.POST /v1/analytics/properties/{id}/events(keys withanalytics:write) takes server events that forwardip,user_agentand the client hints, hashed exactly like the browser’s request so they join its visit, or avisitor_keyhashed in a scope of its own; a visit a server event starts has platformserver.dnt,gpcor a missingconsentmean the event is not stored; invalid events come back inerrors, and only a body or auth problem refuses the request.sdk/go/analyticsdrops DNT and GPC requests before sending and retries 429, 5xx and network errors with backoff that honoursRetry-After. - Sharing and export (M15.5).
analytics_shareskeep a SHA-256 of the link token (yuva_sh_…, shown once) and an argon2id password hash (m=7 MiB, t=5, p=1; see Server (api/), public hardening); unlocking gives a 12-houryuva_sa_token HMAC-signed over the link id, its expiry and the password hash, so a new password ends every token; revoke and expiry stop a link at once. 50 links per property; 120 requests a minute per address; unlock limits as in Server (api/), public hardening. A link lists its views (overview,realtime,pages,sources,locations,devices,events,goals): totals and time grains come with every view, other dimensions, filters and event or goal metrics only with theirs, saved segments never; its queries share the workspace’s query slots and cache. The server serves the panel at/share/{token}withframe-ancestorsset to the link’s embed origins, otherwise'none'andX-Frame-Options: DENY, without the panel’s analytics script and with the token left out of request logs; the share API is/client/v1/analytics-shares/{token}. Exports areview(one query),daily(a row per day, optionally by one dimension) andraw(NDJSON, at most 31 days inside the raw window, bots left out, visits renumbered per file, no visitor hash, salt, stored id, contact or referrer path), written byanalytics_exportjobs to storage (1 GiB cap, 3 at a time per workspace) and deleted 7 days after they finish.viewanddailyneedanalytics:read;rawneedsanalytics:manageand an owner, admin or key without an inbox limit, because raw rows are pseudonymous. CSV cells starting with=,+,-,@, tab or CR get a leading'. - Support, alerts and reports (M15.4).
analytics_daily_supportkeeps conversations, page feedback, ratings and discussion threads of the linked inbox by (host, path, day), paths after the property’s path rules, built in the same job as the day’s traffic rollup; a day is read from it only whileanalytics_support_daysnames the property’s current inbox, other days from the inbox’s own tables. Conversations and discussions count on their local day, page ratings on the UTC day they were given.support_rateis conversations per 1,000 page views, joined to traffic by path (hostname as its own dimension or filter), never through a visitor;<yuva-chat>sends the page URL without query or fragment and the title with a new conversation, kept only for a chat channel that allows the page’s origin and dropped silently otherwise, so the page never refuses a conversation. Alerts: spike and drop compare the last two finished hours with the same hours averaged over the 7 days before (3× or more, half or less, a baseline of at least 20 views); goal drop is yesterday at half or less of its 7-day average with at least 10 a day; support load is yesterday’s rate at twice the 28-day rate with at least 5 conversations; a new referrer has 10 or more visits yesterday and none in the 28 days before. An alert is unique by (property, kind, key) and fires once a day (a new referrer once per host), writing an annotation, theanalytics.alertstored event and webhook, and a mail to subscribers. Weekly (Monday to Sunday) and monthly reports go out at 08:00 property time once per member and period, in the member’s language, without images or link tracking; subscriptions are per member session. Broadcast links getutm_source=newsletter,utm_medium=emailand the campaign (on by default; links that carry autm_parameter and the server’s own links are left alone; broadcasts already past draft at upgrade keep their links), and the report shows the campaign’s visits to callers withanalytics:read.ListAnalyticsReportWorkspaceIDsreadsanalytics_subscriptionsacross workspaces to find which have work, the same maintenance exception asListAnalyticsWorkspaceIDs; every query after it filters by workspace. MCP adds the analytics tools (read: properties, overview, query, realtime, support report, goals and funnels, funnel report, snippet, notes; manage: create goal, create property), theanalytics_reviewandsetup_analyticsprompts and theyuva://property/{id}resource; visitor-sent values arecustomer_content. Insights compare in percent only from a baseline of at least 10; a total with none before ismetric_new, a rownew_value; each insight appears once per answer. - Consent features (M15.6). A consented
persistentid (kept on the device for 13 months, made only without DNT or GPC) is hashed with the property’s sealed randomvisitor_keyand is that visitor on every day (persistent,visitor_type); ids first seen more than 13 months ago are forgotten by the hourlyanalytics_cohortsjob, which also rebuildsanalytics_cohorts(days to 30 periods, weeks and months to 12).identifyneedspersistentand a linked inbox; its token is checked exactly as for/client/v1/session(single-usejti) and links the id and its raw visits to the contact; forged, expired or reused tokens are ignored.yuva_consentevents carry identification and withdrawal and are never stored, counted or billed; a withdrawal, honoured under GPC and DNT, deletes the id’s link and cohort days, andDELETE …/visitors/{persistentId}erases everything stored under the id. A consented visitor counts once over a range’s totals and per week or month bucket (from cohort days without filters, from raw rows inside the raw window with filters); default-mode traffic stays a sum of days. Funnels follow consented visitors across visits and days inconsented_visitors. Deleting a contact deletes its linked visits, merging moves them, and contacts left from an import that have linked visits are kept. Children’s properties refuse consent features. The script tag keeps/yuva-analytics.jsat 1.5 KB without them; script-tag sites that use consent features load/yuva-analytics-consent.js(≤ 2 KB) instead, served and routed like the first. Every client treats consent to analytics withoutpersistent: trueas a withdrawal of a stored id, so hosts passpersistent: trueon each call where the visitor agreed to it; identify and withdrawal are sent once and never queued. - SDKs.
/yuva-analytics.js(≤ 1.5 KB gzip, served like/yuva.js, off withYUVA_WIDGET=off) with automatic and SPA pageviews, engagement, opt-in outbound, file and chat-open events;useyuva/analytics, React and Nuxt helpers; Swift productYuvaAnalytics(noYuvaKitdependency, SwiftUI.yuvaScreen, privacy manifest withCA92.1, no IDFA) and Kotlinyuva-analytics(ComposeTrackScreen, no advertising id);sdk/go/analyticsfor server events. Apps queue offline up to 72 hours. - Support, in aggregate. A property linked to an inbox gets conversations, page feedback, ratings and
discussion threads per page and day next to its views (
<yuva-chat>records the page a conversation starts on); broadcasts add UTM parameters by default (a broadcast can turn them off) and show the visits of their campaign. Alerts (spike, drop, goal drop, support load, new referrer), insights and weekly or monthly e-mail reports are fixed rules; Yuva runs no model. - Panel, API, MCP. An Analytics rail section per property (overview, realtime, pages, sources,
locations, devices, events, goals, funnels, retention for consented traffic, support, settings),
filters, comparisons, segments, annotations, read-only share links (password, expiry, embeddable on
listed origins), CSV and NDJSON exports. One query operation (
POST /v1/analytics/properties/{id}/query) serves the panel, the API and the MCP tools. Scopesanalytics:read,analytics:write,analytics:manage; likelists:*, they go to keys created after M15 without named scopes, never to existing keys. Analytics writes no stored event per page view;analytics.alertis a stored event and webhook type. - Hosting.
usage_counters.analytics_events;YUVA_ANALYTICS_MONTHLY_EVENTS(per workspace; unset: 1,000,000,0is no limit and warns at startup; operator overrides withyuva workspace analytics-limit), per-property and per-address ingest limits, 4 concurrent queries per workspace;YUVA_ANALYTICS=offremoves the feature. The script and endpoint keep their names (/yuva-analytics.js,/client/v1/analytics/); the docs teach serving both from the site’s own domain for visitors whose blockers stop them. - Counting the panel.
YUVA_PANEL_ANALYTICS_KEY(unset by default) names a web property on the same server; the server puts the script, in manual mode, ahead of the panel’s own scripts in the panel’s page, and the panel sends one page view per screen with every UUID path segment replaced by:id, so no record id of any workspace leaves the browser. A load balancer’s sticky cookie must skip the script and/client/v1/analytics/, or the promise of nothing on the device breaks.
Status pages (M19)
A workspace tells its customers whether its products work: a public status page per product with components, incidents and planned maintenance, kept up to date by members, by checks Yuva runs and by the product’s own servers. Being the support inbox is the point: the widget and the apps show an open incident before a customer writes, and the conversations an outage brings are answered together.
- Pages.
status_pagesbelong to an inbox (one page per inbox at most): name, description,slug(unique across the server,a-z0-9-, 3–48 characters, reserved words refused), logo (storage), a dark mode logo (logo_dark_url, a<picture>source forprefers-color-scheme: dark, used only with a logo), accent colour, site and support links, locale (en,tr,de, …; the page’s words follow it), time zone,history_days(90), whether uptime is shown, whether response times are shown (show_response_times, off by default), whether the header shows the name next to a logo (show_name, on by default; off leaves only the logo, with the name as its alt text), whether the page shows the Follow and embed section with its header link, the footer’s feed and badge links and the incident pages’ feed link (show_follow, on by default; the addresses keep answering), andpublished. An unpublished page answers 404 to everyone but members, who preview it in the panel. Renaming a slug keeps the old one instatus_page_slugs: it stays reserved for that page, its public paths (page, history, incidents, feed, badge, JSON) answer301to the current slug, and it is freed only when the page is deleted; a page may take one of its own former slugs back. Owners and admins manage pages and monitors; agents with access to the inbox open, update and resolve incidents and set component states. - Components.
status_components(name, description, optional group fromstatus_component_groups, position,hidden) have a state:operational,degraded,partial_outage,major_outage,maintenance. Every change closes the open row ofstatus_component_states(component, state, source, started, ended) and opens a new one, in the same transaction as a stored event. The page’s overall state is the worst visible component state,maintenanceonly when nothing is worse. Uptime for a day is the share of the day not inmajor_outage, countingpartial_outageas half and leavingmaintenanceout of the day; a day bar’s colour is its worst state. The source ismember,api_key,monitororincident. - Incidents and maintenance.
status_incidentshave akind(incident,maintenance), title, impact (none,minor,major,critical), the components they touch with the state each is set to (status_incident_components), and updates (status_incident_updates: state, text, author, time). An incident movesinvestigating→identified→monitoring→resolved; maintenance isscheduled(with a window) →in_progress→completed, started and completed on time by a River job unless a member does it first. Text is plain with links and line breaks, at most 5,000 characters, never HTML. A draft (published_atnull) is seen only in the panel; publishing makes it public and, unlessnotifyis false, queues a notice (see Subscribers). Resolving or completing puts each touched component back tooperationalunless another open incident or a failing monitor holds it. An update that is published cannot be removed, only corrected with a new one or edited with an “edited” mark; an incident can be deleted only as a draft. - The public page. The server renders it with
html/templatelike the list pages, without the panel and without JavaScript, so it loads when the product it describes does not:<status URL>/{slug},/status/{slug}/history,/status/{slug}/incidents/{id},/status/{slug}/feed.atom,/status/{slug}/badge.svg(overall state, for READMEs) and the JSONGET /client/v1/status/{slug}(Access-Control-Allow-Origin: *, no credentials). The pages follow the site’s lined style: full-width rules, a centred column with crosses where rules meet, numbered mono section labels, light and dark throughprefers-color-scheme; the page’s accent colour replaces the brand orange. Geist and Geist Mono (OFL) are embedded in the binary and served at{page}/fonts/{name}.{hash}.woff2with a year’s immutable cache, so the page asks no other host; the footer carries the Yuva mark inline and a link to the Yuva site, the header the page’s own logo.- The page: overall state and headline, three cells (uptime over the last 60 days of all visible
components, components not operational now, last change), open incidents beside running or planned
maintenance, components by group with 60 day bars drawn as SVG cells in five colours with a legend
and each component’s uptime over those days, response times when shown, incidents of the last 14
days, subscribing (a GET form to the existing
/subscribepage with the components ticked, which pre-ticks them there; nothing is sealed or cached on the page) and follow and embed (feed, badge, JSON URL, iframe snippet). - Response times: only with
show_response_timesand only for components with anhttportcpmonitor (paused ones too), or apushmonitor with a successful check carryingduration_msin the last 24 hours (a push monitor that never sends one leaves its component without a chart). The last 24 hours in 96 steps of 15 minutes, the median of the successful checks of each step as a stepped SVG line, and median and p95 over the day. Up to three components are tabs made of radio inputs and:checkedrules; more are all shown, and the inline script turns them into a select. The JSON carries the same aggregates asresponse_times; addresses, errors, messages and status codes of checks are never public. - An incident page shows start, end and duration, response times of its monitored components from a margin before to a margin after it (peak during it, median of the 24 hours before it), its updates as rows and how each affected component fared (worst state and time off operational).
- The history page lists every month of the page’s
history_days, newest first, with the month’s uptime and a day strip, and?filter=incidentsor?filter=maintenancekeeps one kind. - Words come in the page’s locale from the server’s catalogue (
status_words.go; en, tr and de are complete, a language is one map entry with its name and direction).?lang=<code>picks another catalogue language for that visitor, links on the page carry it, and an unknown code shows the page’s locale; the language select submits a GET form (the script submits it on change). Times are shown in the visitor’s zone through<time>with the page’s zone as fallback. One small inline script (its hash in the CSP) localises times, switches the response select and the language, and refreshes the page every 60 seconds; without it the page is complete. - Every public answer is cached in the process per page, view, language and filter and dropped on
the page’s next change; it is sent with
Cache-Control: public, max-age=30, stale-if-error=86400so a CDN in front takes an outage’s traffic and keeps serving the last page for a day when this server cannot answer. Rate limit 120 requests a minute per address (fonts are not counted).frame-ancestorsis*on the page so a host may embed it,font-srcandform-actionare'self'; the badge and JSON have no cookies. The status URL isYUVA_STATUS_URL(an origin such ashttps://status.example.com, served by the same server when requests for its host reach it; unset:<YUVA_PUBLIC_URL>/status); every link, the feed, the badge and the JSON name pages from it, and with it set<YUVA_PUBLIC_URL>/status/{slug}redirects there. When the page names an analytics property of the workspace, the page sends a cookieless page view to it with the analytics script. The bare status origin also serves a server-rendered home page (status_home.go): English at/, every panel locale at/{locale}/(lowercase code;?lang=answers a 301 to that path, no Accept-Language redirect), each with its own canonical,hreflangset withx-default, Open Graph and Twitter tags, a static 1200x630 share image and JSON-LD (Organization,WebSite,SoftwareApplicationwithout offers,FAQPage). Words live inhomeCatalog(one entry per locale, English fills what is missing); the page has no script, so its CSP has noscript-src. The live card shows the published page named byYUVA_STATUS_HOME_PAGE;YUVA_STATUS_HOME=offmakes/a plain 404./robots.txt,/sitemap.xml(home pages only: status pages carry no listing flag),/favicon.svg,/og.pngand/fonts/are served on the same origin. Own domains keep/for their page.
- The page: overall state and headline, three cells (uptime over the last 60 days of all visible
components, components not operational now, last change), open incidents beside running or planned
maintenance, components by group with 60 day bars drawn as SVG cells in five colours with a legend
and each component’s uptime over those days, response times when shown, incidents of the last 14
days, subscribing (a GET form to the existing
- Panel. A Status entry in the pages menu (
/status, shortcutg s) follows the inbox filter: the page of each visible inbox, or “Create status page” for owners and admins on an inbox without one. A page opens at/status-pages/{id}(not under/status/, which the server answers with the public page) with Incidents, Components, Monitors (/status-pages/{id}/monitors, where member notifications about a monitor going down or up link; keys1to4switch tabs) and, for owners and admins, Settings; an incident opens at/status-pages/{id}/incidents/{incidentId}. Owners and admins add, edit, pause and delete monitors and make a new address; agents with access to the inbox read them and their recent checks. A monitor’s address is shown once, after creating it or making a new one, with copyable setup snippets (curl, cron,?fail=1, a push body, Alertmanagerwebhook_configs, a Grafana contact point note) and never again; a member’s later state on the component is shown on the monitor as holding. Agents with access to the inbox set component states and open, update, publish and resolve incidents; owners and admins also manage components, groups and the page and publish or unpublish it. The preview shows the/previewHTML in a sandboxed frame. Lists and incidents refresh on thestatus.*realtime events. - Own domain. A page may name
custom_domain(status.example.com). The owner adds a CNAME toYUVA_STATUS_CNAME(unset: the host ofYUVA_PUBLIC_URL) and a TXT record_yuva-status.<domain>with the page’s verification value, so nobody claims a domain they do not hold; a River job checks both every 10 minutes until they are seen and every day afterwards, and a domain whose records go away is turned off after 3 days. State (status_pages.domain_state):pending(records not seen),failed(records found with another target or value; also checked every 10 minutes),verified,off(not checked again; setting the same domain again starts it over with the same value). A lookup that fails for another reason than a missing record changes nothing and is tried again in 10 minutes, so a resolver outage never turns domains off. A CNAME counts when the domain’s canonical name is the target or, for a provider that flattens it, its addresses are all the target’s. The domain is a hostname that is not, contains or sits inside one of the server’s own hosts (YUVA_PUBLIC_URL,YUVA_STATUS_URL,YUVA_STATUS_CNAME,YUVA_HELP_URL); setting it queues a check at once.- Other kinds (#148). Help centers, roadmap boards and changelogs have the same own domain, with the
same columns on
help_centers,roadmap_boardsandchangelogs, the samecustom_domainin their PATCH and answers, the same CNAME target,_yuva-status.TXT record, states, timings, claims, check job (status_domain_checkwith akind), sweep and certificate modes; one code path instatus_domains.goserves all four kinds. One domain belongs to one page of one workspace across the four kinds: availability, the verification under the advisory lock on the name and the failing of the other claims look at all four tables, andYUVA_STATUS_DOMAIN_LIMITcounts them together. A verified domain serves its page at/: every path maps under the page’s own prefix (/help/{slug},/roadmap/{slug},/changelog/{slug}), so the domain shows only that page’s paths (fonts, sitemap, the helpful form included), and/robots.txtnames/sitemap.xmlof the domain for help centers and changelogs. The page is read again by id on every request; a private board, an unpublished center or changelog, or one whose domain moved answers its plain404. Links, canonical andhreflanglinks, sitemaps, the Atom feed, the API’s and widgets’urland notification links name the page on its domain once it is live (as for status pages). The chat embedded in help and roadmap pages accepts the verified own domain of a help center or roadmap board as an origin of every chat channel of the same workspace (checked after the channel’s own origins), since the server serves every path there. Domain moves reach/v1/realtimeashelp.center.updated(data.center_id,help:read),roadmap.board.updatedandchangelog.updated(data.changelog_id,changelog:read), each also sent after a PATCH and not stored. - Claims. Only a verified domain holds its name: a partial unique index over
status_pages.custom_domainwheredomain_state = 'verified'. Any number of pages, in any workspace, may claim a name while it ispendingorfailed; setting another page’s verified domain is409 domain_taken, and anoffdomain blocks nobody. A check that sees both records verifies under an advisory lock on the name: when another page already holds it the claim becomesfailedwith problemtaken, otherwise it is verified and every other claim of the name becomesfailed(taken). A claim not verified within 7 days of being set (status_pages.domain_claimed_at) becomesfailedwith problemexpired.takenandexpiredclaims are not checked again until the owner sendscustom_domainagain, which starts the claim over (same value, 7 more days); sending a verified domain again only checks it at once. - Serving. A request whose
Hostis a verified domain is served that page at/, with/history,/incidents/{id},/feed.atom,/badge.svg,/subscribeand/subscribe/sent, and404for every other path (no API or panel on a customer’s domain). Hosts that are not syntactically domains are never looked up. Verified domains are cached host → workspace and page id apart from the hosts that are not one (capped and aged on their own, so arbitrary hosts never push a verified domain out), for 30 seconds; an entry is dropped after the commit of any change to its page (fields, slug, domain, check state, deletion, the inbox’s deletion), and the page is read again by id on every request, so a stale entry never serves a page whose domain moved. Links, the feed, the badge, the JSON, notices and the API’surlname the page on its domain once it is verified and, withcloudflare, once the custom hostname and its certificate are bothactive; until then they stay on the status URL. - Certificates. Yuva does not terminate TLS; who issues the certificate is
YUVA_STATUS_DOMAINS:ask(default): the operator’s proxy issues certificates on demand and asksGET /status-domains/check?domain=on the same server (the Caddyon_demand_tlsaskform). It answers200only for the verified domain of a published status page, help center or changelog, or a public roadmap board (its feature not off on the server), in a live workspace, and404otherwise (also in the other modes); it is public, limited as in Server (api/), public hardening (the proxy’s own asks never), and reveals only domains that already serve public pages.deploy/caddy/Caddyfiledocuments Caddy.cloudflare: the server registers each verified domain as a Cloudflare for SaaS custom hostname inYUVA_CLOUDFLARE_ZONE_ID(tokenYUVA_CLOUDFLARE_API_TOKEN, permission SSL and Certificates edit) with HTTP validation, so Cloudflare issues and renews the certificate once the CNAME points at the zone’s fallback origin; the panel shows the hostname’s and the certificate’s state from Cloudflare (checked every 10 minutes until both areactive), and a removed or turned-off domain, or one whose page, inbox or workspace is deleted, is deleted there by a job. The hostname is created only after the check’s transaction commits, from the page read again, so a domain that was removed or turned off meanwhile never gets one. For servers behind Cloudflare.off: no own domains;custom_domainis left out of answers, and a PATCH accepts onlynull,""or the page’s current domain (unchanged, not an error); anything else is400. Removing a domain still deletes its Cloudflare hostname whenYUVA_CLOUDFLARE_ZONE_IDandYUVA_CLOUDFLARE_API_TOKENare set, which they may be in any mode for that.
- Availability and realtime.
GET /v1/status-pagesand/{id}carryown_domains: {mode}(askorcloudflare), absent whenYUVA_STATUS_DOMAINSisoff, so a client tells “no domain set” from “domains off”. Realtimestatus.page.updated(data.page_id;/v1/realtimeonly, not stored, no replay) goes to members withstatus:readorstatus:managewho see the page’s inbox when its domain changes state (verified, failed, turned off, claim lost to another page), its Cloudflare hostname or certificate status moves, or the page is patched; clients reload the page. The contacts’status.hintis separate. YUVA_STATUS_DOMAIN_LIMITcaps the pages of a workspace with a domain that is notoff, checked when one is set under an advisory lock per workspace, so concurrent PATCHes cannot pass it (403 status_domain_limit; unset: 1 withYUVA_SIGNUP=open, else no limit).
- Other kinds (#148). Help centers, roadmap boards and changelogs have the same own domain, with the
same columns on
- Subscribers. A page may have e-mail subscribers, who get a notice when an incident or maintenance
is published or updated. They are not a new kind of recipient: they are the subscriptions of a
mailing list of the page’s inbox, so consent, confirmation,
/s/and/m/pages, suppression, complaints, retention and the consent export are the ones of M13. The Atom feed and webhooks need no subscription.- Storage.
mailing_lists.kind(listdefault,status) andstatus_pages.mailing_list_id(unique; the list is made when e-mail subscribers are first turned on, named like the page, with(status)added when the inbox already has a list of that name). A status list is fixed by a check: notpublic, notcommercial,double_opt_inon, nowelcome. It is left out of broadcast audiences (400 validation_failednamingaudience.list_ids, as every audience check), ofGET /v1/listsunlesskind=status, of the forms andGET /client/v1/channels/{key}/lists, of CSV imports (409 list_kind), of the İYS export, and of the lists a marketing/m/page offers or “unsubscribe from everything” ends. It sits outside the opt-out register: leaving it writes noemail_optoutsrow (also not after 3 years or when the contact is deleted), confirming it lifts none, and an existing opt-out does not stop a person who asks for notices again (they confirm by mail). A complaint still ends every subscription of the address and writes its opt-out, like any complaint. Purpose limitation is the reason for the separate kind: people agreed to incident notices, never to newsletters. - Choosing components. A subscription gets all notices of the page, or only those of chosen
components:
status_subscriber_components(workspace_id,subscription_id,component_id, primary key on the last two, cascade on both) andlist_subscriptions.chose_components. A subscription that did not choose gets everything, including components added later. The form and the/m/page show one checkbox per visible component, all ticked; ticking all stores no rows and clears the flag, ticking none is refused (“unsubscribe instead”). An incident or maintenance reaches a subscriber when they did not choose or the incident touches one of their components; an incident touching no component reaches those who did not choose. The flag outlives the rows: when every chosen component is deleted the subscriber has the flag and no rows, and gets only incidents that touch no component, never everything (the subscription then listscomponents: []). Choices are preferences, not consent: they change without a consent event, and the consent event of the request stores the chosen components indetail. Reason for choosing per component and not per page only: a page with regional or product components mailing everyone about everything is what produces spam complaints, and the complaint rate is the one number that can suspend a workspace. - Subscribing. The page links to
GET /status/{slug}/subscribe(own page,no-store,frame-ancestors 'none'; on a verified custom domain/subscribe). The cached page itself carries no form because a sealed form token in a body cached per page and per language would outlive its two hours. The form is plain HTML without JavaScript: address, component checkboxes, a honeypot, the language of the page, a sealed token (yuva status subscribe v1: page id and issue time, at least 2 seconds and at most 2 hours old) and a visible sentence in the page’s language (“Send me notices about incidents and maintenance of {page}. I confirm by e-mail and can unsubscribe in every mail.”), which is stored as the consent text. It posts to the same URL; the answer is a redirect to/status/{slug}/subscribe/sent(“If the address can receive mail, a confirmation is on its way”), identical for every address, taken or not, suppressed or not. Behind it the M13 form path runs (subscribeFromFormwith the page’s list): contact by address or a new unconfirmed one with the page’s language as locale,pendingsubscription,requestedconsent event with IP, user agent, the page URL and the text, confirmation job. Always double opt-in. The confirmation mail (status_confirm) and the/s/page name the page and the chosen components; a confirmed subscriber gets no welcome mail. Hosts add subscribers only through/v1/lists/{id}/subscriptions, which for a status list always createspendingand sends the confirmation (202, neversubscribed); there is no JSON subscribe endpoint for visitors, a host links to the page. - Abuse limits. The page’s 120 requests a minute per address stay. Subscribe: 10 an hour per
address of the visitor and 300 an hour per page, then
429withRetry-After(the page says so); confirmation mails 3 a day per recipient address, one per 10 minutes per recipient and page, and 1,000 a day per page, all the M13 counters keyed on the page; the honeypot and a token that is too young or too old answer as success (honeypot) or ask to load the form again (token).YUVA_STATUS_MAX_SUBSCRIBERScaps subscribed addresses per page (unset: 10,000 withYUVA_SIGNUP=open, else no cap; at the cap the form says the page takes no more subscribers). Pending ones go after 30 days like any list’s, and the sweep also deletes the unconfirmed contacts those requests created when nothing else refers to them (no address, identity, conversation or other subscription), so a flood of fake addresses leaves nothing in the contacts directory.YUVA_STATUS_NOTICES=offhides the form (404) and sends nothing; owners may switch a page’s e-mail off in its settings. The confirmation puts only the page name (at most 100 characters, plain text) in the subject and body; incident text appears only in notices to confirmed subscribers. - Notices. Incident and maintenance updates carry
notify(API, MCP and panel). A new incident defaults totrue; an update defaults totruewhen it changes the state, the window or is the resolution, and tofalsewhen it only adds text; a maintenance start and completion done by the River job follow the incident’s storednotifyand carry a text in the page’s locale (“The maintenance has started.” / “The maintenance is complete.”, also intrandde), so pages and notices say something. Component changes alone, drafts, and published updates withnotify=falsesend nothing. Every update storesnotify; the opening update of an incident takes the incident’s. Publishing a draft sends one notice attaching every update of the draft,notifyor not, so the notice always carries the opening text (shown newest first). A window edit of a maintenance mails when the window actually moved and the request’snotify, else the incident’s, is true. Resolving or completing withnotify=falsecancels the notices still waiting (statecancelled,skip_reasonclosed_quietly), so nothing mails after a quiet close. Monitor-opened published incidents notify like a member’s; the budget below keeps a flapping monitor from mailing people. A notice is astatus_noticesrow (page, incident,due_at,statepending|sending|sent|skipped|cancelled,final,skip_reason, counts) covering exactly the updates whosestatus_incident_updates.notice_idpoints at it (a later update is attached only when it asked to notify; attaching takes only updates of the same incident that no notice covers yet, and a notice never falls back to another update),window_changed(the notice was queued or joined by a change of the maintenance window), and onestatus_notice_deliveriesrow per recipient (notice, subscription, address,email_tokenand uniqueheader_message_idlike broadcast deliveries,previous_message_id,statequeued|sent|failed|bounced|complained|skipped, skip reason, attempts, next attempt, times, error). Deliveries and addresses go after 90 days; the notice keeps its counts. - Content. Server-rendered, no designer, no merge fields, no images, no tracked links and no
open pixel:
status_noticeandstatus_confirminmail/templates/{en,tr,de}through the shared layout (brand: the inbox’s name, the page’s accent colour; dark mode as the other mails) with a text part. The language is the subscriber’s locale (set from the page’s language when they subscribed), else the page’s. Subject[{page}] {title},[{page}] Maintenance: {title}in the language; the subject does not change between notices of one incident, so mail clients keep them in one thread, and each notice also setsIn-Reply-Toto the recipient’s previous notice of the incident andReferencesto the chain. Body, first line: the state in words (Investigating,Identified,Monitoring,Resolved,Scheduled,In progress,Completed, never colour alone), then impact, the affected components with the states the incident set (a final notice, resolved or completed, lists them by name only), the attached updates newest first with times in the page’s zone and its name, the incident’s text (plain text; the HTML part escapes it and links onlyhttpandhttpsURLs, marks “edited”); a notice withwindow_changedshows a sentence for what changed (“The maintenance is now scheduled for {window}”, the window in the page’s zone, also intrandde) above its updates; the first announcement of a scheduled maintenance uses the normal wording. Then a link to/status/{slug}/incidents/{id}(on the verified custom domain when there is one), the footer: why the person gets it, the page, “Choose components or unsubscribe” to/m/{token}, the inbox’s legal name and postal address when set (never required: notices are not commercial). A notice is rendered when it is sent from the current rows, so a corrected update is mailed as corrected. - Sending. Through the inbox’s e-mail channel named on the list, never the server’s own SMTP:
the channel’s broadcast account when set, else its support account, its From address, display name
and Reply-To, its own DKIM key or SES identity and the SES tenant headers, so SPF, DKIM and DMARC
align exactly as for broadcasts and bulk mail never shares reputation with a support reply’s
account. Headers:
Message-ID<email_token.random@sending domain>,List-UnsubscribeandList-Unsubscribe-Post: List-Unsubscribe=One-Click(RFC 8058) with the recipient’s/m/link for the status list,List-Id(<s{list}.{domain}>with the page name),Feedback-ID{incident}:{list}:{workspace}:yuvastatus,X-Auto-Response-Suppress: OOF, AutoReply, noAuto-Submitted./m/of a status list shows only that list: unsubscribe, the component choices, a link back to the page; the one-click POST unsubscribes at once. Not subject to broadcast approval, warm-up orYUVA_BROADCAST_DAILY_RECIPIENTS(a notice about an outage must not wait for a quota), but never above these: a workspace suspended from sending (30-day rates) sends none (skipped,suspended), a channel without a sender or a tenant that isidentity_missingis attempted as for confirmations, andYUVA_STATUS_NOTICES_DAILY(notice mails per workspace and UTC day, 0 = no limit, unset: 5,000 withYUVA_SIGNUP=open, else 0; beyond it deliveries stayqueuedwith their next attempt at the start of the next UTC day, where the 6-hour staleness rule still applies: one older than that by then isskippedwithstale). Notices count inbroadcast_sending_days(sent, bounced, complained), so they stay inside the workspace’s 30-day complaint and bounce limits, and in the usage counters asstatus_notices. Jobs:status_noticeon its own River queue (2 workers, so a notice never waits behind a newsletter), one job per notice, scheduled atdue_at; a sweep every minute queues pending notices that are due and sending ones whose lease ran out. The job claims the notice with one conditional update (pendingtosending,due_at <= now), so a duplicate or moved job does nothing; checks the page is published, e-mail on, the incident published and the channel ready; snapshots recipients (subscribed, not suppressed in any scope, component match) into deliveries in 1,000-row transactions withON CONFLICT DO NOTHING; sends in batches of 50 or 5 seconds over one SMTP session at the channel’sbroadcast_rate, re-checking each address before its mail (still subscribed, not suppressed, notice not cancelled). Per-broadcastpacedoes not apply. Temporary failures retry after 1, 5 and 30 minutes, then fail; a delivery more than 6 hours old isskipped(stale): late news is worse than none.5.1.xand5.2.1answers are bounces. The job does not pause anything; the panel shows the counts and the page’s last notices. - Bounces, complaints, replies. Delivery reports, ARF reports and SES notifications find a
notice delivery by
header_message_idor the relay’s id in the places that find broadcast deliveries (FindStatusNoticeDeliveryByHeaderand...AnyWorkspace, the second across workspaces because SES names only the message; everything after it is scoped by the delivery’sworkspace_id). A hard bounce suppresses the address for all mail; a complaint suppresses broadcasts, unsubscribes every list of the address and writes an opt-out, exactly as for a broadcast. A reply to a notice (found by the token inIn-Reply-ToorReferences) opens or continues a conversation with that contact in the inbox and links it to the notice’s incident (status_incident_conversations), so “Reply to linked” reaches it; automatic replies are only counted. - Throttling. Notices of one incident coalesce and keep a distance: a notice is due 60 seconds
after the update that asked for it (the window for fixing a typo, and for “Undo” in the panel,
POST /v1/status-pages/{id}/notices/{notice_id}/cancel,409 not_pendingonce sending); an update withnotifythat arrives while a notice of the incident ispendingjoins it and keeps itsdue_at; a notice of an incident is due no earlier than 15 minutes after the previous one of that incident was sent, exceptfinalones (resolved, completed, maintenance started), which are due after 60 seconds and pull a waiting notice forward. A page sends at most 10 notices in any rolling hour; further ones areskipped(rate) and the panel says so;finalnotices are exempt from the gap and the rate, but go only to subscribers who got a sent notice of that incident, and a final notice with none sent before it isskipped(nothing_earlier): nobody heard of the incident, so nobody is told it ended, and a skipped opening notice cannot be bypassed through the closing one (an incident resolved while its first notice still waits sends nothing). With the gap this means a subscriber gets at most one mail per quarter of an hour about an incident and ten an hour from a page, however often members post. - Panel and API. Settings of a page: e-mail subscribers on or off and the e-mail channel (the
inbox’s channels that can send;
409 sender_not_readyotherwise; a missing deliverability check, a missing postal address or an unaligned DKIM warn, never block). A Subscribers tab (counts, search, state, chosen components, remove, add by address which sends the confirmation, consent export; the list endpoints of M13 withkind=status, scopeslists:*). In the incident composer a “Notify subscribers” checkbox beside Publish and beside each update, with the number it would reach, and in the timeline a notice line (scheduled for, sending, sent to N, N failed, N bounced, skipped and why) with Undo during the hold.GET /v1/status-pages/{id}/notices(incident_id,state, cursor) and/{notice_id}, scopestatus:read; cancel needsstatus:manage.GET /v1/status-pages/{id}showsemail_subscribers(enabled,channel_id,list_id, counts) andstatus.*events and webhooks are unchanged; progress reaches/v1/realtimeasstatus_notice.updated(not stored).subscription.*events fire for status lists withlist.kind. MCP:create_incidentandpost_incident_updatetakenotify,get_status_pagereturns the subscriber counts; no tool reads addresses. - Law. Subscribers asked for the notice and confirmed by mail; the consent events (IP, user agent, page, the sentence they saw, the components) serve GDPR Art. 7 and 15 and KVKK, and the consent export includes status lists without an İYS format. Notices contain no promotion, so they are service messages: no İYS record, CAN-SPAM’s transactional exemption (accurate From and routing) applies, and the footer still names the sender and offers one-click unsubscribe, which Gmail and Yahoo require of subscribed bulk mail. Links never expire.
- Storage.
- Monitors.
status_monitorsset a component’s state from outside a member’s hand. Kinds:heartbeat: the host’s job callsPOSTorGET /ingress/heartbeat/{token}at least everyintervalplusgrace; a missed beat fails the monitor,?fail=1or/failfails it at once. For servers and cron jobs Yuva cannot reach.push: the host’s monitoring sends the state:POST /ingress/status/{token}with{"state":"major_outage","message":"...","duration_ms":182}(duration_msoptional, 0–120000, the host’s measured response time), or an Alertmanager or Grafana alert webhook body as it is (firing fails, resolved recovers).http: Yuva sends a request (method, headers, body; header values encrypted under the master key) everyinterval(60 seconds at least,YUVA_STATUS_MIN_INTERVALon a hosted server; unset: 60, or 300 withYUVA_SIGNUP=open) and expects a status range, optionally a keyword in the first 64 KiB, an answer withintimeout(at most 30 seconds) and, for https, a certificate valid for more thancert_warn_days(default 14; a certificate expiring sooner fails the check, it does not degrade). The certificate is the one of the monitored URL’s own host, never of a redirect target. Header names are returned, values never; a redirect to another host drops the monitor’s headers.tcp: a connection to host and port withintimeout. The host is a name or an IP address, an IPv6 address bare (no brackets); a host with a port or brackets is refused, the port is its own field. Outside checks follow the webhook rules for outbound requests (resolve once, refuse loopback, private, link-local, CGNAT and reserved addresses, connect to the resolved address, no proxy; redirects are followed only when the monitor allows it, at most 5, each hop checked again), withYUVA_WEBHOOK_ALLOW_PRIVATElifting the address check on a self-hosted server. A monitor fails afterfailure_thresholdfailures in a row and recovers afterrecovery_thresholdsuccesses (outside checks default to 3 and 2, heartbeat and push monitors to 1 and 1, since the sender already decided); then it sets its component to its failure state (degraded,partial_outageormajor_outage) or back, never over a state a member or key set later than the monitor’s last change (a later change of the monitor, such as a new failure after a recovery, applies again; the same rule holds when other holders are settled), and opens a draft incident, a published one, or none (on_failure). Checks run on a River queue of their own, at most 20 at a time per process, spread over the interval; results go tostatus_checks(time, ok, duration, status code, error) kept 30 days for the response-time chart. While a monitor is down its incident follows the state it claims (impact and component state, worse or better), and pausing or deleting it resolves that incident with an update saying so and puts the component back unless something else holds it. A heartbeat or push call counts first against a per-address limit (600 a minute per client address, IPv6 per /64; unknown tokens count too) and then against the monitor’s own limit (60 a minute), which is created only after the token is found. The overdue-beat sweep is one job at a time and finds the due monitors of all workspaces in one query, then handles each in its workspace; one failing monitor is logged and the others go on. A monitor going down or up notifies the inbox’s members like a new conversation does (push, e-mail per their settings), one job per member and channel carrying the transition’s state, message and time, so a retry never sends anything twice. Hosted limits:YUVA_STATUS_MONITORSper workspace (unset: 20); for subscribersYUVA_STATUS_NOTICES(on|off),YUVA_STATUS_NOTICES_DAILYandYUVA_STATUS_MAX_SUBSCRIBERS(see Subscribers). Checks run from the server’s own place and a multi-location check is not planned, so the server tells its own trouble from its customers’ with canaries alone:YUVA_STATUS_CANARY_URLS(unset:https://www.google.com/generate_204andhttps://www.cloudflare.com/cdn-cgi/trace; any answer counts;offturns the guard off). How many checks fail never decides it, since across workspaces one tenant’s failing monitors would erase another’s real outage and within one it would hide a shared backend dying. The canaries are probed only when a round has a failure, and their verdict is kept for 60 seconds. The guard is armed only while the canaries answered at least once in the last hour: then a round whose canaries all fail has its failures dropped, no state changes, the operator gets a log line and theyuva_status_rounds_dropped_totalmetric. Canaries that have not answered for an hour (a firewalled or offline server) leave the guard off, failures count, and the server logs once an hour that the canaries are unreachable andYUVA_STATUS_CANARY_URLSshould name URLs it can reach or beoff. A round is one sweep: it claims the checks due in the next 30 seconds, oldest first, as long as their timeouts add up to no more than the check queue’s workers can run before the round’s deadline (20 workers × 40 seconds), so the rest wait for the next sweep instead of starting late; it keeps their results pending instatus_checksand judges them together after the last can have finished. The judgement is stored on the round’s checks (round_dropped) before any is applied, so a retried judging applies the same one; a round’s successes always count. A check that still starts too late to finish by its round’s deadline runs anyway and is judged at once in a round of its own, by the same rule, so no monitor goes unchecked. The sweep, the claim and the judging read across workspaces (the documented exception, like the overdue-beat sweep) and act on each monitor in its workspace; heartbeats and pushes are not affected by this, but a heartbeat whose beats stop while the server itself was not taking requests (its own start within the grace) waits one more interval.
- Support.
GET /client/v1/channels/{key}, the client session and the realtimeinbox.updatedcarrystatuson the inbox: the page URL, the overall state and the open published incidents and running maintenance (id, title, impact, state, last update, URL). The widget and the Swift and Kotlin SDKs show a dismissible line above the conversation list and the composer while one is open. In the panel a conversation can be linked to an incident (status_incident_conversations), the incident lists its conversations and their states, and “Reply to linked” sends one reply, written once, to every linked open conversation as the member, then optionally closes them; it is one job per conversation through the normal reply path, so e-mail, chat and app all get it the usual way. The body is stored once per request (status_incident_replies) and the jobs reference it; jobs are inserted in batches, and an incident takes at most 5,000 linked conversations (422 too_many_links). Each conversation’s outcome (pending,sent,skippedwithclosed,unlinked,conversation_deletedorrevoked,failedwith the problem code orgave_up) is kept onstatus_incident_reply_targetsand read withGET /v1/status-pages/{id}/incidents/{id}/replies/{replyId}; the202carries that id. A job checks its caller again when it runs: a revoked or expired key, a revoked OAuth grant, a removed member or a lost scope sends nothing. The panel reads a reply’s outcome every two seconds while any conversation ispending, since no realtime event carries it, and lists the skipped and failed ones when it is done. - API and access.
/v1/status-pages,/v1/status-pages/{id}/components,/groups,/incidents,/incidents/{id}/updates,/incidents/{id}/conversations,/monitors,/monitors/{id}/checks;/v1/status-pages/{id}/previewrenders the public page for members. Scopesstatus:readandstatus:manage; neither goes to existing keys,status:readgoes to keys made after M19 without named scopes, andstatus:managenever does (likebroadcasts:send: name it when the key is made). A key limited to inboxes sees the pages of those inboxes. Stored events and webhook types:status.component.updated,status.incident.created,status.incident.updated(every published update),status.incident.resolved,status.monitor.down,status.monitor.up. MCP tools:list_status_pages,get_status_page,set_component_state,create_incident,post_incident_update,resolve_incident,list_monitors,link_conversation_to_incident; publishing from MCP follows the same draft rule as the panel unless the workspace lets assistants publish incidents. - Lookups before the workspace is known. A public page finds its page by
status_pages.slug, a former slug instatus_page_slugsor a verifiedstatus_pages.custom_domain, all unique across the server, and a slug’s availability is checked against current and former slugs of every workspace and a domain’s against the verified domains of every workspace, and a domain’s verification turns the other claims of that name, in every workspace, tofailed; the domain sweep lists the own domains due for a check of every workspace in one query; a heartbeat or push finds its monitor bystatus_monitors.token_hash, and the sweep of overdue heartbeats lists the due monitors of every workspace in one query; an SES notification finds a notice delivery bystatus_notice_deliveries.header_message_id, unique across the server. Everything after those lookups is scoped by the workspace they returned.
Help center (M20)
A workspace answers common questions once, in writing, where customers look first: a public help center per product with collections and articles in several languages, searched from a page, from the widget’s Home and from the inbox’s composer. Yuva hosts these support articles; product documentation stays on the products’ own sites (see “Documentation pages”). Being the support inbox is the point: a visitor finds the answer before writing, a member sends an article as a card instead of retyping it, and the searches that found nothing say which article to write next.
- Concepts. A help center belongs to an inbox (one per inbox at most) and has a public slug, the
locales it publishes and
published. A collection groups articles, with one level of sub-collections at most. An article belongs to one collection or none and has one translation per locale; a translation has a working draft and, once published, a frozen published copy. A card is an article sent in a conversation. - Tables. Every table carries
workspace_idwith composite foreign keys(workspace_id, x_id).help_centers:inbox_id(unique per workspace), name, description,slug(unique across the server,a-z0-9-, 3-48, the reserved words of status pages),default_locale,locales(1-20), logo, accent colour, site link,chat_channel_id(the chat the public pages embed under “Still need help?”),analytics_property_id,agents_may_publish(default false),published, andchanged_at, moved by every change the public side shows (the cache key).help_center_slugskeeps former slugs, which answer301as with status pages.help_collections(center,parent_id, a per-centernumberfor URLs, a fixed-seticon,position) andhelp_collection_translations(locale, name, description, slug). A collection with no published article in a locale is hidden in that locale.help_articles(center, collection, per-centernumber,position, up to 20pathspatterns such as/billing/*where the widget suggests it, creator) andhelp_article_translationskeyed by(article, locale): drafttitle(3-200),body(Markdown, 100,000 characters),keywordsandslug;version(writes carrybase_version,409 version_conflict); theemail_imagesthe draft uses; the frozenpublished_*copy withpublished_htmlrendered once at publish and an excerpt;has_unpublished_changes; and asearchtsvector generated from the published copy with the configuration of the locale (title weight A, keywords B, body C,İ/ıfolded).help_article_revisions: snapshots of title, body and keywords (kindsave, at most one per 10 minutes per author,publish,restore), the newest 50 per article and locale are kept.help_article_daily(views, helpful up and down, conversations started, times sent as a card) andhelp_search_daily(normalized query, searches, searches without result, clicks): counters per day, without any visitor data; 25 months and 90 days.messages.help_cards(up to 3 snapshots taken at send time) andconversations.help_article_id(the article read just before the conversation was started from it).
- Writing and publishing. Agents with access to the inbox write drafts, collections and
translations. Publishing, unpublishing, deleting a published article and the center’s settings are
for owners and admins, unless the center’s
agents_may_publishis on, which lets agents with inbox access publish too. MCP and OAuth tokens never publish, whatever the setting. A save needsbase_version; another member’s open editor is told by a realtime-only signal that the article changed elsewhere. Publishing freezes the draft, renders it, moveschanged_atand stores an event (help.article.published,.unpublished,.deleted, also webhook types). Translations exist only in the center’s locales. The editor shows the default-locale text beside the one being translated, marks translations that are older than the default and lists the missing ones; Yuva runs no translation model. - Endpoints. Tag
help. Members, under/v1/help-centers: centers (list, create, update, delete, a preview rendered for a sandboxed frame), collections, articles (list with filters for collection, locale and statedraft,published,changedormissing),PUTandDELETEof a translation,publishandunpublish, revisions with restore into the draft, a Markdown render for the editor, image upload intoemail_images(same rules and size cap), search (with drafts for members) and a report (7, 30 or 90 days: top articles, helpful share, conversations started, searches, queries without result, articles with most “no”).POST /v1/conversations/{id}/messagestakesarticle_ids(up to 3 published articles). The client side, forchatandappchannel keys under/client/v1/channels/{channel_key}/help: the center with collections, best matches for the page and popular articles;search; collections; articles (with the locale actually served, falling back to the default, and related articles);reactions; andsearches/click. Browsers need an allowed origin; nothing creates a contact;404 help_offwithout a published center.ClientInbox.help(url,locales,default_locale) is present only with a published center, and the Help tile and the Home search show only then.ClientMessage.cardscarries article cards, andClientConversationCreate.help_article_idis kept only for a published article of the inbox’s center and dropped silently otherwise. - Scopes and access.
help:read,help:writeandhelp:publishare API key scopes. The first two go to keys made after M20 without named scopes;help:publishis not implied and must be named (likestatus:manage); no existing key gains any. Key inbox limits and OAuth narrowing apply as everywhere, and a center of another inbox answers404. No OAuth client is offeredhelp:publish, and OAuth tokens cannot create, change or delete a center. - Public pages. Rendered by the server with
html/template, no JavaScript needed, in the style of status pages and sharing their fonts, CSP builder and cache with them:/help/{slug}(or underYUVA_HELP_URL, an origin served by the same server, asYUVA_STATUS_URLworks), then/{locale}/,/{locale}/collections/{number}-{slug},/{locale}/articles/{number}-{slug},/{locale}/search?q=and/sitemap.xml. A wrong slug in a URL answers301to the canonical one, so a rename needs no slug history. There is no redirect fromAccept-Language; every page hashreflangalternates for its published translations, a canonical link, Open Graph tags and JSON-LDArticleandBreadcrumbList. An unpublished center or article answers404with the plain text of status pages. “Was this helpful?” is two POST buttons that work without JavaScript: a form post to/{locale}/articles/{number}-{slug}/helpfulwithrating(upordown) andprevious(the earlier answer, which it replaces), 4 KiB at most, rate limited per address and per center. It answers303to the article with?thanks=upor?thanks=downand the fragment#helpful, where the page shows the thank-you line and one button to change the answer, which sends the earlier one asprevious(any otherthanksvalue is ignored); a small script posts the form in place withAccept: application/jsonand gets204, and falls back to the form post if that fails. The answer isno-store; an unknown or unpublished article, or a locale the center does not offer, answers the center’s404. With achat_channel_idthe page embeds<yuva-chat>under “Still need help?”, and a conversation started there carries the article. Own domains (help.example.com) are the status pages’ own domains (M19 › Own domain › Other kinds, #148): the center answers at/of its verified domain, its links,hreflang, sitemap andurlname it there. - Rendering. One goldmark instance for members’ content: GFM tables, strikethrough, autolinks,
heading ids (anchors and a table of contents from h2 and h3), fenced code without highlighting; raw
HTML is dropped. Images stay only when their URL is this server’s
/i/{token}of the same workspace, else they become links. A bluemonday policy based on the discussions’ one adds heading ids,loading="lazy"on images andrel="noopener"on outside links. HTML is rendered once at publish and stored. - Search. Postgres full-text search per language, shared by the pages, the widget, the panel and
MCP. The query is normalized, cut to 8 words of at most 50 characters and built as a
tsqueryfrom parameters, never concatenated: every word ANDed and the last one a prefix for type-ahead; when nothing matches it is tried again with OR and the results are markedpartial. Ranking ists_rank_cdwith the weights, a bonus for an exact title prefix and views over 30 days as a tie-break. Highlights are word offsets computed on title and excerpt as plain text, never HTML. The requested locale is searched, and the default locale too when the requested one has fewer than 3 published articles. A search runs with a 500 ms statement timeout on a partial GIN index of published rows. Only a final search (Enter, a result opened, or 1.5 seconds without typing) is counted; counts are buffered in process and flushed every minute, so a search never writes in its request. - Languages. The panel’s help screens have their own Lingui catalog,
help, in every panel language; the widget’s Help app uses the existingappscatalog. Server pages have a word map per language like status pages, complete in en, tr and de, with English as the fallback. The widget picks its locale from the center’slocales(exact, then base language, else the default); a page uses the locale in its path. - Caching. An in-process cache per center, view, locale, id and query, keyed on
changed_atwith a 5 minute TTL and a cap of 5,000 entries. Pages:public, max-age=60, stale-while-revalidate=300, stale-if-error=86400with anETag; client JSONpublic, max-age=60; reactions and clicksno-store. Views are counted before the cache lookup, so cached answers count; answers served by a CDN do not, and the report says views are approximate. - Abuse limits. Public pages 120 per minute per address; client search 30 per minute per address
and channel and 1,200 per minute per center (
429withRetry-After); one counted view per address, article and hour; reactions aspage-ratings(per address and channel,previousmoves the count); search clicks 60 per minute per address; the editor preview 60 per minute per caller; at most 3 cards per message; queries at most 200 characters.YUVA_HELP_MAX_ARTICLEScaps articles per workspace (unset: 500 withYUVA_SIGNUP=open, else no limit).YUVA_HELP=offremoves the feature: its routes answer404and the client inbox has nohelp.usage_counters.help_searchescounts searches per workspace and month. - Cards. The composer’s Help button and
/palette search articles; picking one adds a chip and sending postsarticle_ids. The server checks each article is published, picks the locale (the contact’s, else the inbox’s, else the center default), stores the snapshot inmessages.help_cardsand countssent. Chat and app getcardsand the widget opens the article inside its Help app; clients that do not knowcardsshow the message body, whose last line is the URL. E-mail gets “Title - URL” in the text part and a bordered block in the shared layout in the HTML part, without tracking. A later unpublish leaves old messages readable; the link then shows the center’s404text. - MCP. Yuva’s own shapes as for status pages. Article text written by members is not
customer_content; visitors’ search queries are. Tools:list_help_centers,search_help_articles,get_help_article,help_search_gaps(read-only; queries without result and articles with most “no”),draft_help_articleandupdate_help_article_draft(drafts only,base_version, alocalelets an assistant write a translation draft; the result says a member publishes it in Yuva), anddraft_replytakesarticle_ids. Resourceyuva://help-center/{id}; promptswrite_help_articleandhelp_gaps_review. No tool publishes. - Analytics. A center with an
analytics_property_idsends cookieless page views exactly as status pages do;analytics_daily_supportthen counts conversations started on help pages next to their views, with no new analytics table. Searches without result and conversations per article are Yuva counters, not analytics events: they work without a property and never hold a visitor hash. Whether the widget’s Help app sends ahelp_article_viewevent to a linked property is decided with the analytics architect before the widget step. - Importing articles (#150).
POST /v1/help-centers/{id}/importsreads a Zendesk Guide or Help Scout Docs into the center as drafts, never published, through the help-desk transport (GET only, the desk’s budget, images fetched without the token outside its hosts). Zendesk reuses the sealed OAuth sign-in of a Zendesk migration (migration_id), so it needs a migration manager (owner, admin, or a key or token withmigrations:manage); anyone else gets the same404as for an unknown id; itsreadscope already covers the Help Center API, so no scope was added. Help Scout’s Docs API takes a Docs API key (Basic auth todocsapi.helpscout.net), not the Mailbox sign-in, so the request carriesdocs_api_key, sealed inhelp_imports.sealedunder contexthelp-import:+workspace+import and cleared when the import ends; browser sessions only, so an assistant starts Zendesk imports only. Categories become collections and sections sub-collections (Docs: collections and categories), deeper sectionsParent / Child; translations map to the center’s locales (same tag, else the one center locale of that language), others are listed inskipped_locales.internal/migrate/helpdesk/htmlmd.goconverts the HTML subset to Markdown. A River job (help_import, default queue, 25-second slices, checkpoint on the row) runs the source, collections, articles and links phases;help_import_itemskeys every collection and article translation by origin, kind, source id and locale, so a re-run updates instead of duplicating, leaves an unchanged one alone and keeps a draft whoseversionmoved since (unlessoverwrite_edited). Links between imported articles are rewritten in a last pass. The same table holds the old URL, andlistHelpImportRedirectsandredirects.csvpair it with the page’s current URL; setting up redirects is the owner’s. One import per center at a time, 10 starts an hour per workspace. Drafts sendhelp.article.updated;help.import.updatedandhelp.import.progressare realtime signals forhelp:writeholders who see the inbox, never stored or sent to webhooks.
Roadmap board (M21)
A workspace shows its customers what it is building and lets them say what they need: a roadmap board per inbox with ideas in stages, votes and suggestions from readers, and the feedback behind each idea. Being the support inbox is the point. A feedback about the same need is linked to the idea instead of being answered again. Moving the idea tells every linked customer where it stands, and when the idea ships, one reply reaches all of them on their own channel. An idea is a discussion of its own kind, so posts, votes, follows, moderation, reader accounts, rendering and notifications are the ones of M12.
-
Concepts. A board belongs to an inbox (one per inbox at most), is switched on by creating it, and is
publicor not. A private board is a triage tool for the team only. An idea is a discussion withkindideaand no page. It has a stage:ideas,planned,in_progress,shippedorclosed. A link ties one feedback conversation to one idea. An idea has many links, and a feedback has at most one. -
Tables. Every table carries
workspace_id, with composite foreign keys(workspace_id, x_id).-
roadmap_boardsholds:inbox_id(unique per workspace) andchannel_id(the chat channel of the inbox that the public page embeds and member-made ideas are filed on; required)- name, description, and
slug(unique across the server,a-z0-9-, 3-48 characters, the reserved words of status pages) public(default false),suggestionsoff|moderated|open(defaultmoderated) andanalytics_property_idchanged_at, moved by every change the public side shows except votes (the cache key)
roadmap_board_slugskeeps former slugs, which answer301as for status pages. Slug checks, reserved words, availability and the redirect are the status pages’ helper, made generic for status, help and roadmap. The page’s logo and accent colour are the inbox’sbranding(logo_url,color), so there is no second place to keep them. -
discussionsgains:kind(pagedefault,idea) andboard_id, which is set exactly whenkind = 'idea'(FK to the board,ON DELETE CASCADE, so deleting a board deletes its ideas)stage, which is set exactly whenkind = 'idea', andstage_changed_atvote_count, the opening post’s votes, kept on the row in the vote’s transaction because the board sorts by itsearch, atsvectorgenerated from the title with thesimpleconfiguration (İ/ıfolded)
pagebecomes nullable, withCHECK ((kind = 'page') = (page IS NOT NULL)). An index on(workspace_id, board_id, stage, vote_count DESC, id)serves the board. Every existing page query (docs pages, sites, summary, the client page list) addskind = 'page', so ideas never count as documentation threads. -
roadmap_idea_conversations:conversation_id,idea_id,linked_by_member_id,linked_by_api_key_idandlinked_at, with primary key(workspace_id, conversation_id), which makes the link many to one. Both FKs cascade. It is shaped likestatus_incident_conversations. -
roadmap_stage_changes: idea,from_stage,to_stage, the member or key and the grant,via,progress_setandprogress_skippedcounts, and time. It is the idea’s history in the panel and the “Planned on”, “Shipped on” dates on the public page. -
status_incident_repliesandstatus_incident_reply_targetsare renamedlinked_repliesandlinked_reply_targets.linked_replies.incident_idbecomes nullable next to a newidea_id, withCHECK (num_nonnulls(incident_id, idea_id) = 1). “Reply to linked” is one mechanism for incidents and ideas, not two. -
reader_notifications.kindgainsstage.
-
-
Stages and progress. Agents with access to the inbox move an idea’s stage, and so do owners and admins. A move is
POST /v1/discussions/{id}/stagewithstageand an optionalcomment, which is posted as the member’s published reply in the same transaction. The move writes aroadmap_stage_changesrow, moveschanged_atand storesdiscussion.stage_changed.- Progress on linked feedback. For
planned,in_progress,shippedandclosed, the move also queues oneroadmap_progressRiver job. It sets every linked feedback’s progress:plannedtoplanned,in_progresstoin_progress,shippedtodoneandclosedtowont_do. A move back toideaschanges no progress. - How the job runs. It walks the links in batches of 500. Each conversation changes in its own
transaction through the same code as setting progress on the conversation update, so the timeline
gets a
feedback_progressevent (withidea_idin its data, shown as “via idea …”), the contact sees the line, andconversation.updatedgoes to webhooks. Feedback that already has that progress, and deleted conversations, are skipped and counted. Before each batch the job reads the idea’s stage again and stops when it no longer matches its change, so a newer move wins and two moves never interleave. The job checks its caller again as “Reply to linked” does: a revoked key or grant, a removed member or a lost scope sets nothing. - Later changes. A member may still set a linked feedback’s progress by hand. It holds until the
next move. Linking a feedback to an idea past
ideassets its progress at once, in the link’s transaction. Unlinking leaves progress as it is. - Votes and replies after the end.
shippedandclosedideas take no new votes (409 idea_closed). Replies follow the lock rules of M12. Ideas have no accepted answer, and…/answeranswers409 not_supported.
- Progress on linked feedback. For
-
Linking and Reply to linked.
- Linking. Only
feedbackconversations link (409 not_feedback), and only to an idea of a board of the same inbox (404otherwise). A link replaces the feedback’s previous link. An idea takes at most 5,000 links (422 too_many_links, the incidents’ limit and code). - Starting an idea from feedback.
POST /v1/conversations/{id}/discussiontakeskind: idea. It starts a published idea with the title and body the member writes and links the conversation. The author rule of M12 applies: the contact when it is a known user, else the member. Nothing of the feedback becomes public. - Reply to linked. It is the incidents’ mechanism, unchanged: one reply written once to every open
linked conversation, optionally resolving them, one job per conversation through the normal reply
path, with outcomes on
linked_reply_targets. The River job kind becomeslinked_reply, and a worker forstatus_replystays for one release so queued jobs finish. The job’s required scope follows the source:status:managefor incidents,roadmap:writefor ideas, plusmessages:write(andconversations:writeto close). When an idea moves toshipped, the panel offers “Reply to linked” right away.
- Linking. Only
-
Suggestions and votes. These follow the discussion write rule. A reader token, an identity-token contact session or a member writes. Anonymous visitors only read, and there are no anonymous votes.
- Moderation. A board’s
suggestionsmode works as a channel’sdiscussionsmode does for page threads.moderated(the default) holds a reader’s idea aspendinguntil one of their posts in the workspace has been approved.openpublishes at once.offtakes no suggestions, but votes and replies still work. Pending ideas sit in the existing moderation queue (/v1/discussion-posts,state=pending, items carrykind), and spam marking is M12’s. - Votes and following. A vote is the existing vote on the idea’s opening post. Voting follows the idea.
- Notifying followers. A move to
planned,in_progress,shippedorclosedadds astagereader notification for every follower linked to a person. It queues the existing discussion e-mail job, so the digest lists the stage change next to the replies, with the same delay, unsubscribe and locale rules. - Reader tokens. They are issued for a channel when it has discussions on, or when its inbox has a
public board. The origin must be one of the channel’s, or
YUVA_PUBLIC_URL, where the server’s own pages live, as/client/v1already counts it.
- Moderation. A board’s
-
Endpoints. Tag
roadmap.- Members.
- Boards:
/v1/roadmap-boards: list, create, get, update, delete, andGET …/{id}/preview(the public page for a sandboxed frame). - Ideas are discussions.
GET /v1/discussionstakeskind(defaultpage, so existing callers see no change),board_id,stage,sort(votes,new,activity) andq(the title search). Members start ideas withPOST /v1/discussionsandkind: idea, and retitle, lock, hide and delete them with the existing calls. - Stages:
POST /v1/discussions/{id}/stageandGET /v1/discussions/{id}/stage-changes. - Links:
PUTandDELETE /v1/discussions/{id}/conversations/{conversationId}. Linked feedback isGET /v1/conversations?idea_id=with its filters, andidea=nonelists feedback without one. AConversationcarriesidea(id,title,stage) when linked. - Replies:
POST /v1/discussions/{id}/linked-repliesandGET …/linked-replies/{replyId}, the incident schemas made shared (LinkedReplyCreate,LinkedReply,LinkedReplyTarget).
- Boards:
- Client, for
chatkeys:GET /client/v1/channels/{channel_key}/roadmapreturns the board: name, description, URL,suggestionsand counts per public stage.- The existing
GET …/discussionsand…/discussions/{id}takekind=ideawithstage,sort(top,new) andqinstead ofpage. POST /client/v1/discussionstakeskind: ideawithoutpage_url.- Votes, replies, follows, edits and deletes are the existing calls.
- Answers:
404 roadmap_offwithout a public board.ClientInbox.roadmap(url,suggestions) is present only with a public board, and the Roadmap tile shows only then.closedideas are left out of public lists, while their own URL answers with the stage.
- Members.
-
Scopes and access.
roadmap:read(boards, stage history, linked counts),roadmap:write(links, linked replies, board settings for keys) androadmap:stage(moving a stage). Reading ideas through/v1/discussionskeepsconversations:read, and linking also needs it.- Which keys hold them. The first two go to keys made after M21 without named scopes.
roadmap:stageis never implied and must be named, likestatus:manage. No existing key gains any. - Roles. Board settings and deleting a board are for owners and admins. Agents with access to the
inbox link feedback, start ideas and move stages. Key inbox limits and OAuth narrowing apply as
everywhere, and a board or idea of another inbox answers
404.
- Which keys hold them. The first two go to keys made after M21 without named scopes.
-
Events and webhooks. Ideas send the existing
discussion.created,.post_createdand.updated, withkindandstageon the discussion. The newdiscussion.stage_changed({discussion, from, to, linked}) is a stored event for members who see the inbox and a webhook type. Links store no event, as with incidents. Progress set by the job sends the usualconversation.updated. Board changes reach/v1/realtimeasroadmap.board.updated(not stored). -
Public page. It is rendered by the server with
html/templateand needs no JavaScript. It uses the style, fonts, CSP builder and cache of status and help pages.- Routes.
/roadmap/{slug}shows columns for Ideas, Planned, In progress and Shipped (the last 90 days, with “All shipped” at?stage=shipped). Ideas are sorted by votes, with title, excerpt, votes, comment count and the stage date./roadmap/{slug}/ideas/{id}shows the idea, its stage history and its published replies, authors by display name and initials only. - Head tags. Canonical link, Open Graph and JSON-LD
BreadcrumbList. - Not found. A private board, an unknown slug and a pending or hidden idea answer the plain
404text of status pages. - Voting and suggesting. The page embeds
<yuva-chat>on the board’s channel. “Vote” and “Suggest an idea” open its Roadmap app at that idea through the element’s newopenApp("roadmap", {idea}). Without JavaScript the page reads complete and the buttons are absent. - Analytics. With an
analytics_property_idthe page sends cookieless page views as status pages do. - Own domain. A board answers at
/of its verified own domain like a status page (M19 › Own domain › Other kinds, #148); a private board answers404there too. A separate origin for every board is not planned.
- Routes.
-
Rendering. Idea bodies and replies are discussion posts: Markdown rendered by M12’s goldmark and sanitized by bluemonday’s UGC policy into
body_html. There is no second renderer. Titles are 3 to 200 characters and bodies up to 20,000, as for discussions. -
Search. The title search serves the panel’s “Link to idea” picker, the widget’s “similar ideas” while a reader types a suggestion, and MCP. It uses M20’s query builder: normalized, 8 words, the last one a prefix, parameters only, a 500 ms timeout.
-
Caching. It reuses the public pages’ in-process cache, keyed on the board’s
changed_atwith a 60-second TTL. Votes do not movechanged_at, so a count may lag a minute. Pages are sent withpublic, max-age=60, stale-while-revalidate=300, stale-if-error=86400and anETag. Client JSON ispublic, max-age=60without a session andprivate, no-storewith one, as discussions are. -
Abuse limits.
- Public pages: 120 a minute per address.
- Suggestions and replies: M12’s 10 posts a minute and 60 an hour per author, and the client write limits per address and channel.
- Moderation queue: at most 200 pending ideas per board, beyond which
429 suggestions_fullis sent withRetry-After. - Votes: 120 an hour per author.
- Search: 30 a minute per address and channel, queries at most 200 characters.
- Links: at most 5,000 per idea.
YUVA_ROADMAP_MAX_IDEAScaps ideas per workspace (unset: 2,000 withYUVA_SIGNUP=open, else no limit).YUVA_ROADMAP=offremoves the feature: its routes answer404and the client inbox has noroadmap.
-
Languages.
- Ideas are written by readers in any language and are not translated.
- Stage names and page words come from the server’s page word map shared with help pages, complete in
en, tr and de with English as fallback.
?lang=and the locale rules are those of status pages. - The panel’s roadmap screens have their own Lingui catalog,
roadmap, in every panel language. - The widget’s Roadmap app uses the
appscatalog.
-
Panel.
- Navigation. A Roadmap entry in the pages menu (
/board, shortcutg p;/roadmapis the public pages’ path andg ris Reports) follows the inbox filter: each visible inbox’s board, or “Create board” for owners and admins. - The board. It opens as columns per stage. Cards show votes, linked feedback count and the pending mark. Dragging a card or using its stage select moves the stage, after a confirmation that names how many linked feedback get which progress. A pending strip lists suggestions waiting for approval.
- An idea. It opens beside the board with the discussion thread (the Docs thread pane, reused), its
stage history, its linked feedback (the incidents’ linked list and “Reply to linked” dialog, made
generic) and, after a move to
shipped, the “Reply to linked” offer. - On feedback. The feedback header gets “Link to idea” (search the inbox’s board, or “New idea from this feedback”). The feedback row shows the idea as a chip.
- Settings. Owners and admins see Settings: public, suggestions, channel, slug, name, description, analytics property and delete.
- Live updates. The board refreshes on
discussion.*androadmap.board.updated.
- Navigation. A Roadmap entry in the pages menu (
-
Widget. Home gets a Roadmap tile when
inbox.roadmapis present. The Roadmap app is in the apps chunk: tabs by stage, ideas by top votes, the idea view with its body, votes and replies, and “Suggest an idea” with similar ideas while typing.- Signing in. An identity-token session votes and suggests at once. An anonymous visitor who votes
or suggests gets the reader sign-in popup (
client/reader.ts, as<yuva-discussions>uses). - After suggesting. A pending idea shows “Waiting for approval” to its author.
- Reuse. The thread rendering and composer are the docs ones, imported into the apps chunk; the check reports the gzip size.
- Signing in. An identity-token session votes and suggests at once. An anonymous visitor who votes
or suggests gets the reader sign-in popup (
-
shadcn. Items on the discussion hooks:
use-yuva-roadmapwrapsuse-yuva-discussionswithkind=idea, stage and sort.yuva-roadmapshows stage tabs and the list.yuva-ideashows the detail with vote, built onyuva-discussion-threadandyuva-discussion-composer.yuva-idea-suggestis the suggest form with similar ideas.- Each item lists its registry dependencies instead of copying them.
-
MCP. Yuva’s own shapes. Idea titles and bodies and comment text go under
customer_content, because readers write them.list_roadmap_ideas(board, stage,q, sort) andget_roadmap_idea(votes, stage history, linked feedback count, and how many linked feedback a move to each stage would change) are read-only withconversations:readandroadmap:read.link_feedback_to_ideaandunlink_feedback_from_ideaneedroadmap:writeandconversations:read, and carryidempotentHint.move_idea_stageis listed only to principals holding the namedroadmap:stage. It carriesopenWorldHint(customers see the progress) and needsconfirm_linkedequal to the countget_roadmap_ideashowed for that stage; otherwise it answers409 confirm_mismatch.- Resource
yuva://roadmap/{board_id}. - Prompt
link_feedback_to_ideas: it lists feedback with categoryideaandidea=none, searches the board and proposes links. It changes nothing until the person agrees, and it never moves a stage. - No tool creates, edits or moderates ideas, and none sends “Reply to linked”.
-
Elsewhere in this document. Add
roadmap:read,roadmap:writeandroadmap:stageto the scopes table and the “never implied” sentence. Adddiscussion.stage_changedto the webhook events. In “Live chat”, replace “a roadmap … have no client API yet” with the Roadmap tile. Add/roadmap/{slug}to the API surfaces table. In “Discussions (M12)”, say thatkindseparates page threads from ideas. -
As built (steps 1 and 2). Where the build differs from the text above, this wins.
- Triggers.
discussions.searchanddiscussions.vote_countare kept by triggers, not a generated column or the vote’s handler: a generated column rewrites the table, and a trigger also covers merges, account deletion and cascades. The backfill runs under a share lock on the votes after the trigger exists, so the count ends exact. - Contract. The API has
votes(the opening post’s) and novote_count.Discussion.pageis an empty string for ideas.GET /v1/discussionstakessort=votesnext totop.YUVA_ROADMAP_MAX_IDEASanswers422 hosted_limit.…/{id}/previewmoves to step 3. A move to the stage the idea is in changes nothing and returns nochange. Writes on a discussion that is not an idea answer409 not_an_idea, reads404.ReaderNotificationKindgainsstage. - Stage changes also hold
linked,progress,comment_post_idandfinished_at. Each per-conversation transaction ofroadmap_progresslocks the idea row first (idea, then conversation, as linking does) and sets nothing unless its change is still the idea’s latest, so an older move never overwrites a newer one. - Private boards mail nobody. Ideas on a private board are not followed by their author, send no stage or reply notifications and no digest, even when a contact is the author.
- Channels. A board’s channel cannot be deleted while the board exists
(
409 channel_has_roadmap_board; the foreign key has no cascade). Every idea is filed on the board’s channel, and changing the board’s channel moves its ideas. - Moving feedback. Moving a conversation to another inbox unlinks it from its idea, since a board belongs to one inbox; its progress stays.
- Triggers.
-
As built (step 3).
/roadmap/{slug}and/roadmap/{slug}/ideas/{id}use the status page shell with the roadmap word map (roadmap_words.go, en, tr, de, English fallback). The page’s language is the inbox’s,?lang=picks another. Routes are always registered and answer the plain404whenYUVA_ROADMAP=off. A private board, an unknown slug and a former slug of a private board answer the same404; an unpublished idea, one of another board and a bad id too. Pages are cached per board, view, idea and language onchanged_atfor 60 seconds and rate limited to 120 a minute per address. Vote and Suggest are buttons that only the page script reveals. The page sends no analytics yet (neither do status or help pages), soanalytics_property_idis stored only.GET /v1/roadmap-boards/{id}/previewrenders the board or a published idea without the chat element, also while private. MCP:list_roadmap_ideas,get_roadmap_idea,link_feedback_to_idea,unlink_feedback_from_idea,move_idea_stage(listed only to a key or grant that namesroadmap:stage, and it answers409 confirm_mismatchunlessconfirm_linkedequals thewould_changecount for that stage), resourceyuva://roadmap/{board_id}, promptlink_feedback_to_ideas;list_feedbacktakeswithout_idea. Idea text is undercustomer_content. -
Not in M21. Merging duplicate ideas, a
<yuva-roadmap>web component, the roadmap in the Swift and Kotlin SDKs, own domains, and private boards visible to signed-in customers. -
Order of work. Each step is one agent. Changes to the contract, the migration and permissions go through
/code-reviewbefore commit.-
yuva-api, contract. Add the
roadmaptag, the board schemas,kind,stage,board_id,vote_countandideaonDiscussionandConversation, thekindandstageparams, the stage and link operations, and the sharedLinkedReply*schemas (incident operations pointed at them). AlsoClientInbox.roadmap, the client board operation, the three scopes,discussion.stage_changedandConversationCreateDiscussion.kind. Check: the redocly lint command. -
yuva-api, model and API.
- The migration: discussions columns and checks, the board tables, links and stage changes, the
rename to
linked_replieswithidea_id, and thestagenotification kind. kind = 'page'on every page query, and the sqlc queries.- The board and idea handlers, stage moves with the
roadmap_progressjob, links, the generic linked-reply job with thestatus_replyalias, the reader-token rule, and the client operations. - Events, webhooks and limits.
- Tests for: progress mapping and supersession, the many-to-one link, scope checks with
roadmap:stagenever implied, page queries without ideas, and incidents’ “Reply to linked” unchanged.
Check: in
api/,go generate ./... && go vet ./... && go test ./... && go build ./...withYUVA_TEST_DATABASE_URL, thensdk/go’s check. - The migration: discussions columns and checks, the board tables, links and stage changes, the
rename to
-
yuva-api, public page and MCP.
/roadmap/{slug}and the idea page with the shared page shell, words in en, tr and de, cache, rate limit and the slug helper made generic. Then the MCP tools, resource and prompt. Check: as step 2. -
yuva-panel. The Roadmap rail entry, board columns, idea pane, Settings, “Link to idea” in the feedback header and the row chip, the generic linked list and “Reply to linked” dialog shared with status, and the
roadmapcatalog. Check: inweb/,npm run -s format:check && npm run -s lint && npm run -s extract && npx lingui compile --strict && npm run -s build. -
yuva-widget. The Roadmap tile and app in the apps chunk,
openAppon<yuva-chat>, the reader popup for votes and suggestions, and the four shadcn items. Check: insdk/js/,bun run check && bun run build; insdk/shadcn/,bun run check;examples/shadcn-nextnpx next build. -
yuva-docs. A roadmap guide in en, tr and de (board, stages and progress, linking, “Reply to linked”, the widget and shadcn items, MCP) and README lines. Check: links resolve, and every documented endpoint exists in
openapi/.
-
What’s new (M22)
A workspace tells its customers what changed: a What’s new feed per inbox of short entries labelled New, Improved or Fixed, shown in the widget’s Home with an unread count, on a public page, in an Atom feed, and, when the team chooses, mailed to its subscribers as a broadcast. Being the support inbox is the point. A customer sees that the bug they reported is fixed where they would have asked about it. The mail goes out through the broadcast flow the workspace already trusts, and nothing new sends mail. Entries are their own table, not help articles. They are dated, labelled and scheduled, and they never appear in help search. Writing, rendering and translating are M20’s.
-
Concepts. A changelog belongs to an inbox (one per inbox at most) and has a public slug, the locales it publishes and
published. An entry has labels, an optional image, a state (draft,scheduledorpublished), and one translation per locale. A translation has a working draft and, once published, a frozen published copy, as help articles have. Unread is kept in the visitor’s browser only. -
Tables. Every table carries
workspace_id, with composite foreign keys(workspace_id, x_id).-
changelogsholds:inbox_id(unique per workspace), name, description, andslug(unique across the server,a-z0-9-, 3-48 characters, the reserved words of status pages)default_localeandlocales(1-20)agents_may_publish(default false),analytics_property_idandpublishedchanged_at, moved by every change the public side shows (the cache key)
changelog_slugskeeps former slugs, which answer301through the slug helper status, help and roadmap share. Logo and accent colour are the inbox’sbranding. -
changelog_entriesholds:- the changelog, a per-changelog
numberfor URLs, andlabels(a non-empty subset ofnew,improved,fixed) image_id(anemail_imagesrow of the workspace,ON DELETE SET NULL)state,publish_at(set exactly whenscheduled, at most 365 days ahead),published_at(the date shown, the sort key and the unread mark) andscheduled_by(member or key)- creator and timestamps
An index on
(workspace_id, changelog_id, published_at DESC, id)covers published rows. - the changelog, a per-changelog
-
changelog_entry_translationsis keyed by(entry, locale). Its fields followhelp_article_translations: a drafttitle(3-200),body(Markdown, 50,000 characters) andslug;version(writes carrybase_version,409 version_conflict); theemail_imagesthe draft uses; the frozenpublished_*copy withpublished_htmlrendered once at publish and an excerpt (300 characters of plain text); andhas_unpublished_changes. There is no search vector and no revision table: the draft and the published copy are the two versions. -
broadcasts.changelog_entry_id(nullable,ON DELETE SET NULL) records which broadcasts were made from an entry. -
chat_channels.announce_updates(boolean, default false). -
DeleteUnusedEmailImagesalso keeps images referred to by an entry or a translation draft, so the weekly cleanup never removes an entry’s picture.
-
-
Writing, publishing, scheduling. Agents with access to the inbox write entries and translations.
- Who publishes. Publishing, scheduling, unpublishing and deleting a published entry are for owners
and admins, unless the changelog’s
agents_may_publishis on, which lets agents with inbox access do them too, exactly as in M20. API keys holding the namedchangelog:publishpublish (a release pipeline posting its entry). MCP and OAuth tokens never publish or schedule, whatever the setting. - Publishing. It needs a translation in the default locale. It freezes and renders every
translation that has a draft, sets
published_atthe first time, moveschanged_at, signals the inbox’s contact connections (aninbox.updatedthrough the hint status uses) and storeschangelog.entry.published. A translation added or edited later is published on its own withlocale. Republishing keeps the date. - Scheduling. It sets
publish_at. A River job at that time, plus a sweep every minute, publishes with one conditional update (scheduledandpublish_at <= nowtopublished), so a duplicate job does nothing. The job checks the scheduler again: a member who lost the right to publish, a revoked key or a lost scope puts the entry back todraftwithschedule_failed, which the panel shows. Unscheduling returns it todraft. - Editor. As in M20: the default-locale text beside the one being translated, outdated and missing
translations marked, and no translation model. A save needs
base_version, and another member’s open editor gets the realtime-only “changed elsewhere” signal.
- Who publishes. Publishing, scheduling, unpublishing and deleting a published entry are for owners
and admins, unless the changelog’s
-
Mail this to subscribers.
POST /v1/changelogs/{id}/entries/{entryId}/broadcasttakeslocale,list_ids(1-10 lists of the inbox) and an optionalchannel_id. It is for owners, admins and keys withbroadcasts:write(requireBroadcastWriter), and only for a published entry (409 not_published). It builds the draft from existing parts:- The design.
documentFromTemplatewithproduct-updatein the entry’s locale (else English). Thentitlegets the entry’s title,releasethe labels and date in the locale, andintroand the blocks after it the body. The body is rendered by the M20 renderer and mapped:h2/h3become heading blocks, workspace images become image blocks, and paragraphs, lists and quotes become text blocks through the design’s own rich-text policy. A table or code block the policy cannot carry is replaced by a line linking to the entry.herobecomes the entry’s image or is removed.f1-f4are removed. Thechangelogbutton links to the entry’s public page. - The broadcast. The existing
CreateBroadcastwith name “What’s new: {title}”, subject = title, preheader = excerpt, the lists as audience andchangelog_entry_id.checkAudiencerefuses status lists as for any broadcast. - What follows. The answer is the broadcast, and the panel opens it in the broadcast composer. Review, test sends, consent, unsubscribe, approval, pace and sending are M13’s, unchanged. Nothing is scheduled by this call, and MCP never makes it.
- The design.
-
Endpoints. Tag
changelog.- Members, under
/v1/changelogs:- Changelogs: list, create, update, delete, and a preview rendered for a sandboxed frame.
- Entries: list with filters for state
draft,scheduled,publishedorchanged, and forlabelandlocale; create, update (labels, image) and delete. - Translations:
PUTandDELETE, withbase_version. - Actions:
publish(optionallocale),schedule(publish_at),unschedule,unpublish, and the broadcast call above. - Editor support: image upload into
email_images(same rules and size cap, throughstoreEmailImage) and the Markdown render for the editor, which is M20’s. If M20 ships it under a help-center path, step 1 moves it toPOST /v1/markdown/renderfor both.
- Client, for
chatandappkeys, under/client/v1/channels/{channel_key}/whats-new:- The changelog (name, URL, locales) with published entries newest first: number, title, excerpt,
html, labels, image URL and size,published_at, URL, and the locale actually served (falling back to the default). Cursor-paged. …/whats-new/{entryId}for one entry.
- The changelog (name, URL, locales) with published entries newest first: number, title, excerpt,
- Client rules.
- Browsers need an allowed origin, and nothing creates a contact.
- Without a published changelog the answer is
404 whats_new_off. ClientInbox.whats_new(url,locales,default_locale,latest_published_at) is present only with a published changelog that has an entry. The tile shows only then.ClientChatSettings.announce_updatescarries the channel setting.- There are no client writes.
- Members, under
-
Scopes and access.
changelog:read,changelog:writeandchangelog:publishare API key scopes. The first two go to keys made after M22 without named scopes.changelog:publishis not implied and must be named, and the consent page never offers it, since tokens cannot publish. No existing key gains any. “Mail this to subscribers” also needsbroadcasts:writeandlists:read. Key inbox limits and OAuth narrowing apply as everywhere, and a changelog of another inbox answers404. -
Events and webhooks.
changelog.entry.published(also when a schedule fires, and on republish),changelog.entry.unpublishedandchangelog.entry.deletedare stored events for members who see the inbox, and webhook types, with{changelog, entry}as data. Draft saves reach/v1/realtimeonly. -
Public page and feed. They are rendered by the server with
html/templateand need no JavaScript. They use the style, fonts, CSP builder and cache of status and help pages.- Routes.
/changelog/{slug}redirects to/{default_locale}/. Then:/{locale}/: entries newest first,?label=and?before=for paging/{locale}/entries/{number}-{slug}/{locale}/feed.atom: the newest 50 published entries in that locale, each with itspublished_htmlascontent type="html", its labels as categories andupdatedfrom its last publish, through the Atom writer of status pages made shared/sitemap.xml
- URLs. A wrong entry slug answers
301to the canonical one. There is noAccept-Languageredirect. - Head tags.
hreflangalternates for published translations, a canonical link, Open Graph (with the entry’s image) and JSON-LDBlogPostingandBreadcrumbList. - Not found. An unpublished changelog, a draft or scheduled entry and an unknown locale answer the
plain
404text of status pages. - Analytics. With an
analytics_property_idthe pages send cookieless page views as status and help pages do. - Own domain. A changelog answers at
/of its verified own domain like a status page (M19 › Own domain › Other kinds, #148), with its feeds and sitemap there.
- Routes.
-
Rendering. M20’s one goldmark instance for members’ content and its bluemonday policy: images only from this server’s
/i/{token}of the same workspace, raw HTML dropped, rendered once at publish and stored. The entry image is served from/i/{token}with its immutable cache. -
Unread and the badge.
- Where the mark lives. The widget keeps
whats_new_seen(the newestpublished_atthe visitor opened) in its stored state per channel (readStored/writeStored, localStorage keyed by channel key). Anonymous visitors get unread state too, and the server stores nothing. - Counting. Without a mark, entries older than 30 days count as read. Unread is the number of
entries newer than the mark, shown up to “9+”. The widget fetches the list only when
latest_published_atis newer than the mark. - Clearing. Opening the app marks everything shown as seen.
- Live updates. A publish reaches widgets with a live connection through
inbox.updated; a visitor without one gets it when the panel opens or the tab becomes visible again, at most once a minute. A newerlatest_published_atthan the held list refetches the list past the browser cache. - The badge. The Home tile always shows the count. The launcher badge shows it only when the
channel’s
announce_updatesis on, and only while there are no unread messages. Messages keep the badge, and the update count has its own accessible label (“N updates”).
- Where the mark lives. The widget keeps
-
Caching.
- In-process: the public pages’ cache per changelog, view, locale, label and cursor, keyed on
changed_atwith a 5-minute TTL and the shared entry cap. - Pages and the feed:
public, max-age=60, stale-while-revalidate=300, stale-if-error=86400with anETag. - Client JSON:
public, max-age=60. Because the client side has no sessions or writes, every answer is cacheable.
- In-process: the public pages’ cache per changelog, view, locale, label and cursor, keyed on
-
Abuse limits.
- Public pages and feeds: 120 a minute per address.
- Client reads: 120 a minute per address and channel, and 2,400 a minute per changelog (
429withRetry-After). - The editor preview and render: 60 a minute per caller.
- Image uploads: the
email_imagesrules. - Scheduling: at most 50 scheduled entries per changelog.
- “Mail this to subscribers”: counts as a broadcast draft, inside M13’s hosted limits.
YUVA_CHANGELOG_MAX_ENTRIEScaps entries per workspace (unset: 1,000 withYUVA_SIGNUP=open, else no limit).YUVA_WHATS_NEW=offremoves the feature: its routes answer404and the client inbox has nowhats_new.
-
Languages. Translations exist only in the changelog’s locales, following M20’s pattern. The widget picks its locale from
locales(exact, then base language, else the default), and a page uses the locale in its path. Labels and page words come from the server’s page word map shared with help pages, complete in en, tr and de with English as fallback. The panel’s screens have their own Lingui catalog,changelog, in every panel language. The widget’s app uses theappscatalog. The broadcast takes the template’s words in the entry’s locale. -
Panel.
- Navigation. A What’s new entry in the pages menu (
/updates, shortcutg w) follows the inbox filter: each visible inbox’s changelog, or “Create” for owners and admins. - The list. Entries with state, labels, date and translation marks.
- The editor. M20’s Markdown editor and side-by-side translation, the label chips, an image picker
over
email_images, and Publish, Schedule, Unpublish for those allowed. Others see “A member who may publish does it”. - Mailing. “Mail this to subscribers” for owners and admins on a published entry: a dialog picking
lists (the inbox’s lists of kind
list), channel and locale, which then opens the broadcast. The entry lists its broadcasts and their states. - Settings. Owners and admins see Settings. The chat channel page gets the
announce_updatesswitch. - Live updates. Lists refresh on
changelog.*.
- Navigation. A What’s new entry in the pages menu (
-
Widget. Home gets a What’s new tile with the unread count when
inbox.whats_newis present. The app is in the apps chunk: entries newest first with label chips, date, image and body, and a link to the public page. There are no shadcn items or SDK screens in M22.useyuva’s client getswhatsNew()so React sites can build their own. -
MCP. Yuva’s own shapes. Entry text written by members is not
customer_content.list_whats_new_entriesandget_whats_new_entryare read-only withchangelog:read.draft_whats_new_entry(title, body, labels,locale) andupdate_whats_new_draft(base_version,localefor a translation draft) needchangelog:write. Their result says a member publishes it in Yuva.- Resource
yuva://changelog/{id}, and promptdraft_release_notes(from the commit subjects or notes the person gives, never fetched by Yuva). - No tool publishes, schedules, unpublishes or mails an entry.
-
Elsewhere in this document. Add
changelog:read,changelog:writeandchangelog:publishto the scopes table and the “never implied” sentence. Add the threechangelog.entry.*types to the webhook events. In “Live chat”, replace “a changelog … no client API yet” with the What’s new tile and addannounce_updatesto the chat channel settings. Add/changelog/{slug}to the API surfaces table. Under “Images”, say entries keep their images. -
Not in M22. Reactions or comments on entries, per-contact read state on the server, linking entries to shipped ideas, What’s new screens in the Swift and Kotlin SDKs, own domains, and mailing without the broadcast composer.
-
As built (steps 1 and 2). Where the build differs from the text above, this wins.
- Contract.
renderMarkdownatPOST /v1/markdown/renderis new and shared (any member, key withhelp:writeorchangelog:write);renderHelpMarkdownstays because the panel uses it. The changelog preview (previewChangelog) ships with the public pages in step 3.ClientChatSettings.announce_updatesis optional in the schema (absent meansfalse) so SDKs keep working against older servers; the server always sends it.ChatChannel.announce_updatesis required.YUVA_CHANGELOG_MAX_ENTRIESanswers422 hosted_limit. - Tables. Migration
00084_whats_new.sql. Entries also holdschedule_failed(lost_right,key_revoked,key_scope_lostorno_default_translation) andschedule_failed_at; a new schedule clears them. Translations keepimage_idsof the draft and the published copy, as help articles do. - States.
unpublishreturns a published entry todraft, drops every published copy and keepspublished_at, so publishing again keeps the date.publishwithlocaleneeds a published entry (409 not_published) and publishes that translation only; republishing freezes only translations that changed. A published or scheduled entry keeps its default-locale translation (409 default_translation), and changing the changelog’sdefault_localeis refused while one of them lacks a translation there (409 default_locale_missing). Changing labels or the image of a published entry, and deleting a non-draft entry or a published translation, need the right to publish. A scheduled entry goes public as it is when its time comes, so changing it, saving or deleting its translations also need that right (403 entry_scheduled; tokens403 member_session_required). - Scheduling. The job a schedule queues is not unique; a schedule that moves leaves the first job,
which finds the entry not yet due. The sweep (every minute, across workspaces) queues unique
sweepjobs. Both end inPublishScheduledEntry: it locks the changelog and then the entry, returns unless the entry is stillscheduledand due, asks again whether the scheduler may publish (the member’s role and inbox access, the key’s revocation, expiry,changelog:publishand inbox limit), and publishes withPublishDueChangelogEntry, one conditional update. - Events. The realtime signal
changelog.entry.updated(changelog_id,entry_id,locale,version,member_id) follows every change to an entry or draft, not only draft saves. Stored events and webhooks carry{changelog: {id, name, url}, entry: {id, number, labels, published_at, translations: [{locale, title, url}]}};unpublishedanddeletedlist the translations the entry had. Replacing a published translation bypublishwithlocalesendspublishedagain. Publishing, unpublishing and deleting a published entry send theinbox.updatedhint throughstatusHint. - Mail. The design is the
product-updatetemplate withlogoandf1-f4removed (the logo is the template’s placeholder),heromoved ahead of the text, the footer replaced by a line naming{{ inbox.name }}in the entry’s language (en, tr, de; the template’s other words are its own), and the body after the title.{{in the title, text, link or alt is broken so a member’s words are never merge fields; at most 150 body blocks, then a link to the entry. The release line uses the inbox’s time zone.CreateBroadcastand the entry call shareinsertBroadcast, and the call makes its design in the same transaction, so a refused draft leaves nothing behind. The excerpt (and so the preheader) has no space before punctuation. - Images.
DeleteEmailImagealso refuses an image an entry shows or a draft or published text uses (used_by.changelog_entries), as for help articles; the weekly cleanup keeps the same images. - Client.
ClientChangelog.latest_published_atis absent for a changelog without entries. Client answers carryCache-Control: public, max-age=60; there is no in-process cache for them.
- Contract.
-
As built (step 3).
/changelog/{slug}uses the status page shell with its own word map (changelog_words.go, en, tr, de, English fallback). A page shows only the entries that have a published translation in the locale of its path; there is no fallback to the default locale on pages (the client API has one)./changelog/{slug}answers302to/{default_locale}/;?label=filters and?before=(a cursor) pages, 20 entries a page. Unpublished changelogs, drafts, scheduled entries, locales outsidelocalesand former slugs of unpublished changelogs answer the same plain404; former slugs of published ones answer301. Pages, the feed and the sitemap share one cache per changelog keyed onchanged_at, 5 minutes, with theCache-ControlandETagof help pages, and 120 requests a minute per address. The Atom writer ismarshalAtominstatus_public.go, shared with the status feed, whose entries gaincategoryelements only when they have labels. The pages do not send page views: no existing public page does, soanalytics_property_idis stored only.previewChangelogrenders the home page or one entry for a sandboxed frame withnoindex; it shows published copies, or withdraft=truethe drafts of entries in any state, and works while the changelog is unpublished.- MCP.
list_whats_new_entries,get_whats_new_entry,draft_whats_new_entry,update_whats_new_draft(changelog:readandchangelog:write), the resourceyuva://changelog/{id}and the promptdraft_release_notes.changelog_idmay be left out when the caller sees one changelog. The tools call the same handlers as the API, so a token cannot publish, schedule or change a scheduled entry (403 member_session_required). Entry text is not wrapped incustomer_content, as planned.
- MCP.
-
Order of work. M22 starts after M20’s API step, whose renderer, translation and editor code it reuses. Changes to the contract, the migration and permissions go through
/code-reviewbefore commit.-
yuva-api, contract. Add the
changelogtag, the changelog, entry and translation schemas and operations, the broadcast-from-entry operation,ClientInbox.whats_new, the client operations,announce_updateson chat channel settings (member and client),Broadcast.changelog_entry_id, the three scopes and the three event types. Move the Markdown render to/v1/markdown/renderif needed. Check: the redocly lint command. -
yuva-api, model, API and mail.
- The migration and queries, including the image cleanup that keeps entry images.
- The handlers with the M20 publish rules, the schedule job and sweep, and the client operations with the cache.
- The Markdown-to-design mapping on
documentFromTemplate, and the broadcast call throughCreateBroadcast. - Events, webhooks, limits and the
inbox.updatedhint. - Tests for: the scheduled publish being idempotent and checking the scheduler again, tokens never
publishing, the mapping keeping only policy-allowed HTML and the design passing
design.Validate, and the image cleanup.
Check: in
api/,go generate ./... && go vet ./... && go test ./... && go build ./...withYUVA_TEST_DATABASE_URL, thensdk/go’s check. The generated broadcast is also rendered to Mailpit and checked with its html-check. -
yuva-api, public pages, feed and MCP. The pages and Atom feed with the shared shell, word map, cache and rate limit, and the Atom writer shared with status. Then the MCP tools, resource and prompt. Check: as step 2.
-
yuva-panel. The What’s new rail entry, list, editor (M20’s components), Settings, the “Mail this to subscribers” dialog into the broadcast composer, the
announce_updatesswitch, and thechangelogcatalog. Check: inweb/,npm run -s format:check && npm run -s lint && npm run -s extract && npx lingui compile --strict && npm run -s build. -
yuva-widget. The What’s new tile and app in the apps chunk, unread state in the stored channel state, the launcher badge behind
announce_updates, andwhatsNew()on the client. Check: insdk/js/,bun run check && bun run build. -
yuva-docs. A What’s new guide in en, tr and de (writing and translating, scheduling, the widget and badge, the feed, mailing an entry through broadcasts, MCP) and README lines. Check: links resolve, and every documented endpoint exists in
openapi/.
-
Single sign-on (M33)
Members of a workspace can sign in through the workspace’s identity provider, with OpenID Connect
(#160) or SAML 2.0 (#161). Both use the same settings row, domain claims, rules, membership, sessions
and audit; sso_settings.protocol (oidc or saml) says which one, so a workspace has one provider.
- Settings (migration 00099): one
sso_settingsrow per workspace (created on first change) holds the provider (protocol, the issuer, client id, the client secret sealed underYUVA_MASTER_KEYwith the workspace and row id as context and never returned, extra scopes, the groups claim and allowed groups) and the rules (sso_required,jit,jit_role). Owners only, with a member session (keys and OAuth tokens get403 member_session_required):GET/PATCH /v1/sso,PUT/DELETE /v1/sso/oidc,POST /v1/sso/domains,POST /v1/sso/domains/{id}/verify,DELETE /v1/sso/domains/{id}. Saving the provider reads<issuer>/.well-known/openid-configuration(itsissuermust match exactly; Entra’s sharedcommonissuer is therefore refused) and answers400 sso_discovery_failedotherwise. Removing it turnssso_requiredoff and keeps the domains. Not offered through MCP (credentials and access). - Domain claims:
sso_domainsrows,pendinguntilPOST …/verifyfinds the TXT record_yuva-sso.<domain>holding the row’syuva-verify-…token (the status-page resolver). A verified domain is unique across the server (partial unique index): a domain another workspace verified answers409 domain_takenwhen added or verified; pending claims may overlap. Only the exact domain is claimed, not subdomains. At most 50 per workspace. Removing the last verified one turnssso_requiredoff. Deleting the workspace deletes its claims in the same transaction, so a workspace waiting for its purge never holds a domain. - Daily re-check (migration 00122, #180): a verified claim no longer stays forever, since a
domain that changes hands would otherwise keep its old owner’s claim (and its sign-ins) and block
the new one. The periodic
sso_domain_sweep(hourly, default queue) lists the verified domains not looked up for 24 hours (the documented exception, every workspace, 500 at a time) and queues onesso_domain_checkper domain on theoutboundqueue (a DNS call). A lookup that finds the token clearssso_domains.missing_since; one that finds no record or no token sets it if unset, and keeps theproblemthe owner sees on the still verified domain; a failed lookup (timeout,SERVFAIL) changes neither. Seven days aftermissing_sincethe claim goes back topending:sso_requiredturns off with the last verified domain,sso_domain.lapsedis recorded bysystem(domain,missing_since,sso_required_off), every owner gets thesso_domain_lapsedmail, and another workspace may claim and verify the domain.POST …/verifyon a verified domain whose record is missing looks it up again at once. - Sign-in: the panel asks for the e-mail first and posts it to
POST /v1/auth/sso(30 a minute per client IP address). When the address’s domain is verified by a workspace with a provider, the answer carriesauthorization_url(code flow, PKCE S256,state,nonce,login_hint) andrequired, and setsyuva_sso(the state, HttpOnly, SameSite=Lax, path/auth/sso, 10 minutes), binding the sign-in to the browser; elsesso: falseand the page offers a code or a passkey. Ansso_loginsrow (state hash, nonce, verifier,return_to, 10 minutes) is taken once byGET /auth/sso/callback, which needs the cookie to equalstate, exchanges the code with the client secret and verifier, and verifies theid_tokenwith go-oidc: signature against the provider’s JWKS (kept in memory with the discovery document for an hour, fetched again when a token names an unknown key),iss,aud,exp, then the nonce. The address must be verified (email_verified: true, or Entra’sxms_edov: true, which Entra sends instead) and in a domain this workspace verified; with allowed groups, the groups claim must name one. Success redirects toreturn_to(a path on the panel, else/) with the session cookie; a refusal to/sign-in?sso_error=<code>. Every session records how it was made (sessions.methodcode,passkeyorsso, and forssothe workspace andsso_settingsrow it came through). - Membership: pending invites for the address in this workspace are accepted, never those of
other workspaces (they wait for a code or passkey sign-in). A person who is not a member joins
with
jit_role(agentby default,adminallowed, neverowner) whenjitis on (off by default), creating the person if needed: amembersrow only, inbox access follows the usual grants. A person who is not and does not become a member of the claiming workspace is refused withnot_member, whether or not they have an account. A person’s e-mail domain still decides the one provider the sign-in page sends them to. - Session scope (#180, changed decision): an
ssosession acts only in the workspace whose provider made it (sessions.sso_workspace_id), and as a reader. Until 0.1.0 it was the person’s, like a code session, so whoever controlled one workspace’s identity provider (one TXT record and any OIDC issuer or SAML IdP they run) could sign in as anyone of that domain and act as them in every other workspace they belonged to, and register a passkey that kept that access. NowresolvePrincipalpicks the session’s workspace when noYuva-Workspaceis sent and refuses any other with403 sso_session_scopeandsso_workspace_id(also on/v1/realtime); the panel then offers a code or passkey sign-in for that workspace. Approving an OAuth request for another workspace is refused the same way (the consent page lists only the session’s workspace), and a grant whosesso_settings_idis not its own workspace’s (approved that way before) no longer authenticates. Actions for the whole person are refused from anssosession with403 sso_session_scope: adding or removing a passkey, creating a workspace, deleting the account,PATCH /v1/me(name, locale and availability are the person’s in every workspace), a readernameinPATCH /v1/account, andDELETE /v1/me/sessions. It reads only its own part of the person:GET /v1/melists only its workspace,GET /v1/me/sessionsonly itself, and the push subscription endpoints list, remove and test only the subscriptions it registered and refuse to move an endpoint another session registered. Reader tokens are issued only for the session’s workspace’s channels. Web Push from another workspace skips subscriptions made under such a session. Thesso_settingsrow keeps its id when the provider changes, so replacing the provider (another protocol,issuerorclient_id, or SAMLentity_id, single sign-on URL, certificates or metadata URL saved by an owner) or removing it deletes the sessions made through it (except the caller’s), revokes the OAuth grants approved with them and clearssso_settings_idon queued actions, so they need the new provider like any other;sessions_endedandgrants_revokedcount them in the audit entry. A certificate change found by the automatic metadata refresh is the same provider and ends nothing. Owners keep their break-glass: a code or passkey session is still the person’s, andsso_requirednever refuses an owner. - Notices: the person gets
sso_first_sign_inthe first time they sign in to a workspace through its provider (sso_sign_ins, one row per workspace and person, filled from existingssosessions by the migration), andpasskey_addedorpasskey_removedwhenever a passkey is added to or removed from their account. Server mail, sent directly in the person’s locale (en, tr, de). sso_requiredis enforced on workspace access, not on sign-in. It needs a provider and a verified domain (409 sso_not_ready). Every request that acts in the workspace as a member with a session (/v1,/v1/realtime, approving an OAuth request for it) is refused with403 sso_requiredandsso_email(to send toPOST /v1/auth/sso) when the person’s address is in one of the workspace’s verified domains and the session was not made through this workspace’s provider; the check runs on every request, and realtime streams stop at their next re-check. Turning the rule on also deletes the sessions of the members it covers (not owners) that were not made through this provider, with their push subscriptions and reader tokens, and records the count assessions_revokedinsso.settings_changed(#180). Since sessions are the person’s, that signs them out of their other workspaces too; they sign in again there. Signing in with a code or a passkey is never refused for single sign-on: the person still reaches their other workspaces and the reader account (discussions on any server page). Owners are exempt whatever their session, so a broken provider never locks the workspace out. OAuth grants record whether they were approved with such a session (oauth_grants.sso_settings_id); a covered member’s grant approved otherwise (for example before the rule was on) is refused the same way until it is approved again through the provider. API keys are not member sessions and are not affected. Removing the provider or the last verified domain turns the rule off. Slack thread replies of a covered member are refused with an ephemeral message (#181). Actions a member queues (linked replies, issue links, roadmap stage changes) record thesso_settings_idof the session that queued them (migration 00123); the job that replays them (callerPrincipal) applies the same gate with it, or with the grant’s, and stops: a linked reply’s target endsfailedwithsso_required, issue and roadmap progress is left as it is and the job logs the code.- SAML 2.0 (migration 00105, #161): service-provider-initiated only, with crewjam/saml and
goxmldsig.
PUT /v1/sso/samltakes the identity provider’s metadata by URL (fetched through the outbound checks below) or pasted, refuses any DTD or other directive, and stores its entity id, the HTTP-Redirect single sign-on URL and the signing certificates (DER, at most 10) in thesaml_*columns, clearing the OIDC ones (andPUT /v1/sso/oidcclears the SAML ones);DELETE /v1/sso/samlandDELETE /v1/sso/oidcremove only their own protocol. Metadata from a URL is fetched again when a sign-in starts and the copy is over an hour old (a certificate change issso.provider_updatedbysystem,via: metadata_refresh); a failed fetch keeps the stored copy and is recorded insaml_metadata_tried_at, so the next try waits 15 minutes and sign-ins do not wait on a host that is down. Certificates past theirNotAfterare left out (named inwarningsof thePUTanswer); metadata without a certificate valid now is refused. Yuva’s entity id and audience per workspace is<public URL>/auth/saml/metadata/<workspace id>, which serves the SP metadata (ACS with HTTP-POST only, NameID formatemailAddress, no keys: Yuva neither signs requests nor takes encrypted assertions); the ACS isPOST /auth/saml/acsfor every workspace.POST /v1/auth/ssoanswers theAuthnRequestredirect URL and setsyuva_saml(the request id, HttpOnly, Secure, SameSite=None, path/auth/saml/acs, 10 minutes: the identity provider’s form POST is cross-site, so a Lax cookie never arrives). Browsers keep a Secure cookie on plain http only for localhost, soPUT /v1/sso/samlanswers400 saml_requires_httpswhenYUVA_PUBLIC_URLis http on any other host. Thesso_loginsrow is keyed by the request id’s hash (nonce and verifier empty). The ACS reads at most 256 KiB, refuses directives, needs a non-emptyInResponseToequal to the cookie (unsolicited and identity-provider-initiated responses fail asexpired, unaudited, since nothing ties them to a workspace yet), takes the login row once, then requires aResponsewithDestinationequal to the ACS, exactly one plainAssertion(noEncryptedAssertion), bearer subject confirmations with data and an audience restriction, before crewjam verifies the enveloped signature of the Response or the Assertion against the stored certificates only (a signature must reference the element that is consumed), issuer,InResponseToon the response and every confirmation,Recipient, audience, validity (MaxClockSkew180 s,MaxIssueDelay90 s). The assertion id is then recorded insaml_assertions(per workspace, kept until the assertion could no longer be accepted, at least 10 minutes); a second use is refused. The address is the NameID or the configuredsaml_email_attribute(byNameorFriendlyName), groups the attribute named bygroups_claim; SAML has noemail_verified, the domain claim is the guard. From there the sign-in is the OIDC one (claimed domain, groups, invites, JIT,ssosession naming the settings row, audit withprotocol: saml). Refusals of a verified workspace’s response areinvalid_tokenwith the check indetail; a non-success status isdenied. - Outbound calls to the issuer (discovery, keys, token) go through the webhook address checks
(
webhook.Dial): never link-local or metadata addresses, private ones only withYUVA_WEBHOOK_ALLOW_PRIVATE, no redirects, 10-second timeout, answers read up to 1 MiB. - Audit:
sso.provider_created,sso.provider_updated,sso.provider_deleted,sso.settings_changed,sso_domain.added,sso_domain.verified,sso_domain.deleted,sso_domain.lapsed,sso.signed_inandsso.sign_in_refused(reasonsfailed,invalid_token,email_unverified,domain_not_claimed,group_not_allowed,not_member), actor the member when the address is one in the workspace, elsesystem;member.joinedwithvia: ssofor JIT. Requests refused withsso_requiredare not recorded (they repeat on every call).
Issue trackers (M32)
A workspace connects GitHub and Linear so that what customers ask for becomes an issue where the team plans its work, and the issue’s state tells the customer where it stands, the way a roadmap stage does.
- Connecting. Owners and admins (and API keys without an inbox limit holding
integrations:manage) connect with a token a self-hoster gets without registering an app: a GitHub fine-grained personal access token limited to the chosen repositories (Issues: read and write), or a Linear personal API key. GitHub Apps and Linear OAuth apps are not supported. The token is checked with the tracker (GET /user, Linear’sorganization) before it is stored, sealed underYUVA_MASTER_KEYwith the integration as context, never answered and never logged;accountkeeps the name the tracker gave. A GitHub Enterprise Server is reached through itsapi_url(https, refused on private, loopback and link-local addresses when saved, as webhook URLs are). Every outbound call goes through the webhook client’s address checks, without redirects, toapi.github.com, the configured Enterprise API orapi.linear.apponly. A change or a new webhook secret locks the integration’s row in its transaction and writes only what it was sent, so a token check that takes a while never undoes a concurrent rotation. At most 20 integrations per workspace. Connect, change, disconnect and a new webhook secret write audit entries (issue_integration.*, never a token or secret). - Tables.
issue_integrations(provider, name, account,api_url,default_target, the sealedtokenandwebhook_secret, last error),tracked_issues(one row per issue of an integration that is linked: external id, key, URL, title, the tracker’s state, the mappedprogress,synced_at,next_sync_at,sync_failures,state_changed_at) andissue_links(an issue to exactly one feedback conversation or idea, who linked it, andapplied_progress). All carryworkspace_idwith composite foreign keys; links cascade with their conversation, idea, issue and integration, and an issue without links is deleted with its last link. Migration 00099. - Mapping. GitHub: open is
planned; closed as completed (or without a reason)done; closed as not planned or duplicatewont_do. GitHub issues have no in-progress state, so none is inferred from labels. Linear’s state type:triage,backlogandunstartedareplanned,startedin_progress,completeddone,canceled(andduplicate)wont_do. An idea only shows its issues and their state: an issue never moves an idea’s stage, which notifies followers and stays a deliberate action of the team, and never touches the idea’s linked feedback. - Linking.
POST /v1/conversations/{id}/issues(feedback only,409 not_feedback) andPOST /v1/discussions/{id}/issues(ideas only) takeurlto link an existing issue (a GitHub URL orowner/repo#12, a Linear URL orENG-123) ortitle,bodyandtarget(owner/repo, a Linear team key or id, or the integration’sdefault_target) to create one. A created issue’s body is what the member wrote, then a line with the conversation’s or idea’s address in the panel; nothing of the conversation and no customer’s name or address goes to the tracker unless the member writes it. A target takes at most 10 issues, an issue at most 1,000 links. The link’s transaction stores the issue, writes the link andissue_link.created, and on a feedback applies the issue’s progress at once. Linking the same issue again answers200with the existing link. Unlinking keeps the progress. - Applying the state. A feedback link is applied as the member, key or grant that made it,
through the conversation update a member makes: the
feedback_progressevent carriesissue_link_id, the contact sees the line,conversation.updatedgoes to webhooks. A key or grant withoutissues:write, and a link whose maker was removed or revoked or lost access to the inbox, records the state and sets nothing.applied_progressis set either way, so a progress set by hand holds until the issue’s mapped progress changes again. - Webhooks in.
POST /ingress/issues/{integrationId}finds the integration by its id before the workspace is known, then checks GitHub’sX-Hub-Signature-256or Linear’sLinear-Signature(and awebhookTimestampwithin a minute) with the integration’s secret: Yuva makes one (shown once, rotatable) or stores Linear’s signing secret. A missing or wrong signature answers401 invalid_signatureand changes nothing. The body is only a hint: for GitHubissuesevents that may change state and LinearIssueevents on linked issues it queues anissue_syncjob, which reads the issue again with the token. The job stores the answer only when it was read after the stored one (synced_at), so replayed or out-of-order deliveries change nothing, sendsissue_link.updatedwhen the state, title or address changed, and applies the new progress to each link whoseapplied_progressdiffers, each in its own transaction. 1 MiB and 600 calls a minute per integration, counted after the lookup. - Reconciliation. Every issue has
next_sync_at: an hour after a successful read; after a failed one (the tracker unreachable, rate limited, refusing the token, or no longer showing the issue) 15 minutes doubled for each failure in a row, up to a day, withsync_failurescounting them. Theissue_sweepjob every 15 minutes takes up to 500 due linked issues of every workspace, oldestnext_sync_atfirst and at most 50 of one integration, moves eachnext_sync_at15 minutes ahead while itsissue_syncjob is queued, and queues the jobs. A tracker that keeps failing thus backs off and never takes another integration’s turn. The last failure is kept on the integration aslast_error. - Scopes.
integrations:read(integrations),integrations:manage(connect, change, disconnect, rotate; refused for keys limited to inboxes, never offered to agents’ tokens) andissues:write(create, link, unlink, withconversations:read). Listing links needsconversations:read. None is added to keys made before them. - Events.
issue_link.created,issue_link.updated(withprevious_progresswhen it moved) andissue_link.deleted(also for each link when an integration is disconnected) are stored events for callers who see the inbox and webhook types, with theIssueLinkas data.Conversation.issuesand, when one idea is read,Discussion.issueslist the links. - MCP.
list_issue_integrations(read-only),link_issue(idempotentHint, open-world: the customer sees the progress) andcreate_issue(open-world), both on feedback withissues:writeandconversations:read.create_issuetells the assistant to write the body itself and leave out personal data unless asked. - Not in M32. GitHub Apps and Linear OAuth, issue comments synced into the thread, pull requests, GitHub Projects status fields, and changing an issue from Yuva after it was created.
Team mail (M34–M38)
Some teams use Yuva as their mail client rather than for support: shared addresses such as sales@ and
people’s own mailboxes. They get the same conversation model in a place and with words of their own, as
Feedback did in M18. Planned after 0.1.0; issues in backlog.md. Decisions:
- Purpose, not a new model. An inbox is
supportormail. Amailinbox has only e-mail channels, and the support features stay off for it: ratings, SLA policies, automatic assignment, greetings, status, help, roadmap and What’s new, support stats and reports.closedreads Archived. Starred is per member, Trash is a state emptied after 30 days. - Personal mailboxes are private. A personal mailbox (
owner_member_id) is read only by its owner and the members they delegate to. Owners and admins see that it exists, its address, size and usage, never its content; API keys and webhooks never reach it, and assistants only through the owner’s own OAuth grant. This is the one place where an owner does not see every inbox, so that people can move their own mail into Yuva. Retention, contact export and deletion, and workspace deletion still cover it, and every delegation and hand-over is in the audit log. - As built (#170, migration 00135).
inboxes.owner_member_id(FK to the member, only onmailinboxes) is set onPOST /v1/inboxesand changes only by a hand-over (#172). The owner row is part ofmember_inbox_access, soinbox_viewers, assignee and mention checks, notifications andGET /v1/inboxes/{id}/membersfollow. Seeing every inbox (owners, admins, full keys, rules) stops short of a personal mailbox: everyall_inboxesbranch in SQL excludes it,canSeeInboxandvisibleInboxrefuse it, andcanReadPersonal(owner session or the owner’s grant; system jobs) is the one place #171 adds delegates. Owners, admins and full keys get its metadata only (visibleInboxMeta:GET /v1/inboxes[/{id}]withmailbox {addresses, conversations, storage_bytes}, no signature, import or SES tenant), rename and delete it. Events of it are dropped from realtime,/v1/eventsand MCP for everyone else, webhooks and workspace automation rules never fire for it (its own mail filters do, #173), and Slack, webhooks, API keys, member and team grants naming it answer409 personal_mailbox. A contact known only from personal mailboxes the caller does not read is hidden from everyone, owners included. Migrations stay a manager feature, and one into a personal mailbox is, besides, for its readers only:404to others on every migration endpoint and event (its events carry the mailbox id), it cannot be moved to another inbox, itsoptions.inboxesname no other inbox, and deleting the mailbox deletes its migrations (theirinbox_idwould otherwise goNULLand reach every manager). #169’s drafts need no extra check:draft_visible_toandconversation_visible_toare AND-ed with the inbox filter in every query, and the mailbox’sconversationscount leaves out unsent drafts. What removing its owner or deleting their account does is #172’s; in a soft-deleted workspace the owner link goes as in #172, and the purge deletes the mailbox. Contacts stay workspace-wide: an address known only from a personal mailbox still answers409 email_takenwhen someone adds it as a contact, and a shared inbox writing to it reuses that contact; only the mail in the personal mailbox is private, not the contact record. - As built (#171, migration 00138).
mailbox_delegates (workspace_id, inbox_id, member_id, access read|send, granted_by, created_at), keyed by mailbox and member and deleted with either, is managed withGET|PUT|DELETE /v1/inboxes/{id}/delegates[/{memberId}]by the mailbox’s owner alone, in a member session; everyone else, owners, admins and delegates included, gets404, the owner naming themself422 self_delegation. A delegation is a row ofmember_inbox_access(only while the mailbox has an owner), so every content filter, search operator, assignee, mention and notification check that follows that view reaches delegates without a change of its own. In Go,rightIngives owner (full),send,reador nothing;canReadPersonallets delegates read,ownedInboxkeeps settings, channels, the member list, delegates, migrations and everything that belongs to the inbox (broadcasts, mailing lists with their subscribers and imports, designs, analytics properties:ownedInboxandinboxObjectsVisible, the list queries, Home’s last and upcoming broadcasts and setup parts, and a contact’s subscriptions) to the owner, and writes (notes, replies, compose, status, assignee, labels, star, snooze, sending a draft) go throughrequireWrite(insidevisibleConversationwithlock, and at the sites without a lock), which answers403 forbiddento areaddelegate. Moving a conversation out of the mailbox is the owner’s alone: asenddelegate gets403 forbiddentoo, since they see the conversation. Drafts stay their author’s (#169). A delegate’s outgoing message keeps the delegate asauthorand names the owner inMessage.on_behalf_of_member_id; its mail carries the owner’sFrom:(the owner’s name with the channel address, or one of the owner’s verified addresses whenfrom_addressnames one) andSender:with the delegate’s name and the channel’s sending address, never the delegate’s own address. Conversation mail is not DKIM-signed by Yuva (the channel’s relay signs it), andSender:sits on the channel’s sending address, which is theFrom:domain unless the owner’s own address is used, whose domain must be a verified sending domain of the channel; so alignment is that ofFrom:and Yuva’s DKIM header list is unchanged. That mail counts as the owner’s forfrom:meandin:sent. A grant or revoke emitsinbox_access.changedto the delegate, whose open realtime connections reload their access at once;Inbox.mailbox.accesstells the caller their own right. Audit:mailbox.delegate_granted(member_id,access,fromon a change) andmailbox.delegate_revokedon the mailbox. A delegate’s own OAuth grant reaches the mailbox as their session does; keys and rules never. - As built (#172, migration 00139).
inboxes.personal booleansays a mailbox is personal, so thatowner_member_idcan beNULLwithout the mailbox turning shared: the FK is nowON DELETE SET NULL (owner_member_id),CHECK (owner_member_id IS NULL OR personal)andCHECK (NOT personal OR purpose = 'mail')replace #170’s check, and every filter that readowner_member_id IS [NOT] NULLreadspersonalinstead. Orphaned never means shared: a personal mailbox without an owner has no row inmember_inbox_access, so nobody reads it, and owners, admins and full keys keep its metadata withInbox.mailbox.orphaned: true.DELETE /v1/members/{id}takesmailboxes: [{inbox_id, action: delete|hand_over, to_member_id?}], one entry for every personal mailbox the member owns, or answers409 personal_mailboxwith all theirinbox_ids(a removal without a body too); a wrong entry (an inbox not theirs, named twice,hand_overwithoutto_member_id, to the leaver or to someone not in the workspace) is400 validation_failed. In the removal’s transaction,deleteis #170’s delete with the migrations, andhand_overmakesto_member_idthe owner and removes the delegates, who lose it at once like a revoke; auditmailbox.deleted_on_leave(member_id,name) andmailbox.handed_over(to_member_id,from_member_id). The caller only gets204.DELETE /v1/medeletes no personal mailbox: their delegates go, the member row takes the owner link with it, auditmailbox.orphaned(member_id) andinbox.updatedto managers. An owner or admin then hands it over withPOST /v1/inboxes/{id}/hand-over {"to_member_id"}(member session, orphaned personal mailboxes only, else409 personal_mailbox; it answers the metadataInbox) or deletes it; the soft-deleted workspace path needs no query of its own any more. Down refuses to run while an orphaned mailbox exists. Removing a member, deleting an account, handing over and creating a personal mailbox all takeLockInboxAccessbefore any workspace row lock (an account deletion takes it for each of the person’s workspaces in id order), so a removal either lists a mailbox handed to the member a moment earlier and answers409, or the hand-over waits and finds the member gone. Owners, admins and full keys getinbox.updatedof a personal mailbox they do not read, cut to whatGET /v1/inboxes/{id}shows them (no signature, import, SES tenant or access), so a panel sees a mailbox become orphaned; every other event of it stays hidden. Aninbox.updatedwhose inbox is already gone when the filter runs is cut the same way. - Trash of a personal mailbox (#198). Only the mailbox’s owner sees, counts, restores and
deletes for good what is in its trash, whatever their role, through a member session or their own
OAuth grant with
conversations:delete. Delegates never do (404on the conversation,403 forbiddenon restore and delete), and the Trash view, thetrashcount and empty-trash of owners, admins and keys leave other people’s personal mailboxes out. An agent’s Trash view (GET /v1/conversations?trashed=true,GET /v1/conversations/countstrash) holds only their own personal mailboxes, so it is empty without one; the trash of shared inboxes stays closed to agents (403 forbiddenon restore and delete,404on reading). - Leaving. When a member with a personal mailbox is removed, an owner or admin deletes the mailbox or hands it to a named member; nobody reads it before that choice.
- Sending as a person. A mail goes from the channel address with the member’s name, or from the member’s own address once that address is verified by a code and its domain is a verified sending domain of the channel. Delegates send “on behalf of”.
- Yuva is the mailbox. A domain’s mail is routed to Yuva (the edge Worker or any MTA) and history comes in through Moving to Yuva (M14). Two-way IMAP sync with a mailbox that stays at Gmail or Outlook is not planned: it would write to the source, which M14’s read-only rule forbids.
- Search operators.
qofGET /v1/conversations(and MCPsearch_conversations) takesfrom:,to:,cc:,subject:,has:attachment,is:starred,in:<folder>,before:andafter:(key:value,key:"quoted",-key:value), parsed on the server by one function that leaves the rest as the full-text query. A term with another key or a value that does not fit stays text. Every operator is one condition ANDed with the other parameters, a negated one its NOT; they look only at sent messages, never at drafts, andfrom:me,to:meand the member folders (starred,sent,drafts,scheduled) mean the calling member. Dates are midnight in the request’stimezone. Addresses match by containing the value (ILIKE,%_\escaped).from:,to:andcc:first resolve to the conversations that match, through GIN trigram indexes (migration 00136; thepg_trgmextension is trusted since PostgreSQL 13, so the database owner creates it;toandccindexaddress_text(), an immutable wrapper that joins and lower-cases the address array, and a value under 3 characters or with a space or a comma is searched as text), and the list query keeps or drops those conversations by id; an operator with more than 5000 matches stays a condition on each conversation instead. Redacted messages are never matched,in:<folder>means the mail folder of amailinbox, andafter:withbefore:must hold for one message. The other operators are conditions on each candidate conversation, like the label and star filters. Queries with operators run with JIT off, because the planner prices their subqueries high enough to compile them, which cost more than the query.
Storage
Attachments and raw e-mails in S3-compatible storage (R2, S3, MinIO) or on local disk for a
single-node install: YUVA_STORAGE=local|s3, with YUVA_STORAGE_DIR for local disk and
YUVA_S3_ENDPOINT, YUVA_S3_REGION, YUVA_S3_BUCKET, YUVA_S3_ACCESS_KEY_ID,
YUVA_S3_SECRET_ACCESS_KEY, YUVA_S3_PATH_STYLE for S3. Objects are never public (the exception is e-mail images, served at /i/{token}, see Broadcasts);
members and API
keys download them through /v1/attachments/{id}, which checks inbox access. The size limit (YUVA_ATTACHMENT_MAX_BYTES, 25 MiB by default) and the content-type allowlist
(YUVA_ATTACHMENT_TYPES, comma-separated, image/* style wildcards allowed) are the server’s; a
channel can narrow both (channels.attachment_max_bytes, channels.attachment_types, set with
attachments on POST /v1/inboxes/{id}/channels and PATCH /v1/channels/{id}), never widen them:
a size above the server’s or a type that allows nothing the server allows is refused with 400 validation_failed naming the field (a channel’s image/* is accepted under a server that lists
image/png and allows just that), and null makes the channel follow the server again. The
effective limits are computed on every use, never stored: the smaller size and the types both lists
allow (a channel’s image/* under a server’s image/png allows image/png), so a server limit
lowered after a channel was narrowed still wins. Every upload is held to the effective limits of its
channel: members’ and API keys’ files on a conversation (the conversation’s channel; the server’s
limits when it has none; no file at all when its channel row cannot be read), contacts’ files on
/client/v1 conversations and messages and feedback screenshots (the session’s channel), and
inbound e-mail (the receiving channel), where a part over the limit is skipped like one over the
server’s: the message is kept and the part stays in the raw e-mail. /client/v1 returns the
effective limits as attachments on the inbox’s public settings so the widget and the SDKs refuse a
file before uploading it. Imports through Moving to Yuva keep the server’s limits by design, since
they belong to no channel. (#136, migration 00095)
Privacy and data
- Retention per workspace:
workspaces.retention_days, set by an owner or an API key withworkspace:manage(PATCH /v1/workspace). Admins can create such a key; that adds no destructive power they lack, since they can already delete inboxes with their conversations.nullkeeps everything. An hourly River job deletes closed conversations whose last change and last activity are older than that, with their messages, attachments and stored files, and removes raw e-mails older than that from storage (the parsed message stays). - Deleting a conversation (#178):
DELETE /v1/conversations/{id}moves it to the trash (conversations.trashed_at,trashed_by_member_idortrashed_by_api_key_id);POST /v1/conversations/{id}/restorebrings it back with its status, assignee and labels untildeletes_at, 30 days aftertrashed_at(afterwards409 trash_expired).trashed_at, the restore window and the purge use the database’s clock, as rate limits do. Owners, admins, and keys and OAuth tokens withconversations:delete(never implied, offered only to owners’ and admins’ tokens, allowed for inbox-limited keys in their inboxes); agents get403 forbiddenin every inbox, so a mistake cannot be hidden./v1/conversations/bulktakestrashed: true|falsealone for up to 100, per-item results as for the other bulk changes; atrashedchange needsconversations:deleteonly, every other bulk changeconversations:write. The bulk change also takesspam: true|false(#198) asPATCHdoes, combinable with the other changes but not withtrashed. Trashing or restoring twice answers the conversation unchanged, without an event or entry. - Deleting for good (#198):
POST /v1/conversations/deletetakes up to 100 ids of trashed conversations and deletes them in one transaction through the trash purge’s batch delete (workspace row locked, rowsFOR UPDATE, stored files throughstorage_delete), with oneconversation.deletedevent each; the answer is{deleted, failed}, failures per id (409 not_trashed,404 not_found,403 forbidden) in request order. Who may: as for trashing, and in a personal mailbox only its owner (see Team mail). Cannot be undone. - Emptying the trash (#198):
POST /v1/conversations/trash/emptywithconfirm_count, the number the person confirmed (GET /v1/conversations/countstrash). A different number than the caller’s trash holds answers409 count_changedwithcount; otherwise it answers202 {count}and, when there is anything, queues the River jobtrash_emptyin the same transaction. The set is frozen when it is counted: the same transaction records the ids with theirtrashed_atintrash_empty_itemsunder atrash_emptiesrow (migration 00140), so the job deletes exactly what was confirmed and never what is trashed afterwards; the job’s arguments carry only that row’s id and who asked. Each run rebuilds the caller as it is now (member role, key, grant, single sign-on) and deletes only frozen conversations still trashed at the frozentrashed_at(one restored and trashed again stays) and that the caller may still delete: restored ones, a lost role, key or mailbox skip, and a mailbox handed to the caller afterwards is not in the set. It deletes 200 per transaction for about 30 seconds a run and queues its own continuation in the last transaction. Each batch adds its count totrash_empties.deletedin its own transaction, sotrash.emptied, written with the last batch, counts what was deleted across runs and retries; the last batch deletes the row and the set with it, and a run whose row is gone does nothing. The hourly retention job deletes sets older than 7 days, left by a job that was discarded or cancelled. - A trashed conversation is read-only and left out of every list, count, search, stat, Home
figure, contact summary, docs and analytics support figure, linked replies and roadmap link
counts, drafts, mentions, rating links, chat continuity mail, the automation run log
(
GET /v1/automation-rules/{id}/runs; a restore brings its runs back), MCP and all of/client/v1. The Trash view isGET /v1/conversations?trashed=true(owners, admins,conversations:delete); those callers can alsoGETthe conversation, its messages, attachments, e-mail and raw source; everyone else gets404. - A new message from the contact never joins a trashed conversation: e-mail threading
(In-Reply-To, References, the conversation token, broadcast and status notice replies, the
per-sender hourly cap) skips it and starts a new conversation without
related_conversation_id; a widget or SDK message posted to its id starts a new conversation with the trashed one’s kind, subject, page, help article and feedback context (not the feedback text) (conversation_idin the answer,conversation.createdon the stream). Sameclient_id, same message: aclient_idalready used in the trashed conversation answers that message (200, nothing new is started); one used in the replacement answers it there; starting a conversation again with aclient_idfrom a trashed one answers404. The per-sender limit of 20 new e-mail conversations an hour still counts trashed ones; over it, with only trashed ones to join, the mail is refused429 rate_limited. - The hourly retention job (before the per-workspace retention) deletes conversations trashed
30 days ago, 200 per transaction per workspace through the same batch delete as retention and
workspace deletion (workspace row locked first, then the trash rows
FOR UPDATE, so a restore either wins or finds the conversation gone), with messages, attachments, raw e-mails, stored files and remaining events, for at most 30 seconds a run; an error is logged and the job goes on, as for the audit log sweep. The per-workspace retention of closed conversations skips trashed ones: the trash purge owns them. - Events and webhooks:
conversation.trashedandconversation.restoredcarry the conversation (webhooks: with the contact);conversation.deletedcarries only{id, inbox_id, contact_id}. The contact’s realtime stream sendsconversation.removed({id}) when its conversation is trashed (or deleted, if the stream still knew it) and announces a restored one asconversation.created. Trashing deletes the conversation’s earlier events (all but itsconversation.trashedandconversation.restored), so/v1/events, member and contact replays never show it again; restore does not need them, sinceconversation.restoredcarries the conversation. A webhook of a deleted event not yet fanned out is dropped. The purge deletes the rest. Indexevents (workspace_id, conversation_id)makes this cheap. - Audit log:
conversation.trashed,conversation.restored(the member, key or grant) andconversation.deleted(actor kindsystem, no id or name), target typeconversation, detailsinbox_idonly, never the subject or content. Deleting for good writes oneconversations.deleted(target typeconversations) and an emptied trash onetrash.emptiedwhen its job ends (target typetrash), both with the caller as actor, the workspace’s id as target id and{count}as details, never ids, subjects or content. - MCP has no delete or restore tool (deletes are left out on purpose, see MCP coverage);
get_conversationand the conversation resource answer “no such conversation” for a trashed one even to an owner’s token withconversations:delete. - Schema: migration 00094 (
trashed_at,trashed_by_member_id,trashed_by_api_key_id, the partial index(workspace_id, trashed_at),events_conversation_idx,member_mentionswithout trashed conversations, audit actor kindsystem). - Redacting one message (#179):
POST /v1/messages/{id}/redactremoves a message’s or note’s content and keeps the line in the thread. One transaction emptiesbody,html,help_cardsandmentions, setsredacted_atandredacted_by_member_idorredacted_by_api_key_id(migration 00096 adds them withNOT VALIDconstraints,ON DELETE SET NULLlike the trash; 00097,NO TRANSACTION, validates them without holding a lock onmessages), deletes the attachment rows and, for e-mail, clearsmessage_emailssubject, full text, full HTML, headers andraw_key(Message-ID, In-Reply-To, References and addresses stay, so threading and import dedupe keep working). When the message is a feedback’s first message,feedback.textbecomes empty andattachment_count0; when it is the inbound e-mail whose subject became the conversation’s subject, the conversation subject becomes empty (later replies are titled with the channel’s name) and the e-mail subjects in the conversation that repeat it are cleared; either emitsconversation.updated. Raw sources of later e-mails keep theirSubject:header. Stored copies are rewritten in the same transaction by one JSON walk: the conversation’s events (locked first), webhook deliveries and answers kept forIdempotency-Keythat hold the message, its preview, the conversation’s subject or feedback text, or an e-mail summary repeating the subject. Webhook fan-out reads its event under a shared lock, so a fan-out that read the event before the redaction commits its deliveries before they are rewritten; a delivery attempt and a stored idempotent answer are also checked against redacted messages when they are sent or stored, under a shared lock on the messages that waits for a redaction in progress. The contact’s later inbound e-mails lose their quoted history and raw source only when the redacted message is an e-mail we sent, the later e-mail answers it (its Message-ID in In-Reply-To or References) and quotes all of its text (compared case-, whitespace- and>-insensitively in the full text or HTML); partial quotes keep their history. A queued e-mail is not sent (its delivery becomesfailed, “removed before it was sent”); sending reads its messages under row locks, so it waits for a redaction in progress and leaves redacted ones out of a batch while the others go; an e-mail already on its way when the redaction comes is recorded assent. A River jobstorage_deletedeletes the files after the commit, retried on failure. Pushes the message caused are deleted from the job table after the commit (one being sent at that moment cannot be stopped); app pushes carry no text and re-read the message when they run;notify, the e-mail digest and chat continuity skip redacted messages. Search forgets it at once (the vector is generated frombody); list previews keep the line withredacted: trueand empty text, the Home waiting preview is empty. Who: owners and admins any message they can see, other members their own (author_member_id, also through an OAuth token); API keys and OAuth tokens needmessages:redact(never implied, not added to older keys, offered to agents’ tokens). Drafts and timeline events answer409 not_redactable, a trashed conversation404; redacting again answers the message unchanged without an event or audit row. Emitsmessage.redacted(realtime,/v1/events, webhooks with theinclude_notesrule for notes, the/client/v1stream for messages); the Slack posts that carried its text are rewritten to a “removed” line (see Slack, M32); the audit log recordsmessage.redactedon target typemessagewithconversation_id,inbox_id,kindandfiles, never content. A sent e-mail cannot be taken back from the recipient’s mailbox, and notification e-mails already sent to members keep what they quoted. Notes are redacted the same way; they never reach/client/v1, so no client frame, and their mentions are cleared, so they leave members’ Mentions. A chat or app conversation’s subject is not touched: it is the conversation’s, not a message’s. - Audit log (#135):
audit_log(migration 00089) records who changed access, credentials and data of a workspace, in the same transaction as the change: a failed change leaves no row, and a row is kept small enough never to fail one (details under 1500 bytes of JSON; longer lists become<name>_countwithtruncated: true). Each row hasworkspace_id, the actor (member,api_key,oauth_grantfor a member through a connected app or MCP, with the member and the app’s name invia, oroperatorfor the command line), the actor’s display name at the time, the action (<target type>.<verb>), the target’s type and id, small details and the time; no foreign keys to actors or targets, so an entry outlives what it names and goes with the workspace. Actions:member.joined,member.role_changed,member.removed,member.inbox_access_granted,member.inbox_access_revoked,invite.created,invite.deleted,api_key.created,api_key.revoked,oauth_grant.created,oauth_grant.revoked,webhook.created,webhook.updated,webhook.deleted,webhook.secret_rotated,channel.credentials_changed,channel.key_rotated,channel.forwarding_address_rotated,channel.dkim_key_created,channel.dkim_key_deleted,inbox.identity_secret_rotated,inbox.deleted,contact.deleted,contact.consent_exportedandlist.consent_exported(written when the export starts streaming,started: true),analytics_export.created,workspace.retention_changed,workspace.bots_may_send_changedandworkspace.broadcasts_by_keys_changed(from,to, written only when the value changes),channel.address_verified(address,method),channel.address_proven(actoroperator) andchannel.address_lost(actorsystem,viawhen mail moved off a catch-all orlocal@channel),workspace.broadcast_approval_requested, and the operator’sworkspace.broadcasts_approved,workspace.broadcasts_denied,workspace.broadcasts_suspendedandworkspace.broadcast_limit_changed;conversation.trashed,conversation.restored,conversation.deleted(actorsystem),conversations.deleted(target typeconversations),trash.emptied(target typetrash) andmessage.redacted(target typemessage); the single sign-on actions (targetsssoandsso_domain, see Single sign-on (M33)). Revocations and deletes write their entry only when the row changed, so repeated or concurrent calls record one; a password sent again unchanged records nothing. No row holds message content, a secret, a password, a webhook URL (only its host), or a contact’s name or address. A workspace’s own deletion is not in its log, which goes with it: it is an operator noticeworkspace_deletedin the operator digest. MCP tools write through the same handlers, so their rows name the OAuth grant.GET /v1/audit-loglists entries newest first for owners and for keys and tokens withaudit:read, filtered byactor_id(a member’s id also matches what they did through connected apps),actor_kind,action,sinceanduntil, with cursor pagination; Settings › Audit log shows it to owners.audit:readon an API key holds only while the member who made the key is still an owner, checked on every read; keys made withyuva api-key createkeep it. Entries are keptYUVA_AUDIT_DAYS(365).migration_auditstays as it is. - Imported history (see “Moving to Yuva”) is the workspace’s data like any conversation: contact export and deletion, retention (counted from the import) and workspace deletion cover it. Source credentials are deleted when the migration ends.
- Workspace deletion: an owner deletes the workspace in the panel or with
DELETE /v1/workspace(the body repeats its name), an operator withyuva workspace delete --workspace <id|name> --yes. One transaction setsworkspaces.deleted_at, removes the workspace’s webhook endpoints and the push subscriptions of members who have no other workspace, and queues a River job; the request answers202. From then on every lookup a request starts from ignores the workspace (member sessions, API keys, contact sessions, chat and app keys, CORS origins, e-mail recipients, SES reports, invites), so it is unusable at once; open realtime connections close at their next heartbeat check, and jobs queued for it earlier (e-mail, chat continuity, notifications, push) do nothing. The job deletes the conversations 200 at a time with their messages, attachments and stored files, then the contacts, then the workspace row, which takes everything else with it. Each run works for about 30 seconds, records its progress in the job’s output and the log, and snoozes the job until the next run, so a large workspace never hits a timeout; the hourly retention job queues it again for a deleted workspace whose job was lost. People keep their account: someone left without a workspace can still sign in and sees that they belong to none. - Account deletion: a person deletes their account in the panel or with
DELETE /v1/me(the body repeats their e-mail address), an operator withyuva person delete --email <address> --yes. It is refused (409 last_owner) while the person is the only owner of a workspace. Otherwise the person goes with their memberships, sessions, passkeys, push subscriptions and sign-in codes; messages they wrote stay without an author, shown as a deleted member. As a reader they also lose their reader tokens, notifications, votes and follows; their discussion posts stay without an author, shown as a deleted reader; in each workspace the contact linked to them is deleted when it has no conversations and no external ids (it existed only for their posts), else only unlinked, so the workspace keeps its own record of a customer. - Contact deletion and export through the API, for GDPR and KVKK requests. A host backend deletes
a user who deleted their account with
DELETE /v1/contacts/by-external-id?inbox_id=&external_id=(an API key or an owner or admin): the contact goes with all their conversations, messages, attachments, sessions and addresses in every inbox, the stored files are removed, andcontact.deletedtells the other endpoints which external ids are gone. Their addresses are removed from other conversations’ participants and from theto,ccandbcclists of the stored e-mails that remain (other people’s raw sources and full text keep them, as with redaction); their messages as a participant go with them. Before the lists are cut, a row that went to or came with more than one address getsshared = true, a flag that names no one, and the one-recipient rule for delivery reports and complaints (soleRecipient,MessageIDSharedBeyond) treats a shared row as having several recipients, so the deleted person cannot later forge a report that suppresses the customer. Export:GET /v1/contacts/{id}/participationslists the other contacts’ conversations that hold one of the contact’s addresses as a participant or in a stored recipient list; someone only copied gets a contact with their address first. - Deleting contacts in bulk (#199):
POST /v1/contacts/deletetakes up to 100idsandconfirm_count, the number of different ids the person confirmed; another number answers409 count_changedwithcount. Each contact is deleted asDELETE /v1/contacts/{id}does, in its own transaction, with failures per id infailed; owners, admins and full keys only, scopecontacts:write. Before a deletion the panel readsGET /v1/contacts/{id}/deletion-preview:conversation_count(the conversations the caller sees, trashed ones included only for those who see the trash) andhas_hidden_conversations,truewhen the contact also has conversations in personal mailboxes the caller does not read, which go too. Trashed conversations count only where the caller sees the trash (the Trash view’s rule), so a delegate gets no count from a delegated mailbox’s trash; those sethas_hidden_conversations. It names no mailbox and counts none of the hidden ones. - Deleting conversations for good (contact deletion, inbox deletion, retention, the trash purge,
migration cutover) deletes in the same transaction their stored events and webhook deliveries,
pending or kept, by index, never by searching payloads (#189): migration 00122 adds
events.contact_id(the contact an event is about) andwebhook_deliveries.conversation_idandcontact_id(copied from the event at fan-out). Contact deletion also deletes them bycontact_id; merging contacts (API merge and widget identify) deletes the source’s contact-level ones and moves the rest to the target; workspace purge leaves them to the workspace row’s cascade. The conversations are lockedFOR UPDATEin id order, after the contact or inbox and before the events, so a reply in progress commits its event first and goes too./v1/events, realtime replay and the delivery log stop showing the content at once; a deleted delivery is not retried andGETorPOST …/redeliveron it answers404 not_found. Copies written before 00122 match only by conversation (events) or not at all (deliveries) and expire within 7 days. Replies kept forIdempotency-Keystay their 24 hours: only the caller that made the request reads them. - Stored files (attachments, raw e-mails, e-mail images, list-import and migration uploads) are
deleted by the retried
storage_deletejob, queued in the transaction that deletes their rows (up to 500 keys a job), on every deletion path, so a failing store retries instead of leaving files nothing points to. - Logs keep only the domain of an e-mail address (
*@example.com): skipped and failed sends, SMTP errors returned to the job queue, and the server mailer’s trace. WithoutYUVA_SMTP_HOSTthe log mailer writes a sign-in code as one line (sign-in code (log mailer, not sent), recipient redacted) and every other mail as its recipient’s domain and sizes;YUVA_MAIL_LOG=fullwrites whole mails and is refused unlessYUVA_PUBLIC_URLis a localhost or loopback URL. The delivery error shown on a failed message in the panel keeps the server’s full answer. - Analytics keeps no IP address and puts nothing on a visitor’s device by default (see “Analytics”). Raw
visits and events are kept
YUVA_ANALYTICS_RAW_DAYS(90), rollups the property’sretention_months(25); salts are deleted two hours after their day. Members delete a property’s data for a range or in full; a property, a consented visitor, a contact with linked visits and a deleted workspace take their analytics rows with them. Workspaceretention_daysdoes not apply to analytics. - Report rollups (M29) hold counts per inbox, channel kind, team, member and label, no content; they
go with the workspace, and
retention_daysdoes not apply to them. - Status page subscribers (M19) are subscriptions of a status list and follow the list rules above (pending ones after 30 days with the contacts only they created, unsubscribed ones after 3 years); notice deliveries and their addresses go after 90 days, the notice keeps its counts.
- Help center (M20) counters hold no visitor data:
help_article_dailycounts views, ratings, conversations and cards per article and day, andhelp_search_dailycounts searches per normalized query and day (kept 90 days; queries shaped like an e-mail address, a URL or a number are stored as(scrubbed)), with no address, cookie, session or id. Articles and their revisions are the workspace’s content: workspace deletion takes them, and retention days do not apply. - Nothing is sent to third parties except what a channel is configured to send (SMTP, webhooks); the monthly GeoIP download from DB-IP fetches a file and sends nothing about anyone.
Hosting for others later
workspace_idon every row; every store query is scoped by it. Exceptions:workspacesitself, whoseidis the workspace.- River’s
river_*queue tables, which the library owns; job arguments carry theworkspace_idinstead. - Inbound e-mail arrives before any workspace is known:
/ingress/emailfinds its channel by the recipient address (email_channels.address, unique across the server), and/ingress/sesfinds the message a bounce refers to by our Message-ID (message_emails.header_message_idof outbound mail). Everything after that lookup is scoped by the workspace it returned./ingress/sesalso finds a broadcast delivery by its Message-ID (broadcast_deliveries.header_message_id, unique across the server) and a status notice delivery bystatus_notice_deliveries.header_message_id(unique across the server too), and/i/{token}finds an e-mail image by its token (email_images.token, unique across the server) before the workspace is known; everything after those lookups is scoped by the workspace they returned. - The widget and the apps name only a chat or app channel’s public key, which is unique across
the server: a new contact session finds its channel by
chat_channels.public_key(app channels live in the same table), and a CORS preflight, which carries neither the key nor the session, asks whether any chat channel allows its origin. A contact session token is looked up by its hash incontact_sessionsbefore its workspace is known. Everything after those lookups is scoped by the workspace they returned. - Status pages (M19): a public page finds its page by
status_pages.slug, a former slug instatus_page_slugsor a verifiedstatus_pages.custom_domain(a slug’s and a domain’s availability is checked the same way, a verified domain fails the other claims of its name in every workspace, and the domain sweep lists the domains due for a check of every workspace), and a heartbeat or push finds its monitor bystatus_monitors.token_hash(the sweep of overdue heartbeats lists the due monitors of every workspace in one query, and the notice sweep the due notices of every workspace), and an SES notification finds a notice delivery bystatus_notice_deliveries.header_message_id, all unique across the server; everything after those lookups is scoped by the workspace they returned. - Help centers (M20): a public help page finds its center by
help_centers.slugor a former slug inhelp_center_slugs, both unique across the server (availability is checked against current and former slugs of every workspace); everything after that lookup is scoped by the workspace it returned. The in-process counter flush writes per workspace. No other exception. - Own domains (M19, #148): a request on an own domain, and the certificate check, find the page by a
verified
custom_domainofstatus_pages,help_centers,roadmap_boardsorchangelogsin one query; a verified name is unique across the server and the four kinds. A domain’s availability is checked against the verified domains of all four in every workspace, its verification fails the other claims of its name in all four and every workspace, and the domain sweep lists the domains due for a check of all four and every workspace. Everything after those lookups is scoped by the workspace they returned. - Single sign-on (M33): a sign-in finds the workspace whose identity provider an address uses by its
verified
sso_domains.domain, unique across the server, before any workspace is known (when starting a sign-in), and the OIDC callback and the SAML ACS find theirsso_loginsrow by the hash of the state or request id alone; adding or verifying a claim checks the verified domains of every workspace, and the daily sweep lists the verified domains due for a check of every workspace. Everything after those lookups is scoped by the workspace they returned. - The person-level identity tables
people,sessions,login_codes,passkeys,webauthn_ceremoniesandpush_subscriptions(a browser’s subscription follows the person into every workspace; the send job finds it by its id). A person signs in once and can be a member of several workspaces, so these rows belong to a person (or, forlogin_codes, an e-mail address before sign-in), not to a workspace. Their queries are scoped by the person id, the e-mail address or a secret hash instead; everything a person may do in a workspace goes through theirmembersrow. - The reader account endpoints (
/v1/account/*) list a person’s discussions, follows and notifications across every workspace.reader_tokensandreader_notificationscarryworkspace_id(and every write and workspace-side read filters by it), but these account reads are scoped by the person id instead (throughcontacts.person_idor the row’s ownperson_id), leaving out deleted workspaces, like/v1/melists a person’s memberships. A reader token is looked up by its hash before its workspace is known, like a contact session.people.reader_email_notificationsis a person-level setting. - Open sign-up’s limits count
workspacesbycreated_by(a person) andcreated_ipacross the server, before the new workspace exists. operator_noticesis the server operator’s feed of new people and workspaces, broadcast approval requests, suspensions and automatic pauses (YUVA_OPERATOR_EMAIL): it is about the server, not a workspace (a line names the workspace), and is read only by the operator digest job.- Analytics collection names only a property’s public key:
POST /client/v1/analytics/{key}finds the property byanalytics_properties.public_key(or itsprevious_keyduring a rotation), unique across the server, and a share link finds its share byanalytics_shares.token_hash; everything after those lookups is scoped by the workspace they returned. Whole day partitions ofanalytics_visits,analytics_eventsandanalytics_visit_pages, which hold every workspace’s rows of that day, are created by the flusher (yesterday to the day after tomorrow in UTC when it starts, and any day it is about to write that has none) and by theanalytics_partitionsjob, which also drops them; every other read, write and delete of those tables filters byworkspace_id. - A forwarding address names only its token: ingress finds the channel by
email_channels.forward_token(unique across the server), like an address. A migration probe is recognised by its HMAC before the channel’s workspace matters. - A member’s own address (#167) names no workspace either: when no channel takes a recipient,
ingress looks the verified
member_addressesrows up by address across workspaces (FindVerifiedMemberAddresses); everything after that lookup is scoped by the workspace it returned. - The migration watchdog lists migrations whose lease expired across workspaces
(
migrations_lease_idx), and the hourly upload sweep lists ended migrations that still have uploaded parts (ListEndedMigrationUploads); everything after those lookups is scoped by the workspace they returned. - The hourly audit log sweep deletes entries older than
YUVA_AUDIT_DAYSacross workspaces, 5000 rows at a time (audit_log_created_idx): the period is the same for every workspace, and no row is read or returned, only deleted by age. migration_auditrows outlive their migration (no foreign key to it) but carryworkspace_idand go with the workspace.- Slack (M32):
POST /ingress/slackfinds the installation byslack_installations.team_id(unique across the server) before the workspace is known; everything after that lookup is scoped by the workspace it returned. The OAuth callback’s state names its workspace. - Issue trackers (M32):
/ingress/issues/{integrationId}finds its integration byissue_integrations.id(unique across the server) before the workspace is known, and the reconciliation sweep takes due linkedtracked_issuesof every workspace (tracked_issues_next_sync_idx); everything after those lookups is scoped by the workspace they returned. yuva api-key revoke <id>runs on the server with no workspace given: it finds the key by its id, unique across the server, and revokes it scoped by the workspace that lookup returned.
- Usage counters (conversations, messages, members, storage, broadcast recipients, status notice mails) recorded per workspace per month.
- Billing and plans are not part of the open-source core. Sign-up is:
YUVA_SIGNUP=openlets anyone create an account and a workspace, within per-person and per-address limits (see Panel).
Deployment
One Docker image; deploy/compose.yaml for a single host; the Helm chart deploy/helm/yuva (published as oci://ghcr.io/productdevbook/charts/yuva, same version as the server, no bundled database) for Kubernetes. Runs on Postgres 16+; CI, the development compose file and production run Postgres 18.
The minimal install is the binary, Postgres and an SMTP account.