← Help center

API reference

Authentication

Public widget endpoints are keyed by your Bot ID. The product sync API uses your per-bot sync key in the X-Astroworld-Key header.

POST /api/chat/{botId}/message

Send a visitor message and get the bot reply. Include a stable session_id to keep conversation context.

curl -X POST https://chat.astroworldmc.com/api/chat/BOT_ID/message \
  -H 'content-type: application/json' \
  -d '{"session_id":"abc123","message":"What are your hours?"}'

JavaScript

const res = await fetch(`https://chat.astroworldmc.com/api/chat/${botId}/message`, {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ session_id: 'abc123', message: 'What are your hours?' })
});
const data = await res.json(); // { reply, confidence, buttons, ... }

Python

import requests
r = requests.post(
  f'https://chat.astroworldmc.com/api/chat/{bot_id}/message',
  json={'session_id': 'abc123', 'message': 'What are your hours?'})
print(r.json()['reply'])

POST /api/v1/chat/sync-products

Sync your product catalog. Send the catalog as JSON with the header X-Astroworld-Key set to your sync key.

Webhook events

Configure a webhook URL under Integrations to receive lead, handover, and conversation events. Each payload includes an event_type field.

Try it

Use the sandbox below to send a live message to one of your bots.

Was this helpful?
API reference | Astroworld Chat docs