> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resend

> Send emails, manage contacts, and configure domains.

The Resend connector lets your workflows send transactional and marketing emails, manage audience contacts, and verify sending domains.

<Note>
  For the full API reference, see the [Resend API documentation](https://resend.com/docs/api-reference).
</Note>

<Tip>
  If you just need to send a quick notification email without setting up an external service, use the built-in [Send Email node](/workflow-editor/nodes/send-email) instead, as it sends from Spojit with no connection required.
</Tip>

<Snippet file="connection-note.mdx" />

## Connection setup

<Steps>
  <Step title="Get your API key">
    Log in to the [Resend dashboard](https://resend.com) and navigate to **API Keys**. Create a new API key or copy an existing one.
  </Step>

  <Step title="Add the connection in Spojit">
    Go to **Connections** in Spojit, click **Add Connection**, select **Resend**, and enter:

    * **API Key**: Your Resend API key (starts with `re_`)
    * **Default From Address** (optional): A default sender address (e.g., `Team <hello@yourdomain.com>`) used when `from` is not specified in the tool parameters
  </Step>
</Steps>

<Tip>
  Make sure you've verified a sending domain in Resend before sending emails. Emails from unverified domains will fail.
</Tip>

## Tools

### Emails

<AccordionGroup>
  <Accordion title="send-email: Send an email">
    <ParamField body="from" type="string">
      Sender address. Falls back to the connection's default from address.
    </ParamField>

    <ParamField body="to" type="string | string[]" required>
      Recipient email address(es).
    </ParamField>

    <ParamField body="subject" type="string" required>
      Email subject line.
    </ParamField>

    <ParamField body="html" type="string">
      HTML email body.
    </ParamField>

    <ParamField body="text" type="string">
      Plain text email body.
    </ParamField>

    <ParamField body="cc" type="string | string[]">
      CC recipient(s).
    </ParamField>

    <ParamField body="bcc" type="string | string[]">
      BCC recipient(s).
    </ParamField>

    <ParamField body="reply_to" type="string | string[]">
      Reply-to address(es).
    </ParamField>

    <ParamField body="tags" type="object[]">
      Email tags for tracking. Each tag has a `name` and `value`.
    </ParamField>

    <ParamField body="scheduled_at" type="string">
      Schedule send time (ISO 8601).
    </ParamField>

    <ParamField body="attachments" type="object[]">
      File attachments. Each item is an object with a `filename` and base64-encoded `content`.

      In a workflow, map `content` to an upstream output that already produces base64-encoded bytes (e.g. a file downloaded over HTTP/FTP, or a document produced by another step).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "from": "Acme <onboarding@resend.dev>",
      "to": ["delivered@resend.dev"],
      "subject": "hello world",
      "html": "<p>it works!</p>",
      "reply_to": "onboarding@resend.dev",
      "attachments": [
        { "filename": "report.csv", "content": "Y29sMSxjb2wyCg==" }
      ]
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
    }
    ```
  </Accordion>

  <Accordion title="send-batch-emails: Send multiple emails">
    <ParamField body="emails" type="object[]" required>
      Array of email objects with the same fields as `send-email` (including `attachments`).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "emails": [
        {
          "from": "Acme <onboarding@resend.dev>",
          "to": ["foo@gmail.com"],
          "subject": "hello world",
          "html": "<h1>it works!</h1>"
        },
        {
          "from": "Acme <onboarding@resend.dev>",
          "to": ["bar@outlook.com"],
          "subject": "world hello",
          "html": "<p>it works!</p>"
        }
      ]
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": [
        {
          "id": "ae2014de-c168-4c61-8267-70d2662a1ce1"
        },
        {
          "id": "faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="get-email: Get sent email details">
    <ParamField body="id" type="string" required>
      Email ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "email",
      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
      "to": ["delivered@resend.dev"],
      "from": "Acme <onboarding@resend.dev>",
      "created_at": "2023-04-03T22:13:42.674981+00:00",
      "subject": "Hello World",
      "html": "Congrats on sending your <strong>first email</strong>!",
      "text": null,
      "bcc": [],
      "cc": [],
      "reply_to": [],
      "last_event": "delivered",
      "scheduled_at": null,
      "tags": [
        {
          "name": "category",
          "value": "confirm_email"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="list-emails: List all sent emails">
    No parameters required.

    **Example response:**

    ```json theme={null}
    {
      "object": "list",
      "has_more": false,
      "data": [
        {
          "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
          "to": ["delivered@resend.dev"],
          "from": "Acme <onboarding@resend.dev>",
          "created_at": "2023-04-03T22:13:42.674981+00:00",
          "subject": "Hello World",
          "bcc": null,
          "cc": null,
          "reply_to": null,
          "last_event": "delivered",
          "scheduled_at": null
        }
      ]
    }
    ```
  </Accordion>
</AccordionGroup>

### Contacts

<AccordionGroup>
  <Accordion title="create-contact: Add a contact to an audience">
    <ParamField body="audience_id" type="string" required>
      Audience ID.
    </ParamField>

    <ParamField body="email" type="string" required>
      Contact email address.
    </ParamField>

    <ParamField body="first_name" type="string">
      First name.
    </ParamField>

    <ParamField body="last_name" type="string">
      Last name.
    </ParamField>

    <ParamField body="unsubscribed" type="boolean" default="false">
      Whether the contact is unsubscribed.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "email": "steve.wozniak@gmail.com",
      "first_name": "Steve",
      "last_name": "Wozniak",
      "unsubscribed": false
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "contact",
      "id": "479e3145-dd38-476b-932c-529ceb705947"
    }
    ```
  </Accordion>

  <Accordion title="list-contacts: List contacts in an audience">
    <ParamField body="audience_id" type="string" required>
      Audience ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "list",
      "has_more": false,
      "data": [
        {
          "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
          "email": "steve.wozniak@gmail.com",
          "first_name": "Steve",
          "last_name": "Wozniak",
          "created_at": "2023-10-06T23:47:56.678Z",
          "unsubscribed": false
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="get-contact: Get a contact by ID">
    <ParamField body="audience_id" type="string" required>
      Audience ID.
    </ParamField>

    <ParamField body="id" type="string" required>
      Contact ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "contact",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "email": "steve.wozniak@gmail.com",
      "first_name": "Steve",
      "last_name": "Wozniak",
      "created_at": "2023-10-06T23:47:56.678Z",
      "unsubscribed": false
    }
    ```
  </Accordion>

  <Accordion title="update-contact: Update a contact">
    <ParamField body="audience_id" type="string" required>
      Audience ID.
    </ParamField>

    <ParamField body="id" type="string" required>
      Contact ID.
    </ParamField>

    <ParamField body="first_name" type="string">
      New first name.
    </ParamField>

    <ParamField body="last_name" type="string">
      New last name.
    </ParamField>

    <ParamField body="unsubscribed" type="boolean">
      Update subscription status.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "id": "479e3145-dd38-476b-932c-529ceb705947",
      "unsubscribed": true
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "contact",
      "id": "479e3145-dd38-476b-932c-529ceb705947"
    }
    ```
  </Accordion>

  <Accordion title="delete-contact: Remove a contact">
    <ParamField body="audience_id" type="string" required>
      Audience ID.
    </ParamField>

    <ParamField body="id" type="string" required>
      Contact ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "id": "520784e2-887d-4c25-b53c-4ad46ad38100"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "contact",
      "contact": "520784e2-887d-4c25-b53c-4ad46ad38100",
      "deleted": true
    }
    ```
  </Accordion>
</AccordionGroup>

### Domains

<AccordionGroup>
  <Accordion title="list-domains: List configured domains">
    No parameters required.

    **Example response:**

    ```json theme={null}
    {
      "object": "list",
      "has_more": false,
      "data": [
        {
          "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
          "name": "example.com",
          "status": "not_started",
          "created_at": "2023-04-26T20:21:26.347412+00:00",
          "region": "us-east-1"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="get-domain: Get domain details">
    <ParamField body="id" type="string" required>
      Domain ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "d91cd9bd-1176-453e-8fc1-35364d380206"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "domain",
      "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
      "name": "example.com",
      "status": "not_started",
      "created_at": "2023-04-26T20:21:26.347412+00:00",
      "region": "us-east-1",
      "records": [
        {
          "record": "SPF",
          "name": "send",
          "type": "MX",
          "ttl": "Auto",
          "status": "not_started",
          "value": "feedback-smtp.us-east-1.amazonses.com",
          "priority": 10
        },
        {
          "record": "SPF",
          "name": "send",
          "value": "\"v=spf1 include:amazonses.com ~all\"",
          "type": "TXT",
          "ttl": "Auto",
          "status": "not_started"
        },
        {
          "record": "DKIM",
          "name": "resend._domainkey",
          "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4...",
          "type": "TXT",
          "status": "not_started",
          "ttl": "Auto"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="verify-domain: Trigger DNS verification">
    <ParamField body="id" type="string" required>
      Domain ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "d91cd9bd-1176-453e-8fc1-35364d380206"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "object": "domain",
      "id": "d91cd9bd-1176-453e-8fc1-35364d380206"
    }
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-request: Make an arbitrary HTTP request">
    Send a request to any Resend API endpoint.

    <ParamField body="method" type="string" required>
      HTTP method: `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`.
    </ParamField>

    <ParamField body="path" type="string" required>
      API path (e.g., `/emails`).
    </ParamField>

    <ParamField body="body" type="object">
      Request body.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "method": "POST",
      "path": "/emails",
      "body": {
        "from": "Acme <onboarding@resend.dev>",
        "to": ["delivered@resend.dev"],
        "subject": "Hello World",
        "html": "<p>Congrats on sending your first email!</p>"
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
    }
    ```
  </Accordion>
</AccordionGroup>
