Document Inbound Email v2 API#47
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 reviews. How do review 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe OpenAPI specifications add inbound domain settings, custom-domain inbox contracts, RFC email metadata, reply and forwarding operations, and thread management endpoints with supporting schemas and response examples. ChangesInbound email API
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant InboundAPI
participant ThreadStore
participant SendingAPI
Client->>InboundAPI: List inbound messages
InboundAPI->>ThreadStore: Resolve thread_id
ThreadStore-->>InboundAPI: Return thread messages
Client->>InboundAPI: Reply, reply_all, or forward
InboundAPI->>SendingAPI: Submit SendMessageInput
SendingAPI-->>InboundAPI: Return send result or error
InboundAPI-->>Client: Return action response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specs/email-sending.openapi.yml`:
- Around line 2955-2962: Update both RFC field definitions in
specs/email-sending.openapi.yml at lines 2955-2962 and 3052-3059: replace
nullable: true with the OpenAPI 3.1 union type [string, 'null'] for
rfc_message_id and in_reply_to, preserving their existing descriptions and RFC
header semantics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d883f3b0-a254-4ffb-9263-661ad5dd91de
📒 Files selected for processing (2)
specs/email-sending.openapi.ymlspecs/inbound.openapi.yml
a619732 to
4678030
Compare
4678030 to
2459ef1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
specs/inbound.openapi.yml (1)
1322-1329: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the official product name instead of "Email Sending API".
"Email Sending API" is not the sanctioned product term. Replace with Email API/SMTP (or the shortened Email API) throughout the new content — occurrences at Lines 1329, 1366, 1383, 1395-1397, 1518, and 1717-1719.
As per coding guidelines: "Use official product naming: 'Email API/SMTP' (can shorten to 'Email API' or 'API/SMTP')".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@specs/inbound.openapi.yml` around lines 1322 - 1329, Update the descriptions and documentation around SendMessageInput and the other referenced new content to replace every occurrence of “Email Sending API” with the sanctioned product name “Email API/SMTP” or “Email API,” preserving the existing meaning and address shape documentation.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specs/inbound.openapi.yml`:
- Around line 621-628: Update the descriptions near the reply-to-message
references to replace each relative `#operation/replyToInboundMessage` anchor
with the corresponding absolute `docs.mailtrap.io` documentation URL, including
both occurrences while preserving the surrounding text.
---
Nitpick comments:
In `@specs/inbound.openapi.yml`:
- Around line 1322-1329: Update the descriptions and documentation around
SendMessageInput and the other referenced new content to replace every
occurrence of “Email Sending API” with the sanctioned product name “Email
API/SMTP” or “Email API,” preserving the existing meaning and address shape
documentation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 595d3dc7-ac2a-4a83-9fa5-d9caaf681940
📒 Files selected for processing (2)
specs/email-sending.openapi.ymlspecs/inbound.openapi.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- specs/email-sending.openapi.yml
List, show, and delete. The list response uses the same cursor envelope as inbound messages ({ data, total_count, last_id }); the show response returns the thread at the root.
thread_id links an inbound message to its thread; message_group_id groups a thread message with the reply it belongs to.
Exposes the message's RFC 5322 Message-ID header as rfc_message_id on message and thread-message responses, avoiding a name collision with the Email Log message_id (the message UUID).
2459ef1 to
dd338f1
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
specs/inbound.openapi.yml (1)
593-600: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffAdd the full x-codeSamples language set to the new operations. The new inbound operations ship only a cURL sample; the guideline requires x-codeSamples in the priority order cURL → Node.js → PHP → Python → Ruby → .NET (C#) → Java, using official Mailtrap SDKs (with a comment noting any SDK gaps). Keep using
YOUR_API_KEYplaceholders in every added sample.
specs/inbound.openapi.yml#L593-L600: add Node.js/PHP/Python/Ruby/.NET/Java samples forreplyToInboundMessage.specs/inbound.openapi.yml#L642-L649: add the remaining language samples forreplyAllToInboundMessage.specs/inbound.openapi.yml#L697-L704: add the remaining language samples forforwardInboundMessage.specs/inbound.openapi.yml#L750-L755: add the remaining language samples forlistInboundThreads.specs/inbound.openapi.yml#L820-L825: add the remaining language samples forgetInboundThread.specs/inbound.openapi.yml#L919-L924: add the remaining language samples fordeleteInboundThread.As per coding guidelines: "Include code samples in OpenAPI specs in this priority order: cURL (shell), Node.js (JavaScript), PHP, Python, Ruby, .NET (C#), Java" and "Use official Mailtrap SDKs for language-specific code examples in x-codeSamples."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@specs/inbound.openapi.yml` around lines 593 - 600, Add the complete x-codeSamples language set in the required order—cURL, Node.js, PHP, Python, Ruby, .NET (C#), and Java—to replyToInboundMessage, replyAllToInboundMessage, forwardInboundMessage, listInboundThreads, getInboundThread, and deleteInboundThread in specs/inbound.openapi.yml at ranges 593-600, 642-649, 697-704, 750-755, 820-825, and 919-924 respectively. Use official Mailtrap SDKs for each language, document any SDK gaps in comments, and retain YOUR_API_KEY placeholders in every sample.Sources: Coding guidelines, Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@specs/inbound.openapi.yml`:
- Around line 593-600: Add the complete x-codeSamples language set in the
required order—cURL, Node.js, PHP, Python, Ruby, .NET (C#), and Java—to
replyToInboundMessage, replyAllToInboundMessage, forwardInboundMessage,
listInboundThreads, getInboundThread, and deleteInboundThread in
specs/inbound.openapi.yml at ranges 593-600, 642-649, 697-704, 750-755, 820-825,
and 919-924 respectively. Use official Mailtrap SDKs for each language, document
any SDK gaps in comments, and retain YOUR_API_KEY placeholders in every sample.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fee73268-6760-44ed-a53f-e07a2934c772
📒 Files selected for processing (2)
specs/email-sending.openapi.ymlspecs/inbound.openapi.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- specs/email-sending.openapi.yml
Adds inbound_enabled/inbound_verified on the sending domain and the domain_id/catch-all inbox flow (InboxCreateInput, *@your-domain.com addresses).
Adds rfc_message_id, in_reply_to, and references to the Email Log message and list schemas.
SPF is set on the HELO domain, not per sending domain, so the domains API's dns_records never includes an SPF entry.
dd338f1 to
864e676
Compare
Adds and updates the public API reference for Inbound Email v2.
Inbound
cursor-paginated (
data/total_count/last_id); getting a threadreturns it with its messages embedded, each tagged with a
visibility_status(
availableorplaceholder).message, with the request and response schemas and validation errors.
thread_idon inbound messages andmessage_group_idon thread messages.
rfc_message_idon message and thread-messageresponses.
domain via
domain_id; its address is returned as*@your-domain.com.Email sending
inbound_enabledandinbound_verified; when inboundis enabled,
dns_recordsincludes anMXrecord (key: inbound_mx) topublish for inbound mail.
rfc_message_id,in_reply_to, andreferences.dns_recordsexample — drop the stalespfentry(SPF is set on the HELO domain, not per sending domain).
Summary by CodeRabbit