# Resend > ## Documentation Index --- # Source: https://resend.com/docs/knowledge-base/403-error-domain-mismatch.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # 403 Error Using Verified Domain > Learn how to resolve a 403 error caused by using a domain in your API request that doesn't match your verified domain. A 403 error can occur when there's a mismatch between the domain you're using in your API request and the domain you've verified in Resend. ## The Problem You've verified a domain (or subdomain) in Resend, but your API request is using a different domain. **Example scenario:** * You verified `sending.domain.com` in Resend * Your API request is using `domain.com` (i.e., without the `sending` subdomain) ## How to Identify This Issue 1. Check which domain you've verified in your [Resend Domains page](https://resend.com/domains). 2. Compare it with the domain you're using in [your API request's](https://resend.com/logs) `from` field. ## Solution You have two options to resolve this: **Option 1: Update your API request** (Recommended) Update your API call to use the verified domain. For example, if you verified `sending.domain.com`, make sure your `from` field uses that exact domain: ```javascript theme={"theme":{"light":"github-light","dark":"vesper"}} resend.emails.send({ from: 'onboarding@sending.domain.com', // Use your verified domain to: 'user@example.com', subject: 'Hello World', html: '

Hello World

', }); ``` **Option 2: Delete and re-add the domain** 1. Delete the domain you've added in Resend 2. Add and verify the domain that matches what you're using in your API request Make sure the domain in your API request exactly matches the domain you've verified in Resend, including any subdomains. ## Still Having Issues? If you've verified that your domain matches and you're still getting a 403 error: 1. Verify that your domain is fully verified in the [Resend Domains page](https://resend.com/domains). 2. Double-check that the domain in your API request's `from` field exactly matches your verified domain 3. Ensure your API key has the necessary permissions. 4. [Contact Resend support](https://resend.com/help) with details about your error --- # Source: https://resend.com/docs/knowledge-base/403-error-resend-dev-domain.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # 403 Error Using resend.dev Domain > Learn how to resolve a 403 error when using the resend.dev domain to send emails to recipients other than your own. You may receive a 403 error with the following message when trying to send emails: ``` You can only send testing emails to your own email address (your-email-address@domain.com). To send emails to other recipients, please verify a domain at resend.com/domains, and change the `from` address to an email using this domain. ``` ## The Problem You're using the default `resend.dev` domain while sending to email addresses other than your own. **Example scenario:** * Your API request uses `from: 'onboarding@resend.dev'` * You're trying to send to recipients other than your own email address ## Why This Happens The `resend.dev` domain is only available for testing purposes and can only send emails to the email address associated with your Resend account. This restriction helps protect domain reputation and ensures proper email deliverability. ## Solution To send emails to recipients other than your own email address, you need to add and verify your own domain in Resend: 1. Go to the [Domains page](https://resend.com/domains) in your Resend dashboard 2. Click **Add Domain** 3. Enter your domain name 4. Follow the verification steps to add the required DNS records 5. Once verified, update your API request to use your verified domain For detailed instructions on verifying your domain, check out our [domain verification guide](/dashboard/domains/introduction) or the DNS guide for your specific provider. ## Still Having Issues? If you've verified your domain and updated your API request but you're still getting a 403 error: 1. Verify that your domain is fully verified in the [Resend Domains page](https://resend.com/domains). 2. Ensure the domain in your API request's `from` field uses your verified domain (not `resend.dev`). 3. Make sure you're not trying to send to your own email address when using `resend.dev`. 4. [Contact Resend support](https://resend.com/help) with details about your error. --- # Source: https://resend.com/docs/knowledge-base/account-quotas-and-limits.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # What are Resend account quotas and limits? > Learn what quotas and limits apply to accounts. Resend regulates email volume in three ways: 1. email volume (quota) - for [Transactional Email](/knowledge-base/what-sending-feature-to-use#what-is-a-transactional-email) 2. number of contacts - for [Marketing Email](/knowledge-base/what-sending-feature-to-use#what-is-a-marketing-email) 3. sending rate These limits help improve your deliverability and likelihood of reaching your recipient's inbox. Both **sent emails** and **received emails** (inbound) count towards your account's email quota. Each received email counts as 1 email against your daily and monthly limits, just like sent emails. ## Free Account Quotas and Limits Free accounts have the following: * Transactional emails: daily email quota of 100 emails/day and 3,000 emails/month. This quota includes both sent and received emails. Multiple `To`, `CC`, or `BCC` recipients in sent emails count as separate emails towards this quota. * Marketing emails: unlimited emails to up to 1,000 contacts per month. ## Paid Plan Quota * Transactional Pro, Scale and Enterprise plans have no daily quota limits, though the plan tier will dictate the monthly email quota. Both sent and received emails count towards this monthly quota. To see your current month usage, view the [**Usage page**](https://resend.com/settings/usage). Multiple `To`, `CC`, or `BCC` recipients in sent emails count as separate emails towards the monthly quota. * Marketing Pro, Enterprise plans have unlimited emails, though the plan tier will dictate the monthly contacts. ## Overage Limits Paid plans include pay-as-you-go overages, which allow you to continue sending emails after you've reached your monthly quota. To prevent extreme overages and unexpected costs, we impose a hard limit of 5x your monthly quota. By default, overage usage is capped at **5x your plan's monthly quota**. Once you reach this limit, sending will be paused until the next billing cycle. If you need to adjust this limit, please [contact support](https://resend.com/help). While overages provide flexibility for occasional spikes in email volume, they can be more expensive per email than upgrading your plan. If you consistently exceed your quota, consider [upgrading to a higher tier](https://resend.com/settings/billing) for better value and more predictable costs. ## Rate Limits All accounts start with a rate limit of 2 requests per second. The [rate limits](/api-reference/introduction#rate-limit) follow the [IETF standard](https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-ratelimit-headers) for stating the rate limit in the response header. If you have specific requirements, [contact support](https://resend.com/help) to request a rate increase. ## Bounce Rate All accounts must maintain a bounce rate of under **4%**. The [**Metrics page**](https://resend.com/metrics) within an account and/or [webhooks](https://resend.com/docs/webhooks/event-types#email-bounced) allow you to monitor your account bounce rates. Maintaining a bounce rate above 4% may result in a temporary pause in sending until the bounce rate is reduced. Tips to keep a bounce rate low: * Remove inactive user email addresses from email lists. * Only send to recipients who have given consent to receive email. * When testing, avoid sending to fake email addresses. Use Resend's [test email addresses](/dashboard/emails/send-test-emails) instead. * If you are using open/click tracking, periodically remove recipients who are not engaging with your emails from your email lists. ## Spam Rate All accounts must have a spam rate of under **0.08%**. The [**Metrics page**](https://resend.com/metrics) within an account and/or [webhooks](https://resend.com/docs/webhooks/event-types#email-complained) allow you to monitor your account spam rates. Maintaining a spam rate over 0.08% may result in a temporary pause in sending until the spam rate is reduced. Tips to keep a spam rate low: * Give recipients an easy way to opt-out of emails. * Send relevant and timely emails. * Only send to recipients who have given consent to receive email. --- # Source: https://resend.com/docs/api-reference/contacts/add-contact-to-segment.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Add Contact to Segment > Add an existing contact to a segment. export const ResendParamField = ({children, body, path, ...props}) => { const [lang, setLang] = useState(() => { return localStorage.getItem('code') || '"Node.js"'; }); useEffect(() => { const onStorage = event => { const key = event.detail.key; if (key === 'code') { setLang(event.detail.value); } }; document.addEventListener('mintlify-localstorage', onStorage); return () => { document.removeEventListener('mintlify-localstorage', onStorage); }; }, []); const toCamelCase = str => typeof str === 'string' ? str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase()) : str; const resolvedBody = useMemo(() => { const value = JSON.parse(lang); return value === 'Node.js' ? toCamelCase(body) : body; }, [body, lang]); const resolvedPath = useMemo(() => { const value = JSON.parse(lang); return value === 'Node.js' ? toCamelCase(path) : path; }, [path, lang]); return {children} ; }; ## Path Parameters Either `id` or `email` must be provided. The Contact ID. The Contact Email. The Segment ID. ```ts Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); // Add by contact id const { data, error } = await resend.contacts.segments.add({ contactId: 'e169aa45-1ecf-4183-9955-b1499d5701d3', segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf', }); // Add by contact email const { data, error } = await resend.contacts.segments.add({ email: 'steve.wozniak@gmail.com', segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf', }); ``` ```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); // Add by contact id $resend->contacts->segments->add( contact: 'e169aa45-1ecf-4183-9955-b1499d5701d3', segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf' ); // Add by contact email $resend->contacts->segments->add( contact: 'steve.wozniak@gmail.com', segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf' ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import resend resend.api_key = 're_xxxxxxxxx' # Add by contact id params = { "segment_id": '78261eea-8f8b-4381-83c6-79fa7120f1cf', "contact_id": 'e169aa45-1ecf-4183-9955-b1499d5701d3', } response = resend.Contacts.Segments.add(params) ``` ```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}} require 'resend' Resend.api_key = 're_xxxxxxxxx' # Add by contact id result = Resend::Contacts::Segments.add( contact_id: 'e169aa45-1ecf-4183-9955-b1499d5701d3', segment_id: '78261eea-8f8b-4381-83c6-79fa7120f1cf' ) # Add by contact email result = Resend::Contacts::Segments.add( email: 'steve.wozniak@gmail.com', segment_id: '78261eea-8f8b-4381-83c6-79fa7120f1cf' ) ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} package main import ( "context" "fmt" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") // Add by contact id addParams := &resend.AddContactSegmentRequest{ ContactId: "e169aa45-1ecf-4183-9955-b1499d5701d3", SegmentId: "78261eea-8f8b-4381-83c6-79fa7120f1cf", } response, err := client.Contacts.Segments.AddWithContext(ctx, addParams) if err != nil { panic(err) } fmt.Println(response) // Add by contact email addByEmailParams := &resend.AddContactSegmentRequest{ Email: "steve.wozniak@gmail.com", SegmentId: "78261eea-8f8b-4381-83c6-79fa7120f1cf", } response, err = client.Contacts.Segments.AddWithContext(ctx, addByEmailParams) if err != nil { panic(err) } fmt.Println(response) } ``` ```rust Rust theme={"theme":{"light":"github-light","dark":"vesper"}} use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); // Update by contact id let _contact = resend .contacts .add_contact_segment( "e169aa45-1ecf-4183-9955-b1499d5701d3", "78261eea-8f8b-4381-83c6-79fa7120f1cf", ) .await?; // // Update by contact email let _contact = resend .contacts .add_contact_segment( "steve.wozniak@gmail.com", "78261eea-8f8b-4381-83c6-79fa7120f1cf", ) .await?; Ok(()) } ``` ```java Java theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); // Add by contact id AddContactToSegmentOptions optionsById = AddContactToSegmentOptions.builder() .id("e169aa45-1ecf-4183-9955-b1499d5701d3") .segmentId("78261eea-8f8b-4381-83c6-79fa7120f1cf") .build(); resend.contacts().segments().add(optionsById); // Add by contact email AddContactToSegmentOptions optionsByEmail = AddContactToSegmentOptions.builder() .email("steve.wozniak@gmail.com") .segmentId("78261eea-8f8b-4381-83c6-79fa7120f1cf") .build(); resend.contacts().segments().add(optionsByEmail); } } ``` ```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI await resend.ContactAddToSegmentAsync( contactId: new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ), segmentId: new Guid( "78261eea-8f8b-4381-83c6-79fa7120f1cf" ) ); ``` ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} // Update by contact id curl -X POST 'https://api.resend.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/segments/78261eea-8f8b-4381-83c6-79fa7120f1cf' \ -H 'Authorization: Bearer re_xxxxxxxxx' // Update by contact email curl -X POST 'https://api.resend.com/contacts/steve.wozniak@gmail.com/segments/78261eea-8f8b-4381-83c6-79fa7120f1cf' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' ``` ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}} { "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf" } ``` --- # Source: https://resend.com/docs/dashboard/emails/add-unsubscribe-to-transactional-emails.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Add an unsubscribe link to transactional emails > Learn how to give email recipients the ability to unsubscribe without searching for the unsubscribe link. For contact and unsubscribe management workflows, see the [Audiences overview](/dashboard/audiences/introduction), where Broadcasts are built for keeping track of topics, segments, and unsubscribe preferences. Resend doesn't manage contact lists for transactional emails. If you manage your own list, you can add the `List-Unsubscribe: https://example.com/unsubscribe` header when sending emails using the Resend API. As of February 2024, your bulk messages must include a URL version in your list-unsubscribe header, `List-Unsubscribe-Post: List-Unsubscribe=One-Click`, and to allow for a `POST` request from the same URL. When receiving a `POST`, it should return a blank page with `200 (OK)` or `202 (Accepted)`, and should show the regular unsubscribe page with the `GET` method. Ensure that users stop receiving email within 48 hours of this request. This header allows email clients to offer an easy “Unsubscribe” option in their UI, enhancing user experience and decreasing spam complaints. You can read more about this requirement in our [Bulk Sending Requirements blog post.](https://resend.com/blog/gmail-and-yahoo-bulk-sending-requirements-for-2024#one-click-unsubscribe) ```ts Node.js {11} theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); await resend.emails.send({ from: 'Acme ', to: ['delivered@resend.dev'], subject: 'hello world', text: 'it works!', headers: { 'List-Unsubscribe': '', }, }); ``` ## Example See the full source code. --- # Source: https://resend.com/docs/knowledge-base/anything-integration.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # How to add the Resend integration to your Anything project > Learn how to add the Resend integration to your Anything project. export const YouTube = ({id}) => { return ; }; [Anything](https://createanything.com) is a platform for building web sites, tools, apps, and projects via chat. With their [Resend integration](https://www.createanything.com/docs/integrations/resend), you can send emails from your Anything project. If you prefer to watch a video, check out our video walkthrough below. ## 1. Call the Resend integration in Anything Type `/Resend` in the chat and select the integration, and ask Anything to add email functionality to your project. adding the Resend integration to a Anything chat ## 2. Add your Resend API key Anything usually prompts you for a Resend API key, which you can add in the [Resend Dashboard](https://resend.com/api-keys). If Anything doesn't prompt you for a Resend API key, click the **More options** button and select **Secrets**. Click the **Add new secret** button. * **Name:** `RESEND_API_KEY` * **Value:** Your Resend API key (e.g., `re_xxxxxxxxx0`) Learn more about [Secrets in Create](https://www.createanything.com/docs/essentials#project-settings). ## 3. Add a custom domain to your Resend account By default, you can only send emails to your own email address. To send emails to other email addresses: 1. Add a [custom domain to your Resend account](https://resend.com/domains). 2. Add the custom domain to the `from` field in the `resend` function in Create. Learn more about [Functions in Create](https://www.createanything.com/docs/builder/functions). --- # Source: https://resend.com/docs/dashboard/receiving/attachments.md # Source: https://resend.com/docs/dashboard/emails/attachments.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Attachments > Send emails with attachments. There are two ways to send attachments: 1. [From a remote file](#send-attachments-from-a-remote-file) 2. [From a local file](#send-attachments-from-a-local-file) We currently do not support sending attachments [when using our batch endpoint](/api-reference/emails/send-batch-emails). ## Send attachments from a remote file Include the `path` parameter to send attachments from a remote file. This parameter accepts a URL to the file you want to attach. Define the file name that will be attached using the `filename` parameter. ```ts Node.js {12-13} theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); await resend.emails.send({ from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Receipt for your payment', html: '

Thanks for the payment

', attachments: [ { path: 'https://resend.com/static/sample/invoice.pdf', filename: 'invoice.pdf', }, ], }); ``` ```php PHP {10-11} theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acme ', 'to' => ['delivered@resend.dev'], 'subject' => 'Receipt for your payment', 'html' => '

Thanks for the payment

', 'attachments' => [ [ 'path' => 'https://resend.com/static/sample/invoice.pdf', 'filename' => 'invoice.pdf' ] ] ]); ``` ```python Python {6-7} theme={"theme":{"light":"github-light","dark":"vesper"}} import resend resend.api_key = "re_xxxxxxxxx" attachment: resend.RemoteAttachment = { "path": "https://resend.com/static/sample/invoice.pdf", "filename": "invoice.pdf", } params: resend.Emails.SendParams = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [attachment], } resend.Emails.send(params) ``` ```rb Ruby {12-13} theme={"theme":{"light":"github-light","dark":"vesper"}} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [ { "path": "https://resend.com/static/sample/invoice.pdf", "filename": 'invoice.pdf', } ] } Resend::Emails.send(params) ``` ```go Go {12-13} theme={"theme":{"light":"github-light","dark":"vesper"}} import ( "fmt" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") attachment := &resend.Attachment{ Path: "https://resend.com/static/sample/invoice.pdf", Filename: "invoice.pdf", } params := &resend.SendEmailRequest{ From: "Acme ", To: []string{"delivered@resend.dev"}, Subject: "Receipt for your payment", Html: "

