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 @- <<EOF
{
  "messages": [
    {
      "subject": "Weekly Team Update",
      "to": "[email protected]",
      "cc": "[email protected]",
      "body": "Hi Team,\n\nHere's our weekly update:\n\n1. Project A is on track\n2. Sprint planning next week\n3. New hire starting Monday\n\nBest regards",
      "labels": [
        "INBOX",
        "IMPORTANT"
      ]
    },
    {
      "subject": "Project Status Report",
      "to": "[email protected]",
      "body": "Dear Client,\n\nI'm writing to update you on the project status. All milestones are being met on schedule.\n\nKey accomplishments this week:\n- Completed Phase 1\n- Initiated Phase 2\n- Stakeholder review meeting scheduled\n\nLooking forward to our next meeting.\n\nBest regards",
      "labels": [
        "INBOX"
      ]
    },
    {
      "subject": "Follow-up on Support Ticket #12345",
      "to": "[email protected]",
      "body": "Hello Support Team,\n\nI wanted to follow up on ticket #12345. Has there been any progress on this issue?\n\nThank you for your assistance.\n\nBest regards",
      "labels": [
        "INBOX"
      ]
    },
    {
      "subject": "Meeting Notes - Q4 Planning",
      "to": "[email protected]",
      "cc": "[email protected]",
      "body": "Hi everyone,\n\nAttached are the notes from our Q4 planning session:\n\n- Budget allocation approved\n- New initiatives prioritized\n- Timeline established\n\nPlease review and provide feedback by EOW.\n\nThanks",
      "labels": [
        "INBOX",
        "CATEGORY_UPDATES"
      ]
    },
    {
      "subject": "Quarterly Review Reminder",
      "to": "[email protected]",
      "body": "Team,\n\nFriendly reminder that quarterly reviews are due next Friday.\n\nPlease complete your self-assessment and submit to your manager.\n\nThank you!",
      "labels": [
        "INBOX"
      ]
    }
  ],
  "drafts": [
    {
      "subject": "Re: Partnership Proposal",
      "to": "[email protected]",
      "body": "Hi there,\n\nThank you for reaching out regarding the partnership opportunity. I'm very interested in learning more.\n\nCould we schedule a call next week to discuss further?\n\nBest regards"
    },
    {
      "subject": "Vacation Request - December",
      "to": "[email protected]",
      "cc": "[email protected]",
      "body": "Dear HR,\n\nI would like to request vacation time from December 20-30, 2024.\n\nPlease let me know if you need any additional information.\n\nThank you"
    },
    {
      "subject": "Product Feedback",
      "to": "[email protected]",
      "body": "Hi Product Team,\n\nI wanted to share some feedback on the recent update:\n\n1. The new dashboard is much more intuitive\n2. Performance has improved significantly\n3. One suggestion: add keyboard shortcuts\n\nOverall, great work!\n\nBest"
    }
  ]
}
EOF
{
  "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

Query Parameters

init_default_data
boolean
default:false

If true, use default test data for initialization

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,
error
message
string
required

Initialization result message

records_created
Records Created · object

Count of records created per object type