Chat widget

The embeddable chat widget's appearance.

Base URL https://futuresmart.ai/database-agent/api · every request sends X-API-Key. Samples read the key from DATABASE_AGENT_API_KEY. All endpoints

Retrieve Widget Settings

GET/v1/agents/{agent_id}/widget/settings

Get the agent's widget settings

Authenticated callers get the full record. Anonymous callers are allowed only when the agent has opted this surface in (is_public, or fullscreen_is_public with ?from_full_screen=true) and their Origin matches the matching allowlist; they receive display fields only.

An agent that has never been configured returns the documented defaults rather than 404.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID

Response · 200

NameTypeDescription
widget_settingsrequiredWidgetSettingsThe widget's appearance. Owner/timestamp fields are absent for anonymous callers — see `PUBLIC_FIELDS` in `api/v1/utils/widgets_helper.py`.
↳ headingstring | null
↳ sub_headingstring | null
↳ greet_messagestring | null
↳ colorstring | null
↳ show_sourcesboolean | null
↳ widget_iconstring | null
↳ widget_avatarstring | null
↳ user_idstring | nullOwner; omitted for public callers
↳ created_atstring | nullOmitted for public callers
↳ updated_atstring | nullOmitted for public callers

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/widget/settings",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Response shape (200)

JSON
{
  "widget_settings": {}
}

Save Widget Settings

POST/v1/agents/{agent_id}/widget/settings

Create or update the agent's widget settings

Multipart. Every field is optional and only what is sent is written, so saving one field leaves the rest untouched. An uploaded file takes precedence over the matching _url.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID

Request body · multipart/form-data (optional)

NameTypeDescription
headingstring | null
sub_headingstring | null
greet_messagestring | null
colorstring | null
show_sourcesboolean | null
widget_iconstring | null
widget_avatarstring | null
widget_icon_urlstring | null
widget_avatar_urlstring | null

Response · 200

NameTypeDescription
messagerequiredstring
widget_settingsrequiredWidgetSettingsThe widget's appearance. Owner/timestamp fields are absent for anonymous callers — see `PUBLIC_FIELDS` in `api/v1/utils/widgets_helper.py`.
↳ headingstring | null
↳ sub_headingstring | null
↳ greet_messagestring | null
↳ colorstring | null
↳ show_sourcesboolean | null
↳ widget_iconstring | null
↳ widget_avatarstring | null
↳ user_idstring | nullOwner; omitted for public callers
↳ created_atstring | nullOmitted for public callers
↳ updated_atstring | nullOmitted for public callers

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/widget/settings",
    headers={"X-API-Key": API_KEY},
    data={"heading": "<heading>", "sub_heading": "<sub_heading>", "greet_message": "<greet_message>", "color": "<color>", "show_sources": "<show_sources>", "widget_icon": "<widget_icon>", "widget_avatar": "<widget_avatar>", "widget_icon_url": "<widget_icon_url>", "widget_avatar_url": "<widget_avatar_url>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Response shape (200)

JSON
{
  "message": "<message>",
  "widget_settings": {}
}

Remove Widget Settings

DELETE/v1/agents/{agent_id}/widget/settings

Delete the agent's widget settings

Soft delete: the row is kept with deleted_at/deleted_by so the change stays auditable, and the agent falls back to the default appearance.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/widget/settings",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())