---
title: "Initialize mem0 sandbox with data"
method: POST
path: "/sandbox/mem0/{sandbox_id}/initialize"
tags: ["sandbox"]
---

# Initialize mem0 sandbox with data

`POST /sandbox/mem0/{sandbox_id}/initialize`

Initialize the sandbox with mem0-specific data following the defined schema.

## Path parameters

- `sandbox_id` string, required — The unique sandbox identifier

## Query parameters

- `init_default_data` boolean — If true, use default test data for initialization

## Request body

- Mem0DataInput — Complete Mem0 sandbox data structure
  - `memory_list` Mem0Memory[] — List of memories
    - `id` string, nullable — Memory ID (read-only, set by Mem0)
    - `content_text` string, nullable — Memory content (returned from API)
    - `message_list` Mem0Message[], nullable — Array of message objects representing the content
      - `role` string, required — Role of the message sender (user or assistant)
      - `content` string, required — Content of the message
    - `agent_id` string, nullable — Agent ID
    - `user_id` string, nullable — User ID
    - `app_id` string, nullable — App ID
    - `run_id` string, nullable — Run ID
    - `metadata` object, nullable — Additional metadata
    - `include_preferences` string, nullable — String to include specific preferences in the memory
    - `exclude_preferences` string, nullable — String to exclude specific preferences in the memory
    - `auto_infer` boolean — Whether to infer memories or directly store messages
    - `response_format` string, nullable — Response format structure (v1.0 or v1.1)
    - `category_definitions` object[], nullable — List of custom categories with name and description
    - `processing_instructions` string, nullable — Project-specific guidelines for handling memories
    - `read_only` boolean — Whether the memory is immutable
    - `background_processing` boolean — Whether to add memory asynchronously
    - `timestamp` integer, nullable — Unix timestamp of the memory
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Last update timestamp

## Response `200`

Successful Response

- InitializeSandboxResponse — Response model for sandbox initialization
  - `sandbox_id` string, required — Sandbox identifier
  - `status` 'idle' | 'occupied' | 'error', required — Status of a sandbox instance - matches database enum
  - `message` string, required — Initialization result message

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) · [All operations](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/klavis-ai/klavis-ai-https-www-klavis-ai/revisions/1f05ced7280f/schema)
