Skip to content

[ENG-347] Fade get-raw-message#97

Merged
tanishq-atm merged 6 commits intomainfrom
tanishq/eng-347-fade-get-raw-message
Mar 9, 2026
Merged

[ENG-347] Fade get-raw-message#97
tanishq-atm merged 6 commits intomainfrom
tanishq/eng-347-fade-get-raw-message

Conversation

@tanishq-atm
Copy link
Collaborator

@tanishq-atm tanishq-atm commented Mar 9, 2026

Summary by cubic

Restored messages.getRaw to return a CloudFront-signed RawMessageResponse for the .eml, aligned with ENG-347. Confirmed messages.update (PATCH) and removed the legacy docs redirect for get-raw-message.

  • Migration
    • Update messages.getRaw(inboxId, messageId) usage to handle RawMessageResponse { message_id, size, download_url, expires_at } and download via download_url (no url alias).

Written for commit b0711ef. Summary will update on new commits.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: api path removed without deprecation

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Copy link

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

Choose a reason for hiding this comment

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

No issues found across 3 files

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## PATCH /v0/domains/{domain_id}
-  endpoint added


## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: removed the media type 'application/octet-stream' for the response with the status '200'
-  added the media type 'application/json' for the response with the status '200'


## PATCH /v0/pods/{pod_id}/domains/{domain_id}
-  endpoint added


## POST /v0/pods/{pod_id}/domains/{domain_id}/verify
-  endpoint added


## GET /v0/pods/{pod_id}/domains/{domain_id}/zone-file
-  endpoint added


## PATCH /v0/pods/{pod_id}/inboxes/{inbox_id}
-  endpoint added


## DELETE /v0/pods/{pod_id}/threads/{thread_id}
-  endpoint added


## DELETE /v0/threads/{thread_id}
-  endpoint added

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

Copy link

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

Choose a reason for hiding this comment

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

5 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="fern/docs.yml">

<violation number="1" location="fern/docs.yml:140">
P1: This redirect destination appears to be a typo (`get-raw-raw`) and will likely send users to a broken API docs URL.</violation>
</file>

<file name="fern/definition/inboxes/messages.yml">

<violation number="1">
P1: According to linked Linear issue ENG-347, `getRaw` should be faded/removed, but this change adds the `getRaw` endpoint back into the API definition.</violation>

<violation number="2" location="fern/definition/inboxes/messages.yml:68">
P1: This adds a second `update` endpoint with the same key in the same `endpoints` map; duplicate keys can overwrite one definition or fail schema/parsing validation.</violation>
</file>

<file name="fern/pages/core-concepts/messages.mdx">

<violation number="1" location="fern/pages/core-concepts/messages.mdx:238">
P2: The docs re-add `messages.getRaw` even though this change is supposed to retire raw message access.

According to linked Linear issue ENG-347, `get-raw-message` should be faded and references should migrate to `messages.get`.</violation>
</file>

<file name="fern/definition/messages.yml">

<violation number="1" location="fern/definition/messages.yml:148">
P1: According to linked Linear issue ENG-347, `get-raw-message` should be faded/retired, but this change adds the `RawMessageResponse` contract that keeps raw message download behavior in the API surface.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@@ -61,10 +61,22 @@ service:
display-name: Get Raw Message
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 9, 2026

Choose a reason for hiding this comment

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

P1: According to linked Linear issue ENG-347, getRaw should be faded/removed, but this change adds the getRaw endpoint back into the API definition.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fern/definition/inboxes/messages.yml, line 58:

<comment>According to linked Linear issue ENG-347, `getRaw` should be faded/removed, but this change adds the `getRaw` endpoint back into the API definition.</comment>

<file context>
@@ -55,6 +55,28 @@ service:
       errors:
         - global.NotFoundError
 
+    getRaw:
+      method: GET
+      path: /{message_id}/raw
</file context>
Fix with Cubic

type: list<MessageItem>
docs: Ordered by `timestamp` descending.

RawMessageResponse:
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 9, 2026

Choose a reason for hiding this comment

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

P1: According to linked Linear issue ENG-347, get-raw-message should be faded/retired, but this change adds the RawMessageResponse contract that keeps raw message download behavior in the API surface.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fern/definition/messages.yml, line 148:

