Skip to content

docs: make to and subject optional on POST /api/emails#252

Merged
sweetmantech merged 2 commits into
mainfrom
docs/emails-to-optional
Jun 25, 2026
Merged

docs: make to and subject optional on POST /api/emails#252
sweetmantech merged 2 commits into
mainfrom
docs/emails-to-optional

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Contract change for the "make `to` optional on `POST /api/emails`" follow-up enhancement on chat#1815 (decided 2026-06-25). Docs-first — this is the contract recoupable/api implements next.

What changed

SendEmailRequest in api-reference/openapi/accounts.json:

  • to removed from required (only subject remains required).
  • to.description now documents the default: when omitted, the email is sent to the authenticated account's own email address.

to keeps minItems: 1 (when provided, at least one recipient). The no-card recipient restriction is unchanged — the account's own email is always allowed without a card, so the default recipient never trips the 403.

Why

So a caller can "email me this" without restating their own address — the common scheduled-report case. This also lets POST /api/emails fully subsume POST /api/notifications (self-send), which chat#1815 then deletes.

Merge order

docs (this) → api (to optional in sendEmailBodySchema, resolve account_emails when omitted).

Minimal additive diff (1 insertion, 2 deletions); JSON validated.

🤖 Generated with Claude Code


Summary by cubic

Make to and subject optional on POST /api/emails; omitting to sends to the authenticated account’s own email, and omitting subject defaults to the first heading/line of the body, falling back to Message from Recoup if empty.

OpenAPI docs updated: SendEmailRequest now has no required fields; when provided, to still must include at least one recipient and the no-card restriction is unchanged (own email always allowed).

Written for commit 6b24dd9. Summary will update on new commits.

Review in cubic

…wn email)

Follow-up enhancement on chat#1815. When `to` is omitted, the email is
sent to the authenticated account's own email address, so a caller can
"email me this" without restating their address (the common scheduled-
report case). `to` stays `minItems: 1` when provided; the no-card
recipient restriction is unchanged (own email is always allowed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sweetmantech, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 9 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 182d0071-0643-48ba-bbb6-fa58dccd5e45

📥 Commits

Reviewing files that changed from the base of the PR and between 4321426 and 6b24dd9.

📒 Files selected for processing (1)
  • api-reference/openapi/accounts.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/emails-to-optional

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@mintlify

mintlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
recoup-docs 🟢 Ready View Preview Jun 25, 2026, 8:13 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Folded into the to-optional change. Resend requires a non-empty subject, but
the caller shouldn't have to supply one for scheduled/agent sends — document
subject as optional with a server-side default (first heading/line of the body,
falling back to "Message from Recoup" when the body is empty). SendEmailRequest
now has no required fields. CreateNotificationRequest is unchanged.

API impl follows once these docs merge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sweetmantech sweetmantech changed the title docs: make to optional on POST /api/emails (defaults to account's own email) docs: make to and subject optional on POST /api/emails Jun 25, 2026
@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Folded in subject optional (6b24dd9) alongside the to-optional change.

Resend requires a non-empty subject (CreateEmailBaseOptions.subject: string), but the caller shouldn't have to supply one for scheduled/agent sends. Documented subject as optional with a server-side default: the first heading/line of the body, falling back to Message from Recoup if the body is empty. SendEmailRequest now has no required fields; CreateNotificationRequest is untouched. JSON validates.

Per docs-first: the api impl (in api#710) follows once this merges.

@sweetmantech sweetmantech merged commit 3a025e4 into main Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant