Skip to main content
POST
/
sandbox
/
gmail
/
{sandbox_id}
/
initialize
Initialize gmail sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/gmail/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "subject": "<string>",
      "to": "<string>",
      "body": "<string>",
      "cc": "<string>",
      "bcc": "<string>",
      "from": "<string>",
      "reply_to": "<string>",
      "labels": [
        "<string>"
      ]
    }
  ],
  "drafts": [
    {
      "subject": "<string>",
      "to": "<string>",
      "body": "<string>",
      "cc": "<string>",
      "bcc": "<string>",
      "from": "<string>",
      "reply_to": "<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 Gmail sandbox data structure with all supported objects

messages
GmailMessage · object[] | null

List of Gmail messages to send

drafts
GmailDraft · object[] | null

List of Gmail drafts to create

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