Thanks for the payment

", Attachments: []*resend.Attachment{attachment}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {12-13} theme={"theme":{"light":"github-light","dark":"vesper"}} use resend_rs::types::{CreateAttachment, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acme "; let to = ["delivered@resend.dev"]; let subject = "Receipt for your payment"; let path = "https://resend.com/static/sample/invoice.pdf"; let filename = "invoice.pdf"; let email = CreateEmailBaseOptions::new(from, to, subject) .with_html("

Thanks for the payment

") .with_attachment(CreateAttachment::from_path(path).with_filename(filename)); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {8-9} theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Attachment att = Attachment.builder() .path("https://resend.com/static/sample/invoice.pdf") .fileName("invoice.pdf") .build(); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acme ") .to("delivered@resend.dev") .subject("Receipt for your payment") .html("

Thanks for the payment

") .attachments(att) .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {14-18} theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; using System.Collections.Generic; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "Acme ", To = "delivered@resend.dev", Subject = "Receipt for your payment", HtmlBody = "

Thanks for the payment

", }; message.Attachments = new List(); message.Attachments.Add( new EmailAttachment() { Filename = "invoice.pdf", Path = "https://resend.com/static/sample/invoice.pdf", } ); var resp = await resend.EmailSendAsync( message ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {11-12} theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [ { "path": "https://resend.com/static/sample/invoice.pdf", "filename": "invoice.pdf" } ] }' ```
## Send attachments from a local file Include the `content` parameter to send attachments from a local file. This parameter accepts the Base64 encoded content of the file you want to attach. Define the file name that will be attached using the `filename` parameter. ```ts Node.js {16-17} theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; import fs from 'fs'; const resend = new Resend('re_xxxxxxxxx'); const filepath = `${__dirname}/static/invoice.pdf`; const attachment = fs.readFileSync(filepath).toString('base64'); await resend.emails.send({ from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Receipt for your payment', text: '

Thanks for the payment

', attachments: [ { content: attachment, filename: 'invoice.pdf', }, ], }); ``` ```php PHP {10-11} theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acme ', 'to' => ['delivered@resend.dev'], 'subject' => 'Receipt for your payment', 'html' => '

Thanks for the payment

', 'attachments' => [ [ 'filename' => 'invoice.pdf', 'content' => $invoiceBuffer ] ] ]); ``` ```python Python {10} theme={"theme":{"light":"github-light","dark":"vesper"}} import os import resend resend.api_key = "re_xxxxxxxxx" f: bytes = open( os.path.join(os.path.dirname(__file__), "../static/invoice.pdf"), "rb" ).read() attachment: resend.Attachment = {"content": list(f), "filename": "invoice.pdf"} params: resend.Emails.SendParams = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [attachment], } resend.Emails.send(params) ``` ```rb Ruby {14-15} theme={"theme":{"light":"github-light","dark":"vesper"}} require "resend" Resend.api_key = "re_xxxxxxxxx" file = IO.read("invoice.pdf") params = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [ { "content": file.bytes, "filename": 'invoice.pdf', } ] } Resend::Emails.send(params) ``` ```go Go {19-20} theme={"theme":{"light":"github-light","dark":"vesper"}} import ( "fmt" "os" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") pwd, _ := os.Getwd() f, err := os.ReadFile(pwd + "/static/invoice.pdf") if err != nil { panic(err) } attachment := &resend.Attachment{ Content: f, Filename: "invoice.pdf", } params := &resend.SendEmailRequest{ From: "Acme ", To: []string{"delivered@resend.dev"}, Subject: "Receipt for your payment", Html: "

Thanks for the payment

", Attachments: []*resend.Attachment{attachment}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {22} theme={"theme":{"light":"github-light","dark":"vesper"}} use std::fs::File; use std::io::Read; use resend_rs::types::{CreateAttachment, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acme "; let to = ["delivered@resend.dev"]; let subject = "Receipt for your payment"; let filename = "invoice.pdf"; let mut f = File::open(filename).unwrap(); let mut invoice = Vec::new(); f.read_to_end(&mut invoice).unwrap(); let email = CreateEmailBaseOptions::new(from, to, subject) .with_html("

Thanks for the payment

") .with_attachment(CreateAttachment::from_content(invoice).with_filename(filename)); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {8-9} theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Attachment att = Attachment.builder() .fileName("invoice.pdf") .content("invoiceBuffer") .build(); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acme ") .to("delivered@resend.dev") .subject("Receipt for your payment") .html("

Thanks for the payment

") .attachments(att) .build(); CreateEmailOptions params = CreateEmailOptions.builder() } } ``` ```csharp .NET {15-19} theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; using System.Collections.Generic; using System.IO; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "Acme ", To = "delivered@resend.dev", Subject = "Receipt for your payment", HtmlBody = "

Thanks for the payment

", }; message.Attachments = new List(); message.Attachments.Add( new EmailAttachment() { Filename = "invoice.pdf", Content = await File.ReadAllBytesAsync( "invoice.pdf" ), } ); var resp = await resend.EmailSendAsync( message ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {11-12} theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Receipt for your payment", "html": "

Thanks for the payment

", "attachments": [ { "content": "UmVzZW5kIGF0dGFjaG1lbnQgZXhhbXBsZS4gTmljZSBqb2Igc2VuZGluZyB0aGUgZW1haWwh%", "filename": "invoice.txt" } ] }' ```
## Embed Images using CID You can optionally embed an image in the HTML body of the email. Both remote and local attachments are supported. All attachment requirements, options, and limitations apply to embedded inline images as well. Embedding images requires two steps: **1. Add the CID in the email HTML.** Use the prefix `cid:` to reference the ID in the `src` attribute of an image tag in the HTML body of the email. ```html theme={"theme":{"light":"github-light","dark":"vesper"}} ``` **2. Reference the CID in the attachment** The content id is an arbitrary string set by you, and must be less than 128 characters. ```ts Node.js {9, 14} theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); await resend.emails.send({ from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Thank you for contacting us', html: '

Here is our inline logo

', attachments: [ { path: 'https://resend.com/static/sample/logo.png', filename: 'logo.png', contentId: 'logo-image', }, ], }); ``` ```php PHP {7,12} theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acme ', 'to' => ['delivered@resend.dev'], 'subject' => 'Thank you for contacting us', 'html' => '

Here is our inline logo

', 'attachments' => [ [ 'path' => 'https://resend.com/static/sample/logo.png', 'filename' => 'logo.png', 'content_id' => 'logo-image', ] ] ]); ``` ```python Python {8,15} theme={"theme":{"light":"github-light","dark":"vesper"}} import resend resend.api_key = "re_xxxxxxxxx" attachment: resend.RemoteAttachment = { "path": "https://resend.com/static/sample/logo.png", "filename": "logo.png", "content_id": "logo-image", } params: resend.Emails.SendParams = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Thank you for contacting us", "html": "

Here is our inline logo

", "attachments": [attachment], } resend.Emails.send(params) ``` ```rb Ruby {9, 14} theme={"theme":{"light":"github-light","dark":"vesper"}} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Thank you for contacting us", "html": "

Here is our inline logo

", "attachments": [ { "path": "https://resend.com/static/sample/logo.png", "filename": 'logo.png', "content_id": "logo-image", } ] } Resend::Emails.send(params) ``` ```go Go {14, 21} theme={"theme":{"light":"github-light","dark":"vesper"}} import ( "fmt" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") attachment := &resend.Attachment{ Path: "https://resend.com/static/sample/logo.png", Filename: "logo.png", ContentId: "logo-image", } params := &resend.SendEmailRequest{ From: "Acme ", To: []string{"delivered@resend.dev"}, Subject: "Thank you for contacting us", Html: "

Here is our inline logo

", Attachments: []*resend.Attachment{attachment}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {14, 17} theme={"theme":{"light":"github-light","dark":"vesper"}} use resend_rs::types::{CreateAttachment, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acme "; let to = ["delivered@resend.dev"]; let subject = "Thank you for contacting us"; let path = "https://resend.com/static/sample/logo.png"; let filename = "logo.png"; let content_id = "logo-image"; let email = CreateEmailBaseOptions::new(from, to, subject) .with_html("

Here is our inline logo

") .with_attachment( CreateAttachment::from_path(path) .with_filename(filename) .with_content_id(content_id), ); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {10, 17} theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Attachment att = Attachment.builder() .path("https://resend.com/static/sample/logo.png") .fileName("logo.png") .ContentId("logo-image") .build(); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acme ") .to("delivered@resend.dev") .subject("Thank you for contacting us") .html("

Here is our inline logo

") .attachments(att) .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {11, 18} theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; using System.Collections.Generic; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "Acme ", To = "delivered@resend.dev", Subject = "Thank you for contacting us", HtmlBody = "

Here is our inline logo

", }; message.Attachments = new List(); message.Attachments.Add( new EmailAttachment() { Filename = "logo.png", Path = "https://resend.com/static/sample/logo.png", ContentId = "logo-image", } ); var resp = await resend.EmailSendAsync( message ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {8,13} theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Thank you for contacting us", "html": "

Here is our inline logo

", "attachments": [ { "path": "https://resend.com/static/sample/logo.png", "filename": "logo.png", "content_id": "logo-image" } ] }' ```
Learn more about [embedding images](/dashboard/emails/embed-inline-images). ## View and Download Attachments You can view and download attachments when viewing a sent email that includes them. To view and download attachments: 1. Go to [Emails](https://resend.com/emails). 2. Navigate to any email you sent with an attachment. 3. Click on the attachment to download it locally. Attachments include the filename and an icon to help you identify the type of attachment. We show unique icons for each attachment type: * Image * PDF * Spreadsheet * Default (for unknown types) ## Attachment Limitations * Emails can be no larger than 40MB (including attachments after Base64 encoding). * Not all file types are supported. See the list of [unsupported file types](/knowledge-base/what-attachment-types-are-not-supported). * Emails with attachments cannot be sent using our [batching endpoint](/api-reference/emails/send-batch-emails). ## Examples See the full source code. See the full source code. --- # Source: https://resend.com/docs/knowledge-base/audience-hygiene.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Audience Hygiene: How to keep your Audiences in good shape? > Learn strategies for maintaining good audience hygiene and maximizing email deliverability. Audience hygiene (*also known as list hygiene*) refers to the practice of keeping your email list clean, valid, and engaged. Maintaining proper audience hygiene is crucial for ensuring that your emails reach their intended recipients, maximizing your deliverability, and improving your sender reputation. By removing invalid, outdated, or disengaged contacts, you can improve the effectiveness of your email campaigns and avoid issues like high bounce rates, low engagement, and even being marked as spam. *** # How to ensure emails are valid? To keep your list healthy, it's essential to ensure that the email addresses you collect are valid, accurate, and belong to recipients who are truly interested in hearing from you. Here are a few strategies to help you achieve this: ### Prevent undesired or bot signups with CAPTCHA Bots can easily sign up for your emails, inflating your list with fake or low-quality contacts. To prevent this, implement CAPTCHA systems during your sign-up process. CAPTCHA challenges help ensure that sign-ups are coming from human users and not automated scripts. Some popular CAPTCHA services include: * **[Google reCAPTCHA](https://developers.google.com/recaptcha)**: One of the most widely used CAPTCHA services, offering both simple and advanced protection options. * **[hCaptcha](https://www.hcaptcha.com/)**: An alternative to Google reCAPTCHA, providing similar protection but with a different user experience. * **[Friendly Captcha](https://friendlycaptcha.com/)**: A privacy-focused CAPTCHA solution that doesn’t require users to click on anything, reducing friction in the sign-up process. Using these tools will help reduce bot sign-ups and ensure your email list consists of real users. ### Ensure the recipient is consenting with Double Opt-In Double opt-in is the process of confirming a user's subscription after they’ve signed up for your emails. When a user submits their email address, you send them a confirmation email with a link they must click to complete the subscription process. This step ensures that the person who entered the email address is the one who actually wants to receive your communications. This is important to ensure: * **Compliance with local regulations**: Double opt-in helps ensure that you comply with email marketing regulations such as the **CAN-SPAM Act** (U.S.) and **CASL** (Canada). Both of these laws require clear consent from subscribers before you can send them marketing emails. * **Improved deliverability**: Double opt-in helps you maintain a clean list of genuinely interested users. This reduces bounce rates and prevents spam complaints, which in turn helps maintain your sender reputation with ISPs and inbox providers. * **Verification of accuracy**: Double opt-in ensures the email addresses you collect are valid, accurate, and up to date, reducing the risk of sending to invalid addresses and impacting your deliverability. ### Use a third-party service to verify an address' deliverability While you can verify that an email address follows the correct syntax (e.g., [user@example.com](mailto:user@example.com)) (also known as RFC 5322), you also need to ensure that the address is deliverable—that is, it’s an active inbox that can receive emails. Third-party email verification services can help you identify whether an email address is valid, reachable, or likely to result in a bounce. This reduces the risk of sending to addresses that won’t receive your emails and improves your overall deliverability. Some email verification services include: * **[Emailable](https://emailable.com/partners/resend)** * **ZeroBounce** * **Kickbox** By using these services, you can clean up your existing email lists or prevent undeliverable emails to be added to them. This helps prevent unnecessary deliverability issues. *** # How to proactively remove emails from your Segments Over time, certain recipients may become disengaged with your content. It's important to manage your segments by removing inactive or unengaged users. Regularly filtering your segments ensures that you're sending to only those who are actively interested, which in turn boosts engagement and deliverability. A healthy email list is one that is continuously nurtured with relevant and timely content. Instead of sporadic communication, maintain consistent engagement with your audience to keep them interested. ### Filter on engagement To keep your email list in top shape, focus on sending to engaged users. Major inbox providers like Gmail and Microsoft expect you to send emails to recipients who have recently opened or clicked on your emails. As a best practice, you should limit non-transactional email sends to recipients who have opened or clicked an email in the past 6 months. The exact timeframe may vary depending on your industry, sending frequency, and audience behavior, but 6 months is a generally accepted standard. Regularly cleaning your list of disengaged recipients helps maintain a positive sender reputation and boosts your chances of landing in the inbox instead of the spam folder. ### Automatically remove bounced recipients Using our [Webhooks](/webhooks/introduction), you can be notified when a delivery bounces or gets marked as spam by the recipient. This is an opportunity to proactively unsubscribe the recipient and prevent further sending. Indeed, while Resend will automatically suppress further deliveries to that email address, we don't automatically unsubscribe it. ### Sunset unengaged recipients If certain recipients have not engaged with your emails over an extended period (e.g., 6+ months), consider removing them from your Marketing sends. Continuing to send to these unengaged users can harm your deliverability by increasing bounce rates and decreasing your open rates. To re-engage these users, you may want to send a re-engagement campaign or offer an incentive for them to stay on your list. If they don't respond, it's often best to remove them to keep your list healthy and avoid wasting resources on inactive contacts. *** By maintaining strong audience hygiene practices—including validating email addresses, ensuring consent, verifying deliverability, and removing unengaged recipients—you'll improve your email deliverability and foster better relationships with your subscribers. This will help you achieve better engagement rates and a healthier sender reputation with inbox providers. --- # Source: https://resend.com/docs/knowledge-base/base44-integration.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Send emails with Base44 and Resend > Learn how to add the Resend integration to your Base44 project. [Base44](https://base44.com/) is a platform for building apps with AI. You can add Resend in a Base44 project by asking the chat to add email sending with Resend. This integration requires backend functions, a feature available only on Builder tier and above. Learn more about [Base44 pricing](https://base44.com/pricing). ## 1. Add the Resend integration in Base44 **If starting a new app:** 1. Click **Integration** in the top nav. 2. Search for **Resend**, select it, and choose **Use This Integration**. Resend Integration page **If adding Resend to an existing app:** 1. Enable backend functions. 2. Ask the chat: "Add the Resend email integration to my app. Prompt me to provide the API key and send a welcome email to new users." See the [Base44 documenation](https://docs.base44.com/Integrations/Resend-integration) for more information. ## 2. Add your Resend API key However you add Resend to your project, you'll need to add a Resend API key, which you can create in the [Resend Dashboard](https://resend.com/api-keys). Do not share your API key with others or expose it in the browser or other client-side code. Copy the API key and paste it into the **RESEND\_API\_KEY** field in Base44. Adding your Resend API key to Base44 ## 3. Add a custom domain to your Resend account By default, you can only send emails to your own email address. To send emails to other email addresses: 1. Add a [custom domain to your Resend account](https://resend.com/domains). 2. Add the custom domain to the `from` field in the `resend` function in the Base44 backend function (or ask the chat to update these fields). Get more help adding a custom domain in [Resend's documentation](/dashboard/domains/introduction). --- # Source: https://resend.com/docs/dashboard/emails/batch-sending.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Batch Sending > Send up to 100 emails in a single API call. Batch sending allows you to send multiple emails at once (up to 100) instead of making individual API requests for each email. ## When to use batch sending Use batch sending when you need to: * Send multiple transactional emails (e.g., order confirmations, notifications, etc.) * Trigger emails to different recipients with unique content * Reduce the number of API calls to improve performance For marketing campaigns, [use our no-code editor, Broadcasts](/dashboard/broadcasts/introduction), instead. ## Send batch emails You can send up to 100 emails in a single API call using the batch endpoint. Each email in the batch can have different recipients, subjects, and content. ```ts Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); const { data, error } = await resend.batch.send([ { from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Welcome to Acme', html: '

Thanks for signing up!

', }, { from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Order Confirmation', html: '

Your order has been confirmed.

', }, ]); console.log(data); ``` ```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); $resend->batch->send([ [ 'from' => 'Acme ', 'to' => ['delivered@resend.dev'], 'subject' => 'Welcome to Acme', 'html' => '

Thanks for signing up!

', ], [ 'from' => 'Acme ', 'to' => ['delivered@resend.dev'], 'subject' => 'Order Confirmation', 'html' => '

Your order has been confirmed.

', ] ]); ``` ```py Python theme={"theme":{"light":"github-light","dark":"vesper"}} import resend from typing import List resend.api_key = "re_xxxxxxxxx" params: List[resend.Emails.SendParams] = [ { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Welcome to Acme", "html": "

Thanks for signing up!

", }, { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Order Confirmation", "html": "

Your order has been confirmed.

", } ] resend.Batch.send(params) ``` ```rb Ruby theme={"theme":{"light":"github-light","dark":"vesper"}} require "resend" Resend.api_key = 're_xxxxxxxxx' params = [ { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Welcome to Acme", "html": "

Thanks for signing up!

", }, { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Order Confirmation", "html": "

Your order has been confirmed.

", } ] Resend::Batch.send(params) ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} package main import ( "context" "fmt" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") var batchEmails = []*resend.SendEmailRequest{ { From: "Acme ", To: []string{"delivered@resend.dev"}, Subject: "Welcome to Acme", Html: "

Thanks for signing up!

", }, { From: "Acme ", To: []string{"delivered@resend.dev"}, Subject: "Order Confirmation", Html: "

Your order has been confirmed.

", }, } sent, err := client.Batch.SendWithContext(ctx, batchEmails) if err != nil { panic(err) } fmt.Println(sent.Data) } ``` ```rust Rust theme={"theme":{"light":"github-light","dark":"vesper"}} use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let emails = vec![ CreateEmailBaseOptions::new( "Acme ", vec!["delivered@resend.dev"], "Welcome to Acme", ) .with_html("

Thanks for signing up!

"), CreateEmailBaseOptions::new( "Acme ", vec!["delivered@resend.dev"], "Order Confirmation", ) .with_html("

Your order has been confirmed.

"), ]; let _emails = resend.batch.send(emails).await?; Ok(()) } ``` ```java Java theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; import java.util.Arrays; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions firstEmail = CreateEmailOptions.builder() .from("Acme ") .to("delivered@resend.dev") .subject("Welcome to Acme") .html("

Thanks for signing up!

") .build(); CreateEmailOptions secondEmail = CreateEmailOptions.builder() .from("Acme ") .to("delivered@resend.dev") .subject("Order Confirmation") .html("

Your order has been confirmed.

") .build(); CreateBatchEmailsResponse data = resend.batch().send( Arrays.asList(firstEmail, secondEmail) ); } } ``` ```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; IResend resend = ResendClient.Create("re_xxxxxxxxx"); var mail1 = new EmailMessage() { From = "Acme ", To = "delivered@resend.dev", Subject = "Welcome to Acme", HtmlBody = "

Thanks for signing up!

", }; var mail2 = new EmailMessage() { From = "Acme ", To = "delivered@resend.dev", Subject = "Order Confirmation", HtmlBody = "

Your order has been confirmed.

", }; var resp = await resend.EmailBatchAsync([mail1, mail2]); Console.WriteLine("Nr Emails={0}", resp.Content.Data.Count); ``` ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST 'https://api.resend.com/emails/batch' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'[ { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Welcome to Acme", "html": "

Thanks for signing up!

" }, { "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Order Confirmation", "html": "

Your order has been confirmed.

" } ]' ```
## Response format The batch endpoint returns an array of email IDs for successfully created emails. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "data": [ { "id": "ae2014de-c168-4c61-8267-70d2662a1ce1" }, { "id": "faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb" } ] } ``` If the request fails, the response will include an `error` object with a `message` property. You can find more information about the error in the [Errors](/api-reference/errors) section of the API Reference. ## Limitations When using batch sending, keep in mind: * Maximum of **100 emails** per batch request * The `attachments` field is not supported yet * The `scheduled_at` field is not supported yet * Each email in the batch is processed independently * The request will fail and return an error if any email in your payload is invalid (e.g., required fields are missing, fields contain invalid data, etc.). ## View batch emails All emails sent via the batch endpoint appear in the [Emails](https://resend.com/emails) page of your dashboard, just like individually sent emails. Each email will have a `queued` status initially before being processed. ## API Reference For complete API documentation, see the [Send Batch Emails API reference](/api-reference/emails/send-batch-emails). --- # Source: https://resend.com/docs/dashboard/emails/batch-validation-modes.md # Batch Validation Modes > Control how batch validation is performed. The batch validation header controls how emails are validated in batch sending. `x-batch-validation` Choose between `strict` and `permissive` mode. ## Strict mode (default) Strict mode sends the batch only if all emails in the batch request are valid. * **Atomic behavior**: if any email in the batch fails validation, the entire batch is rejected * **Error details**: only the validation error causing the failure is returned If the header is omitted, strict mode applies. ## Permissive mode Permissive mode processes all emails, allowing for partial success and returns the following two arrays: * **data**: array of objects for all created emails, each containing an email `id`. * **errors**: array of objects for emails which could not be created due to validation errors. Each object contains the following properties: * `index`: index of the email in the batch request * `message`: error message identifying the validation error ## How to use batch validation modes ```ts Node.js {21} theme={null} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); const { data, errors } = await resend.batch.send( [ { from: 'Acme ', to: ['foo@gmail.com'], subject: 'hello world', html: '

it works!

', }, { from: 'Acme ', to: ['bar@outlook.com'], subject: 'world hello', html: '

it works!

', }, ], { batchValidation: 'permissive', }, ); ``` ```php PHP {19} theme={null} $resend = Resend::client('re_xxxxxxxxx'); $resend->batch->send( [ [ 'from' => 'Acme ', 'to' => ['foo@gmail.com'], 'subject' => 'hello world', 'html' => '

it works!

', ], [ 'from' => 'Acme ', 'to' => ['bar@outlook.com'], 'subject' => 'world hello', 'html' => '

it works!

', ] ], [ 'batch_validation' => 'permissive', ] ); ``` ```py Python {22} theme={null} import resend from typing import List resend.api_key = "re_xxxxxxxxx" params: List[resend.Emails.SendParams] = [ { "from": "Acme ", "to": ["foo@gmail.com"], "subject": "hello world", "html": "

it works!

", }, { "from": "Acme ", "to": ["bar@outlook.com"], "subject": "world hello", "html": "

it works!

", } ] options: resend.Batch.SendOptions = { "batch_validation": "permissive", } resend.Batch.send(params, options) ``` ```rb Ruby {22} theme={null} require "resend" Resend.api_key = 're_xxxxxxxxx' params = [ { "from": "Acme ", "to": ["foo@gmail.com"], "subject": "hello world", "html": "

it works!

", }, { "from": "Acme ", "to": ["bar@outlook.com"], "subject": "world hello", "html": "

it works!

", } ] Resend::Batch.send( params, options: { batch_validation: "permissive" } ) ``` ```go Go {32} theme={null} package examples import ( "fmt" "os" "github.com/resend/resend-go/v3" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") var batchEmails = []*resend.SendEmailRequest{ { From: "Acme ", To: []string{"foo@gmail.com"}, Subject: "hello world", Html: "

it works!

", }, { From: "Acme ", To: []string{"bar@outlook.com"}, Subject: "world hello", Html: "

it works!

", }, } options := &resend.BatchSendEmailOptions{ BatchValidation: "permissive", } sent, err := client.Batch.SendWithOptions(ctx, batchEmails, options) if err != nil { panic(err) } fmt.Println(sent.Data) } ``` ```rust Rust {25} theme={null} use resend_rs::types::{BatchValidation, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let emails = vec![ CreateEmailBaseOptions::new( "Acme ", vec!["foo@gmail.com"], "hello world", ) .with_html("

it works!

"), CreateEmailBaseOptions::new( "Acme ", vec!["bar@outlook.com"], "world hello", ) .with_html("

it works!

"), ]; let _emails = resend .batch .send_with_batch_validation(emails, BatchValidation::Permissive) .await?; Ok(()) } ``` ```java Java {23} theme={null} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions firstEmail = CreateEmailOptions.builder() .from("Acme ") .to("foo@gmail.com") .subject("hello world") .html("

it works!

") .build(); CreateEmailOptions secondEmail = CreateEmailOptions.builder() .from("Acme ") .to("bar@outlook.com") .subject("world hello") .html("

it works!

") .build(); RequestOptions options = RequestOptions.builder() .add("x-batch-validation", "permissive") .build(); CreateBatchEmailsResponse data = resend.batch() .send( Arrays.asList(firstEmail, secondEmail), options ); } } ``` ```csharp .NET {5} theme={null} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var mail1 = new EmailMessage() { From = "Acme ", To = "foo@gmail.com", Subject = "hello world", HtmlBody = "

it works!

", }; var mail2 = new EmailMessage() { From = "Acme ", To = "bar@outlook.com", Subject = "hello world", HtmlBody = "

it works!

", }; var resp = await resend.EmailBatchAsync( [ mail1, mail2 ], EmailBatchValidationMode.Permissive ); Console.WriteLine( "Nr Emails={0}", resp.Content.Data.Count ); if ( resp.Content.Errors?.Count > 0 ) { foreach ( var error in resp.Content.Errors ) { Console.WriteLine( "Error at index {0}: {1}", error.Index, error.Message ); } } ``` ```bash cURL {4} theme={null} curl -X POST 'https://api.resend.com/emails/batch' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -H 'x-batch-validation: permissive' \ -d $'[ { "from": "Acme ", "to": ["foo@gmail.com"], "subject": "hello world", "html": "

it works!

" }, { "from": "Acme ", "to": ["bar@outlook.com"], "subject": "world hello", "html": "

it works!

" } ]' ```
## Example response ```json Response theme={null} { "data": [ { "id": "ae2014de-c168-4c61-8267-70d2662a1ce1" }, { "id": "faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb" } ], // the `errors` array is only present in permissive batch validation mode "errors": [ { "index": 2, // 0-indexed (first item is index 0) "message": "The `to` field is missing." } ] } ``` ## Which errors are returned? Only `permissive` mode returns an errors array, since the entire batch is rejected if any email fails validation in `strict` mode. When an email in your payload causes an error, that email cannot be created, so an error object is returned. Reasons your email may cause an error include: * Required fields are missing. * Fields contain invalid data. * The batch contains more than 100 emails. Importantly, this means the following: * The email will not appear in the dashboard, since it could not be created. * The error object will be included in the `errors` array. * The only way to understand why the email failed is to inspect the returned error object. --- # Source: https://resend.com/docs/dashboard/settings/billing.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Managing Billing > Manage your account subscription and billing information The [Billing](https://resend.com/settings/billing) page in the Settings section provides a clear view of your subscription details, billing email, payment method, and account invoices. From here, you can: * View and manage your subscription - Upgrade, downgrade, or modify your current plan. * Manage billing contacts - Ensure the right people receive billing-related notifications. * Update payment information - Add or change your credit card or billing details. * Access invoices - Download past invoices for your records. For any other billing inquiries, please [contact support](https://resend.com/help). ## How to cancel your subscription 1. Go to the [Billing](https://resend.com/settings/billing) page. 2. Click on the three dots next to your plan. 3. Select **Cancel Subscription** from the dropdown menu. Cancel subscription --- # Source: https://resend.com/docs/dashboard/domains/bimi.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Implementing BIMI > Set up BIMI to gain brand recognition by displaying your logo in the inbox. ## Prerequisites To get the most out of this guide, you will need to: * Establish verifiable use of your logo * Obtain a registered trademark for your logo * Or, use your logo for over one year * [Add a DMARC record on your domain](/dashboard/domains/dmarc) ## What is BIMI? BIMI ([Brand Indicators for Message Identification](https://bimigroup.org/)) is a standard that allows you to specify a logo (and sometimes a checkmark) to display next to your email in the inbox. These indicators can increase brand recognition and trust and improve engagement. bimi-example Though this standard is newer, most major mailbox providers now support it. This gives BIMI adoption a competitive edge for brand recognition in the inbox. Most mailbox providers show brand indicators for those who purchase a certificate, of which there are two types: a Common Mark Certificate (CMC) and a Verified Mark Certificate (VMC). Here's an overview of current email client support: | Client | BIMI w/a CMC | BIMI w/a VMC | BIMI w/out a VMC or CMC | | ----------------------------------------------------- | ------------ | ------------ | ----------------------- | | [Apple Mail](https://support.apple.com/en-us/108340) | X | ✓ | X | | [Gmail](https://support.google.com/a/answer/10911320) | ✓ | ✓ | X | | Outlook | X | X | X | | [Yahoo](https://senders.yahooinc.com/bimi/) | ✓ | ✓ | ✓ | ## Implementing BIMI ### 1. Configure DMARC If you haven't set up DMARC yet, follow our [DMARC Setup Guide](/dashboard/domains/dmarc). BIMI requires a DMARC policy of `p=quarantine;` or `p=reject;`. This policy assures that your emails are properly authenticated and that no one else can spoof your domain and send them with your logo. Here's an overview of the required parameters: | Parameter | Purpose | Required Value | | --------- | ---------- | ------------------------------ | | `p` | Policy | `p=quarantine;` or `p=reject;` | | `pct` | Percentage | `pct=100;` | Here is an example of an adequate DMARC record: ``` "v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarcreports@example.com" ``` For BIMI on a subdomain, the root or APEX domain must also have a DMARC policy of `p=quarantine` or `p=reject` in addition to the subdomain. If not, the subdomain will not be compliant to display a BIMI logo. ### 2. Establish verifiable use of your logo To display your logo in most email clients using BIMI, you need to prove ownership of your logo by obtaining a mark certificate. This process is similar to acquiring an SSL certificate for your website. You can purchase a mark certificate from one of the following [authorized mark verifying authorities](https://bimigroup.org/vmc-issuers/): * [DigiCert](https://www.digicert.com/tls-ssl/verified-mark-certificates) * [GlobalSign](https://www.globalsign.com/) * [SSL.com](https://www.ssl.com/) There are two possible mark Certificate's to verify the use of your logo: * **Verified Mark Certificate (VMC)**: A certificate issued by a Certificate Authority (CA) that is used to verify that you are the owner of the logo you are trying to display. A VMC is available if you have a trademark of your logo. With a VMC, Gmail will display a blue checkmark. * **Common Mark Certificate (CMC)**: A certificate also issued by Certificate Authority (CA) to verify you. A CMC is available to you if you can establish that you’ve used your logo for one year. Currently, only Gmail supports a CMC. A VMC offers the widest email client support, though the barrier of a trademark means a CMC is an easier path if you have established use of your logo for one year. Here are a some things to know before starting the certificate purchase process: * If you don't hold a trademark for your logo or have not used your logo for a year, you will not be able to purchase a certificate. * The process could take weeks, so start early and respond to their requests quickly. * You will need to provide a [SVG Tiny P/S formatted logo](https://bimigroup.org/creating-bimi-svg-logo-files/). * You will need to prove you own the domain by adding a DNS record. * You will need to prove you are the owner of the trademark or logo by providing identification. * You will need publicly available proof that your business exists. For newer startups, recommend [Yellow Pages](https://marketing.yellowpages.com/en/) or [Google Business Profiles](https://support.google.com/business/answer/3039617?hl=en) as the easiest method for proving your existence ## 3. Set your BIMI DNS Record Once you have your VMC, you can set your BIMI DNS record. This TXT record points to the location of your VMC and your logo. | Name | Type | Value | | -------------- | ---- | --------------------------------------------------- | | default.\_bimi | TXT | v=BIMI1; l=link\_to\_logo; a=link\_to\_certificate; | Here is an example of a BIMI record: ``` v=BIMI1; l=https://vmc.digicert.com/00-00.svg; a=https://vmc.digicert.com/00-00.pem; ``` Ensure your logo uses an HTTPS URL. Mailbox providers will not display the logo if served from an HTTP URL. It contains a publicly and programmatically accessible link to your verified logo (.svg) and a link to your VMC (.pem). To confirm that your BIMI record is published correctly, the [BIMI working group offers a tool](https://bimigroup.org/bimi-generator/) to check it. It often takes a few days for your logo to display in inboxes after this record propagates. Mailbox providers will also conditionally decide to show the logo based on the domain's sending email volume and reputation. A domain with a high spam or bounce rate may not have their avatar displayed. ## Reference | Parameter | Purpose | Example | | --------- | ------------------- | -------------------------------------- | | `v` | The version of BIMI | `v=BIMI1` | | `l` | Logo | `l=https://vmc.digicert.com/00-00.svg` | | `a` | Certificate | `a=https://vmc.digicert.com/00-00.pem` | | `s` | Selector | `s=springlogo` | The BIMI standard allows for multiple logos using the [selector parameter](https://bimigroup.org/how-and-why-to-implement-bimi-selectors/). Having issues setting up BIMI? [We can help](https://resend.com/help). --- # Source: https://resend.com/docs/dashboard/webhooks/body-parameters.md # Body Parameters > Complete reference for webhook body parameters, their types and meanings. All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object. | Parameter | Type | Description | | ------------ | -------- | -------------------------------------------------------------------------------- | | `type` | `string` | The event type that triggered the webhook (e.g., `email.sent`, `domain.created`) | | `created_at` | `string` | ISO 8601 timestamp when the webhook event was created | | `data` | `object` | Event-specific data containing detailed information about the event | ## Email Event Payloads Email events (`email.sent`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained`, `email.failed`, `email.delivery_delayed`) share common parameters in the `data` object. ### Common Email Parameters | Parameter | Type | Description | | -------------- | -------- | ------------------------------------------------------------------------------------------------- | | `broadcast_id` | `string` | Unique identifier for the broadcast campaign (if applicable) | | `created_at` | `string` | ISO 8601 timestamp when the email was created | | `email_id` | `string` | Unique identifier for the specific email | | `from` | `string` | Sender email address and name in the format "Name \<[email@domain.com](mailto:email@domain.com)>" | | `to` | `array` | Array of impacted recipient email addresses | | `subject` | `string` | Email subject line | | `tags` | `array` | Array of tag objects associated with the email | ### Tag Object Structure | Parameter | Type | Description | | --------- | -------- | ------------- | | `name` | `string` | The tag key | | `value` | `string` | The tag value | ### Event-Specific Parameters #### Email Bounced (`email.bounced`) Additional `bounce` object in the `data` payload: | Parameter | Type | Description | | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `bounce.diagnosticCode` | `array` | Array of SMTP diagnostic responses from the receiving server, including the status code and reason for the bounce (e.g., `smtp; 550 5.5.0 Requested action not taken: mailbox unavailable`) | | `bounce.message` | `string` | Detailed bounce message from the receiving server | | `bounce.subType` | `string` | Bounce sub-type (e.g., `Suppressed`, `MessageRejected`) | | `bounce.type` | `string` | Bounce type (e.g., `Permanent`, `Temporary`) | #### Email Clicked (`email.clicked`) Additional `click` object in the `data` payload: | Parameter | Type | Description | | ----------------- | -------- | ------------------------------------------------------ | | `click.ipAddress` | `string` | IP address of the user who clicked the link | | `click.link` | `string` | The URL that was clicked | | `click.timestamp` | `string` | ISO 8601 timestamp when the click occurred | | `click.userAgent` | `string` | User agent string of the browser that clicked the link | #### Email Failed (`email.failed`) Additional `failed` object in the `data` payload: | Parameter | Type | Description | | --------------- | -------- | ---------------------------------------------------------- | | `failed.reason` | `string` | Reason for the email failure (e.g., `reached_daily_quota`) | ## Domain Event Payloads Domain events (`domain.created`, `domain.updated`, `domain.deleted`) contain domain configuration and DNS record information. ### Domain Parameters | Parameter | Type | Description | | ------------ | -------- | --------------------------------------------------------------------------- | | `id` | `string` | Unique identifier for the domain | | `name` | `string` | Domain name (e.g., `example.com`) | | `status` | `string` | Current verification status of the domain (e.g., `not_started`, `verified`) | | `created_at` | `string` | ISO 8601 timestamp when the domain was created | | `region` | `string` | AWS region where the domain is configured (e.g., `us-east-1`) | | `records` | `array` | Array of DNS record objects required for domain verification | ### DNS Record Object Structure | Parameter | Type | Description | | ---------- | -------- | ------------------------------------------- | | `record` | `string` | Record type purpose (e.g., `SPF`, `DKIM`) | | `name` | `string` | DNS record name/subdomain | | `type` | `string` | DNS record type (e.g., `MX`, `TXT`) | | `value` | `string` | DNS record value to be set | | `ttl` | `string` | Time to live for the DNS record | | `status` | `string` | Verification status of this specific record | | `priority` | `number` | Priority value for MX records (optional) | ## Contact Event Payloads Contact events (`contact.created`, `contact.updated`, `contact.deleted`) contain information about audience contacts. ### Contact Parameters | Parameter | Type | Description | | -------------- | --------- | ---------------------------------------------------------- | | `id` | `string` | Unique identifier for the contact | | `audience_id` | `string` | Unique identifier for the audience this contact belongs to | | `created_at` | `string` | ISO 8601 timestamp when the contact was created | | `updated_at` | `string` | ISO 8601 timestamp when the contact was last updated | | `email` | `string` | Contact's email address | | `first_name` | `string` | Contact's first name | | `last_name` | `string` | Contact's last name | | `unsubscribed` | `boolean` | Whether the contact has unsubscribed from the audience | ## Best Practices * Always validate the `type` field to determine how to process the payload * Store `email_id` for tracking and correlation with your application data * Use `created_at` timestamps for proper event ordering and deduplication * Handle missing optional fields gracefully (not all events include all parameters) * Check the `status` field in domain events to track verification progress * Monitor bounce types and reasons to improve deliverability Looking for request body examples? Check out the [Event Types](/dashboard/webhooks/event-types) page. --- > To find navigation and other pages in this documentation, fetch the llms.txt file at: https://resend.com/docs/llms.txt --- # Source: https://resend.com/docs/knowledge-base/bolt-new-integration.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Send emails with Bolt.new and Resend > Learn how to add the Resend integration to your Bolt.new project. [Bolt.new](https://bolt.new) is a platform for building full-stack web and mobile apps via chat. You can add Resend in a Bolt.new project by asking the chat to add email sending with Resend. adding the Resend integration to a Bolt.new chat ## 1. Add your Resend API key To use Resend with Bolt.new, you'll need to add a Resend API key, which you can create in the [Resend Dashboard](https://resend.com/api-keys). Do not share your API key with others or expose it in the browser or other client-side code. To safely store your Resend API key, use a `.env` file. You may need to include this instruction in your prompt to bolt.new. Learn more about [handling API keys](/knowledge-base/how-to-handle-api-keys). ## 2. Add a custom domain to your Resend account By default, you can only send emails to your own email address. To send emails to other email addresses: 1. Add a [custom domain to your Resend account](https://resend.com/domains). 2. Add the custom domain to the `from` field in the `resend` function in Bolt.new (or ask the chat to update these fields). Get more help adding a custom domain in [Resend's documentation](/dashboard/domains/introduction). --- # Source: https://resend.com/docs/webhooks/emails/bounced.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # email.bounced > Received when an email bounces. export const ResponseBodyParameters = ({type, children}) => { return

Response Body Parameters

All webhook payloads follow a consistent top-level structure with event-specific data nested within the data object.

The event type that triggered the webhook (e.g., {type}). ISO 8601 timestamp when the webhook event was created. Event-specific data containing detailed information about the event. The data object for the {type} event contains the following parameters: {children}
; }; Event triggered whenever the recipient's mail server **permanently rejected the email**. Unique identifier for the broadcast campaign (if applicable) ISO 8601 timestamp when the email was created Unique identifier for the specific email Sender email address and name in the format "Name \<[email@domain.com](mailto:email@domain.com)>" Array of impacted recipient email addresses Email subject line Unique identifier for the template used (if applicable) Array of tag objects associated with the email The tag key The tag value Bounce details from the receiving server Array of SMTP diagnostic responses from the receiving server, including the status code and reason for the bounce (e.g., `smtp; 550 5.5.0 Requested action not taken: mailbox unavailable`) Detailed bounce message from the receiving server Bounce sub-type (e.g., `Suppressed`, `MessageRejected`) Bounce type (e.g., `Permanent`, `Temporary`) Learn more about [bounce types and subtypes](/dashboard/emails/email-bounces). ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "type": "email.bounced", "created_at": "2024-11-22T23:41:12.126Z", "data": { "broadcast_id": "8b146471-e88e-4322-86af-016cd36fd216", "created_at": "2024-11-22T23:41:11.894719+00:00", "email_id": "56761188-7520-42d8-8898-ff6fc54ce618", "from": "Acme ", "to": ["delivered@resend.dev"], "subject": "Sending this example", "template_id": "43f68331-0622-4e15-8202-246a0388854b", "bounce": { "message": "The recipient's email address is on the suppression list because it has a recent history of producing hard bounces.", "subType": "Suppressed", "type": "Permanent" }, "tags": { "category": "confirm_email" } } } ``` --- # Source: https://resend.com/docs/api-reference/emails/cancel-email.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Cancel Email > Cancel a scheduled email. ## Path Parameters The Email ID. ```ts Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} import { Resend } from 'resend'; const resend = new Resend('re_xxxxxxxxx'); const { data, error } = await resend.emails.cancel( '49a3999c-0ce1-4ea6-ab68-afcd6dc2e794', ); ``` ```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->cancel('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794'); ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import resend resend.api_key = "re_xxxxxxxxx" resend.Emails.cancel(email_id="49a3999c-0ce1-4ea6-ab68-afcd6dc2e794") ``` ```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}} require "resend" Resend.api_key = "re_xxxxxxxxx" Resend::Emails.cancel("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794") ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} package main import ( "fmt" "github.com/resend/resend-go/v3" ) func main() { client := resend.NewClient("re_xxxxxxxxx") canceled, err := client.Emails.Cancel("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794") if err != nil { panic(err) } fmt.Println(canceled.Id) } ``` ```rust Rust theme={"theme":{"light":"github-light","dark":"vesper"}} use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let _canceled = resend .emails .cancel("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794") .await?; Ok(()) } ``` ```java Java theme={"theme":{"light":"github-light","dark":"vesper"}} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CancelEmailResponse canceled = resend .emails() .cancel("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"); } } ``` ```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI await resend.EmailCancelAsync( new Guid( "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" ) ); ``` ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST 'https://api.resend.com/emails/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794/cancel' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' ``` ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}} { "object": "email", "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" } ``` --- # Source: https://resend.com/docs/webhooks/emails/clicked.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # email.clicked > Received when an email link is clicked. export const ResponseBodyParameters = ({type, children}) => { return

Response Body Parameters

All webhook payloads follow a consistent top-level structure with event-specific data nested within the data object.

The event type that triggered the webhook (e.g., {type}). ISO 8601 timestamp when the webhook event was created. Event-specific data containing detailed information about the event. The data object for the {type} event contains the following parameters: {children}
; }; Event triggered whenever the **recipient clicks on an email link**. Unique identifier for the broadcast campaign (if applicable) ISO 8601 timestamp when the email was created Unique identifier for the specific email Sender email address and name in the format "Name \<[email@domain.com](mailto:email@domain.com)>" Array of impacted recipient email addresses Email subject line Unique identifier for the template used (if applicable) Array of tag objects associated with the email The tag key The tag value Click tracking details IP address of the user who clicked the link The URL that was clicked ISO 8601 timestamp when the click occurred User agent string of the browser that clicked the link ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "type": "email.clicked", "created_at": "2024-11-22T23:41:12.126Z", "data": { "broadcast_id": "8b146471-e88e-4322-86af-016cd36fd216", "created_at": "2024-11-22T23:41:11.894719+00:00", "email_id": "56761188-7520-42d8-8898-ff6fc54ce618", "from": "Acme ", "to": ["delivered@resend.dev"], "click": { "ipAddress": "122.115.53.11", "link": "https://resend.com", "timestamp": "2024-11-24T05:00:57.163Z", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" }, "subject": "Sending this example", "template_id": "43f68331-0622-4e15-8202-246a0388854b", "tags": { "category": "confirm_email" } } } ``` --- # Source: https://resend.com/docs/knowledge-base/cloudflare.md > ## Documentation Index > Fetch the complete documentation index at: https://resend.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Cloudflare > Verify your domain on Cloudflare with Resend. ## Add Domain to Resend First, log in to your [Resend Account](https://resend.com/login) and [add a domain](https://resend.com/domains). Domain Details It is [best practice to use a subdomain](/knowledge-base/is-it-better-to-send-emails-from-a-subdomain-or-the-root-domain) (updates.example.com) instead of the root domain (example.com). Using a subdomain allows for proper reputation segmentation based on topics or purpose (e.g. marketing) and is especially important if receiving emails with Resend. ## Automatic Setup (Recommended) The fastest way to verify your domain on Cloudflare is using the **Sign in to Cloudflare** button on Resend. This uses Domain Connect to automatically configure your DNS records. 1. Go to your [Domains page](https://resend.com/domains) in Resend. 2. (Optional) If you want to receive emails, select `Manual setup` and toggle the "Receiving" switch on the domain details page. ([Learn more below](#receiving-emails)) 3. Click **Sign in to Cloudflare** button. 4. Authorize Resend to access your Cloudflare DNS settings. 5. The DNS records will be added automatically.