<comment>According to linked Linear issue ENG-347, `get-raw-message` should be faded/retired, but this change adds the `RawMessageResponse` contract that keeps raw message download behavior in the API surface.</comment>

<file context>
@@ -145,6 +145,13 @@ types:
         type: list<MessageItem>
         docs: Ordered by `timestamp` descending.
 
+  RawMessageResponse:
+    docs: Signed URL to download the raw .eml file.
+    properties:
</file context>
Fix with Cubic

* - messages.forward(inboxId, messageId, { to, subject?, text?, html? })
* - messages.update(inboxId, messageId, { addLabels?, removeLabels? })
* - messages.getAttachment(inboxId, messageId, attachmentId)
* - messages.getRaw(inboxId, messageId) -> { url } (pre-signed S3 URL for .eml)
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 9, 2026

Choose a reason for hiding this comment

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

P2: The docs re-add messages.getRaw even though this change is supposed to retire raw message access.

According to linked Linear issue ENG-347, get-raw-message should be faded and references should migrate to messages.get.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fern/pages/core-concepts/messages.mdx, line 238:

<comment>The docs re-add `messages.getRaw` even though this change is supposed to retire raw message access.

According to linked Linear issue ENG-347, `get-raw-message` should be faded and references should migrate to `messages.get`.</comment>

<file context>
@@ -235,6 +235,8 @@ Copy one of the blocks below into Cursor or Claude for complete Messages API kno
    * - messages.forward(inboxId, messageId, { to, subject?, text?, html? })
    * - messages.update(inboxId, messageId, { addLabels?, removeLabels? })
    * - messages.getAttachment(inboxId, messageId, attachmentId)
+   * - messages.getRaw(inboxId, messageId) -> { url } (pre-signed S3 URL for .eml)
+   * - messages.getRaw(inboxId, messageId)
    *
</file context>
Fix with Cubic

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## PATCH /v0/domains/{domain_id}
-  endpoint added


## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: removed the media type 'application/octet-stream' for the response with the status '200'
-  added the media type 'application/json' for the response with the status '200'


## PATCH /v0/pods/{pod_id}/domains/{domain_id}
-  endpoint added


## POST /v0/pods/{pod_id}/domains/{domain_id}/verify
-  endpoint added


## GET /v0/pods/{pod_id}/domains/{domain_id}/zone-file
-  endpoint added


## PATCH /v0/pods/{pod_id}/inboxes/{inbox_id}
-  endpoint added


## DELETE /v0/pods/{pod_id}/threads/{thread_id}
-  endpoint added


## DELETE /v0/threads/{thread_id}
-  endpoint added

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

@tanishq-atm
Copy link
Collaborator Author

@cubic thoughts?

@cubic-dev-ai
Copy link

cubic-dev-ai bot commented Mar 9, 2026

@cubic thoughts?

@tanishq-atm The shift from returning the file directly to a pre-signed URL is a solid move for performance, but there are a few things to tidy up:

  • Documentation Duplication: In fern/pages/core-concepts/messages.mdx, you added the new signature for messages.getRaw but didn't remove the old one. It currently shows both:

    * - messages.getRaw(inboxId, messageId) -> { url } (pre-signed S3 URL for .eml)
    * - messages.getRaw(inboxId, messageId)

    You should remove the second line to avoid confusion.

  • Breaking Change: As noted by the API bot, changing the response from application/octet-stream to application/json is a breaking change. Any existing integrations or SDK users expecting a file stream will fail until they update their logic to parse the JSON and fetch the URL.

  • Redirect Removal: You removed the redirect in fern/docs.yml from get-raw-message to get-raw. If the slug get-raw is still active, it’s usually better to keep the redirect so old bookmarks or external links don't 404.

  • Service Organization: Moving the update endpoint higher in fern/definition/inboxes/messages.yml makes sense for grouping, but double-check that this doesn't affect the generated SDK method ordering in a way that matters to your team's conventions.

View learnings | Settings | Cubic Docs

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## PATCH /v0/domains/{domain_id}
-  endpoint added


## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: removed the media type 'application/octet-stream' for the response with the status '200'
-  added the media type 'application/json' for the response with the status '200'


