Skip to main content
POST
/
sandbox
/
discord
/
{sandbox_id}
/
initialize
Initialize discord sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channels": [
    {
      "messages": [
        {
          "content": "Welcome to the Discord sandbox test!",
          "reactions": [
            {
              "name": "👋"
            },
            {
              "name": "🎉"
            }
          ]
        },
        {
          "content": "This is the second test message.",
          "reactions": [
            {
              "name": "👍"
            }
          ]
        },
        {
          "content": "Message without reactions for testing.",
          "reactions": []
        }
      ]
    }
  ]
}
'
import requests

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

payload = { "channels": [{ "messages": [
{
"content": "Welcome to the Discord sandbox test!",
"reactions": [{ "name": "👋" }, { "name": "🎉" }]
},
{
"content": "This is the second test message.",
"reactions": [{ "name": "👍" }]
},
{
"content": "Message without reactions for testing.",
"reactions": []
}
] }] }
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: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/discord/{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: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};

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

Hierarchy:

  • Channels contain Messages
  • Messages can have Reactions
channels
DiscordChannel · 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