Resend Emails API

Start sending emails through the Resend API.

OpenAPI Specification

resend-emails-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Resend Emails API
  version: 1.1.0
  description: '

    Resend is transforming email for developers. Simple interface, easy

    integrations, handy templates. '
servers:
- url: https://api.resend.com
security:
- bearerAuth: []
tags:
- name: Emails
  description: Start sending emails through the Resend API.
paths:
  /emails:
    post:
      tags:
      - Emails
      summary: Send an email
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEmailRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
  /emails/{email_id}:
    get:
      tags:
      - Emails
      summary: Retrieve a single email
      parameters:
      - name: email_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the email.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Email'
    patch:
      tags:
      - Emails
      summary: Update a single email
      parameters:
      - name: email_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the email.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateEmailOptions'
  /emails/{email_id}/cancel:
    post:
      tags:
      - Emails
      summary: Cancel the schedule of the e-mail.
      parameters:
      - name: email_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the email.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Email'
  /emails/batch:
    post:
      tags:
      - Emails
      summary: Trigger up to 100 batch emails at once.
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SendEmailRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBatchEmailsResponse'
components:
  schemas:
    SendEmailResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the sent email.
    Tag:
      type: object
      properties:
        name:
          type: string
          description: The name of the email tag. It can only contain ASCII letters (az, AZ), numbers (09), underscores (_), or dashes (-). It can contain no more than 256 characters.
        value:
          type: string
          description: The value of the email tag.It can only contain ASCII letters (az, AZ), numbers (09), underscores (_), or dashes (-). It can contain no more than 256 characters.
    SendEmailRequest:
      type: object
      required:
      - from
      - to
      - subject
      properties:
        from:
          type: string
          description: Sender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".
        to:
          type: array
          items:
            type: string
            description: Recipient email address. For multiple addresses, send as an array of strings. Max 50.
        subject:
          type: string
          description: Email subject.
        bcc:
          type: string
          description: Bcc recipient email address. For multiple addresses, send as an array of strings.
        cc:
          type: string
          description: Cc recipient email address. For multiple addresses, send as an array of strings.
        reply_to:
          type: string
          description: Reply-to email address. For multiple addresses, send as an array of strings.
        html:
          type: string
          description: The HTML version of the message.
        text:
          type: string
          description: The plain text version of the message.
        headers:
          type: object
          description: Custom headers to add to the email.
        scheduled_at:
          type: string
          description: Schedule email to be sent later. The date should be in ISO 8601 format.
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
    Attachment:
      type: object
      properties:
        content:
          type: string
          format: binary
          description: Content of an attached file.
        filename:
          type: string
          description: Name of attached file.
        path:
          type: string
          description: Path where the attachment file is hosted
        content_type:
          type: string
          description: Optional content type for the attachment, if not set it will be derived from the filename property
    CreateBatchEmailsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The ID of the sent email.
    UpdateEmailOptions:
      type: object
      properties:
        scheduled_at:
          type: string
          description: Schedule email to be sent later. The date should be in ISO 8601 format.
    Email:
      type: object
      properties:
        object:
          type: string
          description: The type of object.
          example: email
        id:
          type: string
          description: The ID of the email.
          example: 4ef9a417-02e9-4d39-ad75-9611e0fcc33c
        to:
          type: array
          items:
            type: string
            description: The email addresses of the recipients.
          example:
          - delivered@resend.dev
        from:
          type: string
          description: The email address of the sender.
          example: Acme <onboarding@resend.dev>
        created_at:
          type: string
          format: date-time
          description: The date and time the email was created.
          example: '2023-04-03T22:13:42.674981+00:00'
        subject:
          type: string
          description: The subject line of the email.
          example: Hello World
        html:
          type: string
          description: The HTML body of the email.
          example: Congrats on sending your <strong>first email</strong>!
        text:
          type: string
          description: The plain text body of the email.
        bcc:
          type: array
          items:
            type: string
          description: The email addresses of the blind carbon copy recipients.
        cc:
          type: array
          items:
            type: string
          description: The email addresses of the carbon copy recipients.
        reply_to:
          type: array
          items:
            type: string
          description: The email addresses to which replies should be sent.
        last_event:
          type: string
          description: The status of the email.
          example: delivered
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer