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

# Initialize resend sandbox with data

> Initialize the sandbox with resend-specific data following the defined schema.



## OpenAPI

````yaml post /sandbox/resend/{sandbox_id}/initialize
openapi: 3.1.0
info:
  title: Klavis AI (https://www.klavis.ai)
  description: Klavis AI - Open Source MCP Integrations for AI Applications
  version: 0.1.0
servers:
  - url: https://api.klavis.ai
    description: US Production server
  - url: https://api.eu.klavis.ai
    description: EU Production server
security: []
paths:
  /sandbox/resend/{sandbox_id}/initialize:
    post:
      tags:
        - sandbox
      summary: Initialize resend sandbox with data
      description: >-
        Initialize the sandbox with resend-specific data following the defined
        schema.
      operationId: initialize_sandbox_sandbox_resend__sandbox_id__initialize_post
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            description: The unique sandbox identifier
            title: Sandbox Id
          description: The unique sandbox identifier
        - name: init_default_data
          in: query
          required: false
          schema:
            type: boolean
            description: If true, use default test data for initialization
            default: false
            title: Init Default Data
          description: If true, use default test data for initialization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ResendData-Input'
                - type: 'null'
              title: Request Body
            examples:
              default:
                summary: Example initialization data
                value:
                  contacts:
                    - email: robert.johnson@techcorp.com
                      first_name: Robert
                      last_name: Johnson
                      unsubscribed: false
                    - email: maria.garcia@innovate.io
                      first_name: Maria
                      last_name: Garcia
                      unsubscribed: false
                    - email: david.lee@startup.com
                      first_name: David
                      last_name: Lee
                      unsubscribed: false
                  segments:
                    - name: Premium Customers
                      broadcasts:
                        - from: onboarding@resend.dev
                          subject: Exclusive Premium Member Benefits This Month
                          name: Premium Benefits December
                          html: >-
                            <h1>Premium Member Exclusive</h1><p>As a valued
                            premium member, enjoy these exclusive benefits this
                            month...</p><ul><li>20% off all
                            products</li><li>Early access to new
                            features</li><li>Priority support</li></ul>
                          text: >-
                            Premium Member Exclusive - Enjoy 20% off all
                            products, early access to new features, and priority
                            support this month.
                          status: draft
                    - name: Newsletter Subscribers
                      broadcasts:
                        - from: onboarding@resend.dev
                          subject: ACME Monthly Newsletter - December 2025
                          name: December Newsletter
                          html: >-
                            <div><h1>December Newsletter</h1><h2>What's New This
                            Month</h2><p>Here are the highlights from
                            December...</p><ul><li>Product
                            updates</li><li>Customer success
                            stories</li><li>Upcoming events</li></ul></div>
                          text: >-
                            December Newsletter - What's New This Month: Product
                            updates, customer success stories, and upcoming
                            events.
                          reply_to: feedback@acmecorp.com
                          status: draft
                    - name: Trial Users
                      broadcasts:
                        - from: onboarding@resend.dev
                          subject: Getting Started with Your Free Trial
                          name: Trial Onboarding Sequence
                          html: >-
                            <h1>Welcome to Your Free Trial!</h1><p>Let's get you
                            started with some helpful
                            resources...</p><div><h3>Quick Start
                            Guide</h3><ol><li>Complete your
                            profile</li><li>Explore the dashboard</li><li>Try
                            our key features</li></ol></div>
                          text: >-
                            Welcome to Your Free Trial! Quick Start Guide: 1)
                            Complete your profile 2) Explore the dashboard 3)
                            Try our key features
                          status: draft
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitializeSandboxResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ResendData-Input:
      properties:
        emails:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResendEmail-Input'
              type: array
            - type: 'null'
          title: Emails
          description: List of standalone transactional emails
        contacts:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResendContact-Input'
              type: array
            - type: 'null'
          title: Contacts
          description: List of standalone contacts
        segments:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResendSegment-Input'
              type: array
            - type: 'null'
          title: Segments
          description: List of segments with nested broadcasts
      type: object
      title: ResendData
      description: |-
        Complete Resend sandbox data structure.

        Mixed structure:
        - Segments contain nested Broadcasts (broadcasts MUST have a segment)
        - Emails are standalone (transactional)
        - Contacts are standalone (can be optionally linked to segments)
    InitializeSandboxResponse:
      properties:
        sandbox_id:
          type: string
          title: Sandbox Id
          description: Sandbox identifier
        status:
          $ref: '#/components/schemas/SandboxStatus'
          description: Current status
        message:
          type: string
          title: Message
          description: Initialization result message
      type: object
      required:
        - sandbox_id
        - status
        - message
      title: InitializeSandboxResponse
      description: Response model for sandbox initialization
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResendEmail-Input:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Email ID (read-only, set by Resend)
        from:
          type: string
          title: From
          description: Sender email address
        to:
          items:
            type: string
          type: array
          title: To
          description: Recipient email addresses
        subject:
          type: string
          title: Subject
          description: Email subject
        html:
          anyOf:
            - type: string
            - type: 'null'
          title: Html
          description: HTML content of the email
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          description: Plain text content of the email
        reply_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Reply To
          description: Reply-to email address
        cc:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Cc
          description: CC email addresses
        bcc:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Bcc
          description: BCC email addresses
        tags:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Tags
          description: Email tags for categorization
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp
      type: object
      required:
        - from
        - to
        - subject
      title: ResendEmail
      description: Resend Email object - standalone transactional email
    ResendContact-Input:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Contact ID (read-only, set by Resend)
        email:
          type: string
          title: Email
          description: The email address of the contact.
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: Contact first name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Contact last name
        unsubscribed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Unsubscribed
          description: Whether contact is unsubscribed from all Broadcasts
          default: false
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp
      type: object
      required:
        - email
      title: ResendContact
      description: Resend Contact object - standalone, independent of segments
    ResendSegment-Input:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Segment ID (read-only, set by Resend)
        name:
          type: string
          title: Name
          description: Segment name
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp
        broadcasts:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResendBroadcast-Input'
              type: array
            - type: 'null'
          title: Broadcasts
          description: Broadcasts sent to this segment
      type: object
      required:
        - name
      title: ResendSegment
      description: >-
        Resend Segment object - parent containing broadcasts that target this
        segment
    SandboxStatus:
      type: string
      enum:
        - idle
        - occupied
        - error
      title: SandboxStatus
      description: Status of a sandbox instance - matches database enum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ResendBroadcast-Input:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Broadcast ID (read-only, set by Resend)
        from:
          type: string
          title: From
          description: Sender email with optional display name
        subject:
          type: string
          title: Subject
          description: Email subject
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Broadcast name for internal reference
        html:
          anyOf:
            - type: string
            - type: 'null'
          title: Html
          description: HTML content
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          description: Plain text content
        reply_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Reply To
          description: Reply-to email address
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Broadcast status (draft, sent, etc.)
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp
        scheduled_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Scheduled At
          description: Scheduled send timestamp
        sent_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Sent At
          description: Actual send timestamp
        topic_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Topic Id
          description: Topic ID for scoping
      type: object
      required:
        - from
        - subject
      title: ResendBroadcast
      description: Resend Broadcast object - child of Segment, requires parent segment
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````