You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spec the email send API and slice it into PRs #464
What exactly does slice 1 of the email send API build, and how does it split into implementation tickets?
Write the spec from the map's charting decisions, the architecture brief, and the sender-verification research: the endpoint, scope and flag; the CDP invocation through the hidden workflow; the agent-friendly error catalog; posthog-nodeemails.send; and the agent skill. Then slice it into implementation tickets and one ship ticket.
Runtime: T3 Code
Thread: thread:project:f66f06fc-0bc1-4bfe-b00a-4aab7f54eb13:9328b4bd-7bf9-4057-8917-d0927e5c1d58
Title: spec #464: Spec the email send API and slice it into PRs
Cast: Opus 5.5, high. AFK stretch cap: 75 minutes, then park.
Note: dispatched as its own T3 thread, like the prototype, so Michael answers the spec park there directly.
POST /api/projects/@current/emails/, phs_ keys only, email_send:write, flag workflows-email-api (fails closed, 403 when off), email-sized throttles as settings, 24 h cache idempotency storing the Django-minted id.
One hidden api_sends workflow per team with the api_send trigger, kept single by a partial unique index; Django → CDP over a scoped service JWT, quota and pause checked in the new route.
200 { id, url }, one error catalog (code, status, what/why/fix, attr, docs_url), posthog-nodeemails.send returns { data, error }, the /workflows/api-sends redirect route, and one agent skill that verifies a sender through the PostHog MCP before the first send and covers both flags.
The instrument-* skills are authored in PostHog/context-mill (context/skills/omnibus/), built into its release, and served through the PostHog MCP; PostHog/posthog keeps a list of their names so no product skill can shadow them.
Skill home and name.PostHog/context-mill, send-transactional-email / context-mill as instrument-email to match its siblings / a product skill in PostHog/posthog products/workflows/skills/.
Idempotency key in the SDK.Second options argument, like Resend / a field in the payload.
SDK retries.Retry a send only when it carries an idempotency key / always retry through fetchWithRetry defaults.
cc plus bcc limit.The provider's per-message recipient limit minus the one to, as a setting / a smaller fixed limit for the beta.
Skill fallback when workflows-email-domain-agent-setup is off.Tell the person to verify in the PostHog UI and wait / stop and ask the person to enable the flag.
Also noted in the spec: when #350 moves upstream, its transactional recipe should point at emails.send and the new skill instead of a hand-built workflow. #349 stays independent.
The SDK takes the idempotency key as a second options argument.
The SDK retries a send only when it carries an idempotency key.
The cc plus bcc limit is the provider's per-message recipient limit minus the one to, as a setting.
With workflows-email-domain-agent-setup off, the skill sends the person to the PostHog UI to verify, then waits.
Merge-risk danger areas: auth and API scopes (#471), service-to-service auth and secrets (#470), the migration (#468), real sends and billing quota (#470), concurrency (#469, #472), public API contracts (#471, #474).
Outside the code, before the flag turns on: the new JWT signing secrets setting needs a value in every environment, and the workflows-email-api flag needs to exist.
Activity
Silthus commentedon Oct 14, 2026
Runtime: T3 Code
Thread: thread:project:f66f06fc-0bc1-4bfe-b00a-4aab7f54eb13:9328b4bd-7bf9-4057-8917-d0927e5c1d58
Title: spec #464: Spec the email send API and slice it into PRs
Cast: Opus 5.5, high. AFK stretch cap: 75 minutes, then park.
Note: dispatched as its own T3 thread, like the prototype, so Michael answers the spec park there directly.
Silthus commentedon Oct 14, 2026
Parked: the spec and its implementation tickets are ready for review.
Spec: Spec: email send API #467. It is closed on purpose so it stays off the frontier, like #229.
Locked (from the map, #463 and #466)
POST /api/projects/@current/emails/,phs_keys only,email_send:write, flagworkflows-email-api(fails closed, 403 when off), email-sized throttles as settings, 24 h cache idempotency storing the Django-minted id.api_sendsworkflow per team with theapi_sendtrigger, kept single by a partial unique index; Django → CDP over a scoped service JWT, quota and pause checked in the new route.200 { id, url }, one error catalog (code, status, what/why/fix,attr,docs_url),posthog-nodeemails.sendreturns{ data, error }, the/workflows/api-sendsredirect route, and one agent skill that verifies a sender through the PostHog MCP before the first send and covers both flags.Implementation tickets (build order, native blocking edges)
api_sendsroute and the Django clientnodejs/)POST /emailsbehind the flag, with the error catalog/workflows/api-sendsredirect routeposthog-nodeemails.sendThe
instrument-*skills are authored in PostHog/context-mill (context/skills/omnibus/), built into its release, and served through the PostHog MCP; PostHog/posthog keeps a list of their names so no product skill can shadow them.Merge-risk danger areas
email_send:write, project secret key allowlist (Email API: POST /emails behind workflows-email-api, with the error catalog #471).emails.send(posthog-node: emails.send from a key or an HTML file, synced by content hash, returning { data, error } #474), a one-way door once released.Pending: spec decisions (recommendation in bold)
send-transactional-email/ context-mill asinstrument-emailto match its siblings / a product skill in PostHog/posthogproducts/workflows/skills/.docs_urlpoints at the GitHub-hosted catalog until docs land.requestJsonfrom posthog-js#5173. posthog-node: emails.send from a key or an HTML file, synced by content hash, returning { data, error } #474 carries the same helper; whichever PR merges second drops its copy / stack posthog-node: emails.send from a key or an HTML file, synced by content hash, returning { data, error } #474 on Filter for people with session recordings on persons modal PostHog/posthog#5173 / split the helper into its own small core PR first.optionsargument, like Resend / a field in the payload.fetchWithRetrydefaults.ccplusbcclimit. The provider's per-message recipient limit minus the oneto, as a setting / a smaller fixed limit for the beta.workflows-email-domain-agent-setupis off. Tell the person to verify in the PostHog UI and wait / stop and ask the person to enable the flag.Also noted in the spec: when #350 moves upstream, its transactional recipe should point at
emails.sendand the new skill instead of a hand-built workflow. #349 stays independent.Silthus commentedon Oct 14, 2026
Silthus commentedon Oct 14, 2026
Resolved: Michael accepted the spec and the ticket breakdown on 2026-10-14.
Spec: Spec: email send API #467 (closed on purpose, the reference document for the tickets below).
Implementation tickets in build order
api_sendsroute and the Django clientnodejs/)POST /emailsbehind the flag, with the error catalog/workflows/api-sendsredirect routeposthog-nodeemails.sendDecisions (all as recommended)
send-transactional-email.requestJsonhelper from posthog-js#5173; whichever PR merges second drops its copy.optionsargument.ccplusbcclimit is the provider's per-message recipient limit minus the oneto, as a setting.workflows-email-domain-agent-setupoff, the skill sends the person to the PostHog UI to verify, then waits.Merge-risk danger areas: auth and API scopes (#471), service-to-service auth and secrets (#470), the migration (#468), real sends and billing quota (#470), concurrency (#469, #472), public API contracts (#471, #474).
Outside the code, before the flag turns on: the new JWT signing secrets setting needs a value in every environment, and the
workflows-email-apiflag needs to exist.