## PATCH /v0/pods/{pod_id}/domains/{domain_id}
-  endpoint added


## POST /v0/pods/{pod_id}/domains/{domain_id}/verify
-  endpoint added


## GET /v0/pods/{pod_id}/domains/{domain_id}/zone-file
-  endpoint added


## PATCH /v0/pods/{pod_id}/inboxes/{inbox_id}
-  endpoint added


## DELETE /v0/pods/{pod_id}/threads/{thread_id}
-  endpoint added


## DELETE /v0/threads/{thread_id}
-  endpoint added

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Copy link

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

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="fern/pages/core-concepts/messages.mdx">

<violation number="1" location="fern/pages/core-concepts/messages.mdx:238">
P2: Use camelCase field names for the TypeScript `getRaw` response shape to match SDK conventions used in this doc.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

* - messages.forward(inboxId, messageId, { to, subject?, text?, html? })
* - messages.update(inboxId, messageId, { addLabels?, removeLabels? })
* - messages.getAttachment(inboxId, messageId, attachmentId)
* - messages.getRaw(inboxId, messageId) -> { message_id, size, download_url, expires_at } (CloudFront signed URL for .eml)
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 9, 2026

Choose a reason for hiding this comment

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

P2: Use camelCase field names for the TypeScript getRaw response shape to match SDK conventions used in this doc.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fern/pages/core-concepts/messages.mdx, line 238:

<comment>Use camelCase field names for the TypeScript `getRaw` response shape to match SDK conventions used in this doc.</comment>

<file context>
@@ -235,7 +235,7 @@ Copy one of the blocks below into Cursor or Claude for complete Messages API kno
    * - messages.update(inboxId, messageId, { addLabels?, removeLabels? })
    * - messages.getAttachment(inboxId, messageId, attachmentId)
-   * - messages.getRaw(inboxId, messageId) -> { url } (pre-signed S3 URL for .eml)
+   * - messages.getRaw(inboxId, messageId) -> { message_id, size, download_url, expires_at } (CloudFront signed URL for .eml)
    * - messages.getRaw(inboxId, messageId)
    *
</file context>
Suggested change
* - messages.getRaw(inboxId, messageId) -> { message_id, size, download_url, expires_at } (CloudFront signed URL for .eml)
* - messages.getRaw(inboxId, messageId) -> { messageId, size, downloadUrl, expiresAt } (CloudFront signed URL for .eml)
Fix with Cubic

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## PATCH /v0/domains/{domain_id}
-  endpoint added


## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: removed the media type 'application/octet-stream' for the response with the status '200'
-  added the media type 'application/json' for the response with the status '200'


## PATCH /v0/pods/{pod_id}/domains/{domain_id}
-  endpoint added


## POST /v0/pods/{pod_id}/domains/{domain_id}/verify
-  endpoint added


## GET /v0/pods/{pod_id}/domains/{domain_id}/zone-file
-  endpoint added


## PATCH /v0/pods/{pod_id}/inboxes/{inbox_id}
-  endpoint added


## DELETE /v0/pods/{pod_id}/threads/{thread_id}
-  endpoint added


## DELETE /v0/threads/{thread_id}
-  endpoint added

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✨ API Changes

# API Changelog n/a vs. n/a

## PATCH /v0/domains/{domain_id}
-  endpoint added


## GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw
- :warning: removed the media type 'application/octet-stream' for the response with the status '200'
-  added the media type 'application/json' for the response with the status '200'


## PATCH /v0/pods/{pod_id}/domains/{domain_id}
-  endpoint added


## POST /v0/pods/{pod_id}/domains/{domain_id}/verify
-  endpoint added


## GET /v0/pods/{pod_id}/domains/{domain_id}/zone-file
-  endpoint added


## PATCH /v0/pods/{pod_id}/inboxes/{inbox_id}
-  endpoint added


## DELETE /v0/pods/{pod_id}/threads/{thread_id}
-  endpoint added


## DELETE /v0/threads/{thread_id}
-  endpoint added

💡 Download api-changelog-diff artifact or tag @fern Writer in #github-prs for changelog.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

@tanishq-atm tanishq-atm merged commit c35e3ed into main Mar 9, 2026
5 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