Skip to main content
POST
/
sandbox
/
slack
/
{sandbox_id}
/
initialize
Initialize slack sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/slack/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channels": [
    {
      "name": "sandbox-test",
      "description": "Company-wide announcements and work-based matters",
      "is_private": false,
      "messages": [
        {
          "text": "Welcome to the new Slack workspace!",
          "reactions": [
            {
              "name": "wave"
            },
            {
              "name": "tada"
            }
          ]
        },
        {
          "text": "Thanks! Excited to be here.",
          "reactions": [
            {
              "name": "+1"
            }
          ]
        }
      ]
    },
    {
      "name": "project-alpha",
      "description": "Discussion for Project Alpha",
      "is_private": false,
      "messages": [
        {
          "text": "Has anyone seen the latest specs?",
          "reactions": [],
          "replies": [
            {
              "text": "I have them, will share in a moment",
              "reactions": [
                {
                  "name": "eyes"
                }
              ]
            },
            {
              "text": "Thanks! That would be great."
            }
          ]
        },
        {
          "text": "Here are the project specs...",
          "reactions": [
            {
              "name": "rocket"
            }
          ]
        }
      ]
    },
    {
      "name": "sandbox-test-private",
      "description": "Top secret stuff",
      "is_private": true,
      "messages": [
        {
          "text": "This is confidential information",
          "reactions": [
            {
              "name": "shushing_face"
            }
          ],
          "replies": [
            {
              "text": "Got it, keeping this private"
            }
          ]
        }
      ]
    }
  ]
}
'
import requests

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

payload = { "channels": [
{
"name": "sandbox-test",
"description": "Company-wide announcements and work-based matters",
"is_private": False,
"messages": [
{
"text": "Welcome to the new Slack workspace!",
"reactions": [{ "name": "wave" }, { "name": "tada" }]
},
{
"text": "Thanks! Excited to be here.",
"reactions": [{ "name": "+1" }]
}
]
},
{
"name": "project-alpha",
"description": "Discussion for Project Alpha",
"is_private": False,
"messages": [
{
"text": "Has anyone seen the latest specs?",
"reactions": [],
"replies": [{
"text": "I have them, will share in a moment",
"reactions": [{ "name": "eyes" }]
}, { "text": "Thanks! That would be great." }]
},
{
"text": "Here are the project specs...",
"reactions": [{ "name": "rocket" }]
}
]
},
{
"name": "sandbox-test-private",
"description": "Top secret stuff",
"is_private": True,
"messages": [
{
"text": "This is confidential information",
"reactions": [{ "name": "shushing_face" }],
"replies": [{ "text": "Got it, keeping this private" }]
}
]
}
] }
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({
channels: [
{
name: 'sandbox-test',
description: 'Company-wide announcements and work-based matters',
is_private: false,
messages: [
{
text: 'Welcome to the new Slack workspace!',
reactions: [{name: 'wave'}, {name: 'tada'}]
},
{text: 'Thanks! Excited to be here.', reactions: [{name: '+1'}]}
]
},
{
name: 'project-alpha',
description: 'Discussion for Project Alpha',
is_private: false,
messages: [
{
text: 'Has anyone seen the latest specs?',
reactions: [],
replies: [
{text: 'I have them, will share in a moment', reactions: [{name: 'eyes'}]},
{text: 'Thanks! That would be great.'}
]
},
{text: 'Here are the project specs...', reactions: [{name: 'rocket'}]}
]
},
{
name: 'sandbox-test-private',
description: 'Top secret stuff',
is_private: true,
messages: [
{
text: 'This is confidential information',
reactions: [{name: 'shushing_face'}],
replies: [{text: 'Got it, keeping this private'}]
}
]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/slack/{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({
channels: [
{
name: 'sandbox-test',
description: 'Company-wide announcements and work-based matters',
is_private: false,
messages: [
{
text: 'Welcome to the new Slack workspace!',
reactions: [{name: 'wave'}, {name: 'tada'}]
},
{text: 'Thanks! Excited to be here.', reactions: [{name: '+1'}]}
]
},
{
name: 'project-alpha',
description: 'Discussion for Project Alpha',
is_private: false,
messages: [
{
text: 'Has anyone seen the latest specs?',
reactions: [],
replies: [
{text: 'I have them, will share in a moment', reactions: [{name: 'eyes'}]},
{text: 'Thanks! That would be great.'}
]
},
{text: 'Here are the project specs...', reactions: [{name: 'rocket'}]}
]
},
{
name: 'sandbox-test-private',
description: 'Top secret stuff',
is_private: true,
messages: [
{
text: 'This is confidential information',
reactions: [{name: 'shushing_face'}],
replies: [{text: 'Got it, keeping this private'}]
}
]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/slack/{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 Slack sandbox data structure.

Hierarchy:

  • Channels contain Messages
  • Messages can have Reactions and Replies (threads)
channels
SlackChannel · object[] | null

List of channels

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