Skip to main content
POST
/
sandbox
/
confluence
/
{sandbox_id}
/
initialize
Initialize confluence sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/confluence/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "spaces": [
    {
      "identifier": "TEAM",
      "name": "Team Space",
      "description": "Space for team collaboration",
      "pages": [
        {
          "title": "Welcome to the Team",
          "content": "<p>This is the home page for our team.</p>",
          "comments": [
            {
              "content": "<p>Great start!</p>"
            }
          ],
          "children": [
            {
              "title": "Project Alpha",
              "content": "<h1>Project Alpha</h1><p>Details about the project.</p>",
              "comments": [
                {
                  "content": "<p>Looking forward to this.</p>"
                }
              ]
            },
            {
              "title": "Meeting Notes",
              "content": "<p>Weekly meeting notes go here.</p>",
              "children": [
                {
                  "title": "2023-10-27 Sync",
                  "content": "<p>Discussed Q4 goals.</p>"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "identifier": "DOCS",
      "name": "Documentation",
      "description": "Product documentation",
      "pages": [
        {
          "title": "Getting Started",
          "content": "<p>How to use the product.</p>"
        }
      ]
    }
  ]
}
'
import requests

url = "https://api.klavis.ai/sandbox/confluence/{sandbox_id}/initialize"

payload = { "spaces": [
{
"identifier": "TEAM",
"name": "Team Space",
"description": "Space for team collaboration",
"pages": [
{
"title": "Welcome to the Team",
"content": "<p>This is the home page for our team.</p>",
"comments": [{ "content": "<p>Great start!</p>" }],
"children": [
{
"title": "Project Alpha",
"content": "<h1>Project Alpha</h1><p>Details about the project.</p>",
"comments": [{ "content": "<p>Looking forward to this.</p>" }]
},
{
"title": "Meeting Notes",
"content": "<p>Weekly meeting notes go here.</p>",
"children": [
{
"title": "2023-10-27 Sync",
"content": "<p>Discussed Q4 goals.</p>"
}
]
}
]
}
]
},
{
"identifier": "DOCS",
"name": "Documentation",
"description": "Product documentation",
"pages": [
{
"title": "Getting Started",
"content": "<p>How to use the product.</p>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spaces: [
{
identifier: 'TEAM',
name: 'Team Space',
description: 'Space for team collaboration',
pages: [
{
title: 'Welcome to the Team',
content: '<p>This is the home page for our team.</p>',
comments: [{content: '<p>Great start!</p>'}],
children: [
{
title: 'Project Alpha',
content: '<h1>Project Alpha</h1><p>Details about the project.</p>',
comments: [{content: '<p>Looking forward to this.</p>'}]
},
{
title: 'Meeting Notes',
content: '<p>Weekly meeting notes go here.</p>',
children: [{title: '2023-10-27 Sync', content: '<p>Discussed Q4 goals.</p>'}]
}
]
}
]
},
{
identifier: 'DOCS',
name: 'Documentation',
description: 'Product documentation',
pages: [{title: 'Getting Started', content: '<p>How to use the product.</p>'}]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/confluence/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spaces: [
{
identifier: 'TEAM',
name: 'Team Space',
description: 'Space for team collaboration',
pages: [
{
title: 'Welcome to the Team',
content: '<p>This is the home page for our team.</p>',
comments: [{content: '<p>Great start!</p>'}],
children: [
{
title: 'Project Alpha',
content: '<h1>Project Alpha</h1><p>Details about the project.</p>',
comments: [{content: '<p>Looking forward to this.</p>'}]
},
{
title: 'Meeting Notes',
content: '<p>Weekly meeting notes go here.</p>',
children: [{title: '2023-10-27 Sync', content: '<p>Discussed Q4 goals.</p>'}]
}
]
}
]
},
{
identifier: 'DOCS',
name: 'Documentation',
description: 'Product documentation',
pages: [{title: 'Getting Started', content: '<p>How to use the product.</p>'}]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/confluence/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "sandbox_id": "<string>",
  "message": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

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 Confluence sandbox data structure.

Hierarchy:

  • Spaces contain Pages
  • Pages can have children (nested pages) and Comments
spaces
ConfluenceSpace · object[]

List of spaces

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