Skip to main content
POST
/
sandbox
/
resend
/
{sandbox_id}
/
initialize
Initialize resend sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/resend/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "emails": [
    {
      "from": "<string>",
      "to": [
        "<string>"
      ],
      "subject": "<string>",
      "id": "<string>",
      "html": "<string>",
      "text": "<string>",
      "reply_to": "<string>",
      "cc": [
        "<string>"
      ],
      "bcc": [
        "<string>"
      ],
      "tags": [
        {}
      ],
      "created_at": "<string>"
    }
  ],
  "contacts": [
    {
      "email": "<string>",
      "id": "<string>",
      "first_name": "<string>",
      "last_name": "<string>",
      "unsubscribed": false,
      "created_at": "<string>"
    }
  ],
  "segments": [
    {
      "name": "<string>",
      "id": "<string>",
      "created_at": "<string>",
      "broadcasts": [
        {
          "from": "<string>",
          "subject": "<string>",
          "id": "<string>",
          "name": "<string>",
          "html": "<string>",
          "text": "<string>",
          "reply_to": "<string>",
          "status": "<string>",
          "created_at": "<string>",
          "scheduled_at": "<string>",
          "sent_at": "<string>",
          "topic_id": "<string>"
        }
      ]
    }
  ]
}
'
{
  "sandbox_id": "<string>",
  "status": "idle",
  "message": "<string>",
  "records_created": {}
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Path Parameters

sandbox_id
string
required

The unique sandbox identifier

Body

application/json

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)
emails
ResendEmail · object[] | null

List of standalone transactional emails

contacts
ResendContact · object[] | null

List of standalone contacts

segments
ResendSegment · object[] | null

List of segments with nested broadcasts

Response

Successful Response

Response model for sandbox initialization

sandbox_id
string
required

Sandbox identifier

status
enum<string>
required

Current status

Available options:
idle,
occupied
message
string
required

Initialization result message

records_created
Records Created · object

Count of records created per object type