Starting and resetting
Use this API to start a conversation, whether the channel is starting for the first time or you need to reset the bot's interaction history.
URI
{{base_url}}/generic/ns/{{namespace}}/bot-provider/{{bot_provider_name}}/message/sse
HTTP method
POST
Headers
If you have enabled the API key feature, include X-API-KEY in the header, set to the API key configured in the Asgard console. Without it the connection fails.
| Name | Type | Description |
|---|---|---|
| X-API-KEY | string | Your API key |
Request parameters
| Name | Type | Description |
|---|---|---|
| customChannelId | string | The chat channel's id. Required, and yours to choose. Conversation memory is per channel id. |
| customMessageId | string | The message id. Set your own or leave it empty; useful for tracing and debugging. |
| text | string | Leave empty when initializing |
| action | string | Must be RESET_CHANNEL when initializing |
Sample payload
{
"customChannelId": "a-random-channel-id-1",
"customMessageId": "a-random-msg-id-1",
"text": "",
"action": "RESET_CHANNEL"
}
Response
On success you receive a stream of JSON messages. For the detail of each event:
The events
- asgard.run.init — the run starts
- asgard.message.start — a message starts
- asgard.message.delta — an incremental message fragment
- asgard.message.complete — a message completes
- asgard.run.done — the run completes
- asgard.run.error — an error
Message Template
The message object's template field carries the render data for the frontend's standard components:
- The Message Template reference — how to handle template data