From 3d93283d442becb87dbfa5ff0973e2eb1bd95d62 Mon Sep 17 00:00:00 2001 From: Felipe Freitag Date: Tue, 24 Nov 2026 10:40:34 -0300 Subject: [PATCH 1/3] fix(receiving): match the received email schema to the API Add html_format (query and response), authentication and raw. Type header values as strings with lowercase names. --- resend.yaml | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/resend.yaml b/resend.yaml index 0d85263..ac2ed34 100644 --- a/resend.yaml +++ b/resend.yaml @@ -321,6 +321,16 @@ paths: type: string format: uuid description: The ID of the received email. + - name: html_format + in: query + required: false + schema: + type: string + enum: + - data_uri + - cid + default: data_uri + description: How inline images are referenced in `html`. `data_uri` returns them as base64 `data:` URIs. `cid` keeps the original `cid:` references, which match the `content_id` of an attachment. Emails too large to inline always return `cid`, so check `html_format` on the response. responses: '200': description: OK @@ -6315,14 +6325,60 @@ components: type: [string, "null"] description: The HTML content of the email. example: '

Email content

' + html_format: + type: string + enum: + - data_uri + - cid + description: How inline images are referenced in `html`. Usually matches the requested `html_format`, but is `cid` when the email is too large to inline. + example: 'data_uri' text: type: [string, "null"] description: The plain text content of the email. example: 'Email content' headers: type: [object, "null"] - description: The email headers. - example: {'X-Custom-Header': 'value'} + additionalProperties: + type: string + description: The headers of the received message, keyed by lowercase header name. Every value is a string. A header with several values, such as `received` or `references`, holds them as a JSON-encoded array. + example: + subject: 'Hello World' + references: '["",""]' + x-custom-header: 'value' + authentication: + type: [object, "null"] + description: The SPF, DKIM, and DMARC results computed when the email was received. The receiving mail server computes them, so the sender cannot forge them. `null` for emails received before this field was introduced. + properties: + spf: + $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' + dkim: + $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' + dmarc: + $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' + required: + - spf + - dkim + - dmarc + example: + spf: 'pass' + dkim: 'pass' + dmarc: 'pass' + raw: + type: [object, "null"] + description: A signed URL to download the original email file, attachments included. `null` when the raw email is not available. + properties: + download_url: + type: string + description: Signed URL to download the raw email file. + example: 'https://cloudfront.example.com/raw/message-id?Signature=...' + expires_at: + type: string + format: date-time + description: Timestamp when the download URL expires. + example: '2024-10-27T18:30:00.000Z' + required: + - download_url + - expires_at created_at: type: string format: date-time @@ -6357,6 +6413,17 @@ components: size: type: integer description: Size of the attachment in bytes. + ReceivedEmailAuthenticationVerdict: + type: string + enum: + - pass + - fail + - gray + - processing_failed + - disabled + - unknown + description: The result of one authentication check. `gray` means the check gave no clear pass or fail. + example: 'pass' ListReceivedEmailsResponse: type: object properties: From 07d18cdc7d9c475f201fb585bf745a8ddc09af49 Mon Sep 17 00:00:00 2001 From: Felipe Freitag Date: Tue, 24 Nov 2026 10:47:35 -0300 Subject: [PATCH 2/3] fix(receiving): limit the change to the headers value type Drop html_format, authentication and raw. They go in their own PR and rollout. Drop the JSON-encoding note until backend confirms it. --- resend.yaml | 69 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 67 deletions(-) diff --git a/resend.yaml b/resend.yaml index ac2ed34..d369b57 100644 --- a/resend.yaml +++ b/resend.yaml @@ -321,16 +321,6 @@ paths: type: string format: uuid description: The ID of the received email. - - name: html_format - in: query - required: false - schema: - type: string - enum: - - data_uri - - cid - default: data_uri - description: How inline images are referenced in `html`. `data_uri` returns them as base64 `data:` URIs. `cid` keeps the original `cid:` references, which match the `content_id` of an attachment. Emails too large to inline always return `cid`, so check `html_format` on the response. responses: '200': description: OK @@ -6325,13 +6315,6 @@ components: type: [string, "null"] description: The HTML content of the email. example: '

Email content

' - html_format: - type: string - enum: - - data_uri - - cid - description: How inline images are referenced in `html`. Usually matches the requested `html_format`, but is `cid` when the email is too large to inline. - example: 'data_uri' text: type: [string, "null"] description: The plain text content of the email. @@ -6340,45 +6323,8 @@ components: type: [object, "null"] additionalProperties: type: string - description: The headers of the received message, keyed by lowercase header name. Every value is a string. A header with several values, such as `received` or `references`, holds them as a JSON-encoded array. - example: - subject: 'Hello World' - references: '["",""]' - x-custom-header: 'value' - authentication: - type: [object, "null"] - description: The SPF, DKIM, and DMARC results computed when the email was received. The receiving mail server computes them, so the sender cannot forge them. `null` for emails received before this field was introduced. - properties: - spf: - $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' - dkim: - $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' - dmarc: - $ref: '#/components/schemas/ReceivedEmailAuthenticationVerdict' - required: - - spf - - dkim - - dmarc - example: - spf: 'pass' - dkim: 'pass' - dmarc: 'pass' - raw: - type: [object, "null"] - description: A signed URL to download the original email file, attachments included. `null` when the raw email is not available. - properties: - download_url: - type: string - description: Signed URL to download the raw email file. - example: 'https://cloudfront.example.com/raw/message-id?Signature=...' - expires_at: - type: string - format: date-time - description: Timestamp when the download URL expires. - example: '2024-10-27T18:30:00.000Z' - required: - - download_url - - expires_at + description: The email headers, keyed by lowercase header name. Every value is a string. + example: {'x-custom-header': 'value'} created_at: type: string format: date-time @@ -6413,17 +6359,6 @@ components: size: type: integer description: Size of the attachment in bytes. - ReceivedEmailAuthenticationVerdict: - type: string - enum: - - pass - - fail - - gray - - processing_failed - - disabled - - unknown - description: The result of one authentication check. `gray` means the check gave no clear pass or fail. - example: 'pass' ListReceivedEmailsResponse: type: object properties: From d9b469f8e8565b4416d6ad633010292b223575eb Mon Sep 17 00:00:00 2001 From: Felipe Freitag Date: Tue, 24 Nov 2026 11:07:43 -0300 Subject: [PATCH 3/3] fix(receiving): drop the restated value type from the headers description --- resend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resend.yaml b/resend.yaml index d369b57..fe26a60 100644 --- a/resend.yaml +++ b/resend.yaml @@ -6323,7 +6323,7 @@ components: type: [object, "null"] additionalProperties: type: string - description: The email headers, keyed by lowercase header name. Every value is a string. + description: The email headers, keyed by lowercase header name. example: {'x-custom-header': 'value'} created_at: type: string