Skip to main content

Widgets

Widgets expose embeddable call entry points for your assistants.

Authentication & scope

  • Header: X-API-Key: YOUR_API_KEY
  • Read operations: widgets:read
  • Write operations: widgets:write
  • Use API Reference for interactive Try-it on each widget endpoint.

POST /v1/widgets

Create a widget:
curl -X POST "https://api.indigenius.ai/v1/widgets" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://api.indigenius.ai/v1/widgets', {
  method: 'POST',
  headers: { 'X-API-Key': process.env.INDIGENIUS_API_KEY },
});
console.log(await response.json());
import requests
response = requests.post(
    "https://api.indigenius.ai/v1/widgets",
    headers={"X-API-Key": "YOUR_API_KEY"},
    timeout=30,
)
print(response.status_code)
print(response.json())
Common status codes: 201, 403, 500.

PATCH /v1/widgets/{id}

Updates a widget. Body is DTO-accurate to UpdateWidgetDTO.
curl -X PATCH "https://api.indigenius.ai/v1/widgets/WIDGET_ID" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "665e4a34c65bb95f2f2d72e2",
    "background_color": "#FFFFFF",
    "text_color": "#111827",
    "button_color": "#0EA5E9",
    "button_text_color": "#FFFFFF",
    "border_color": "#E5E7EB",
    "focus_outline_color": "#38BDF8",
    "card_radius": 12,
    "button_radius": 8,
    "start_call_button": "Start call",
    "end_call_button": "End call",
    "call_to_action": "Talk to Sales",
    "terms_and_condition": true,
    "terms_and_condition_content": "By continuing, you agree to recording terms.",
    "allowed_origins": ["https://app.example.com"]
  }'
const widgetId = 'WIDGET_ID';
const response = await fetch(
  `https://api.indigenius.ai/v1/widgets/${widgetId}`,
  {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.INDIGENIUS_API_KEY,
    },
    body: JSON.stringify({
      assistantId: '665e4a34c65bb95f2f2d72e2',
      background_color: '#FFFFFF',
      text_color: '#111827',
      button_color: '#0EA5E9',
      button_text_color: '#FFFFFF',
      border_color: '#E5E7EB',
      focus_outline_color: '#38BDF8',
      card_radius: 12,
      button_radius: 8,
      start_call_button: 'Start call',
      end_call_button: 'End call',
      call_to_action: 'Talk to Sales',
      terms_and_condition: true,
      terms_and_condition_content:
        'By continuing, you agree to recording terms.',
      allowed_origins: ['https://app.example.com'],
    }),
  },
);
console.log(await response.json());
import requests
widget_id = "WIDGET_ID"
payload = {
    "assistantId": "665e4a34c65bb95f2f2d72e2",
    "background_color": "#FFFFFF",
    "text_color": "#111827",
    "button_color": "#0EA5E9",
    "button_text_color": "#FFFFFF",
    "border_color": "#E5E7EB",
    "focus_outline_color": "#38BDF8",
    "card_radius": 12,
    "button_radius": 8,
    "start_call_button": "Start call",
    "end_call_button": "End call",
    "call_to_action": "Talk to Sales",
    "terms_and_condition": True,
    "terms_and_condition_content": "By continuing, you agree to recording terms.",
    "allowed_origins": ["https://app.example.com"],
}
response = requests.patch(
    f"https://api.indigenius.ai/v1/widgets/{widget_id}",
    headers={"X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json=payload,
    timeout=30,
)
print(response.status_code)
print(response.json())
Common status codes: 200, 400, 403, 404, 500.

POST /v1/widgets/create-call

Creates a widget call session. Body is DTO-accurate to CreateConnectionDTO.
curl -X POST "https://api.indigenius.ai/v1/widgets/create-call" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "widget_id": "665e4a34c65bb95f2f2d72e1"
  }'
const response = await fetch(
  'https://api.indigenius.ai/v1/widgets/create-call',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.INDIGENIUS_API_KEY,
    },
    body: JSON.stringify({ widget_id: '665e4a34c65bb95f2f2d72e1' }),
  },
);
console.log(await response.json());
import requests
response = requests.post(
    "https://api.indigenius.ai/v1/widgets/create-call",
    headers={"X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={"widget_id": "665e4a34c65bb95f2f2d72e1"},
    timeout=30,
)
print(response.status_code)
print(response.json())
Example response:
{
  "status": true,
  "message": "Call created",
  "call_id": "665e4a34c65bb95f2f2d72e9",
  "assistant_id": "665e4a34c65bb95f2f2d72e2",
  "gateway": {
    "transport": "websocket",
    "path": "/new-web-call/connection",
    "url": "wss://api.indigenius.ai/new-web-call/connection?assistant_id=665e4a34c65bb95f2f2d72e2&call_id=665e4a34c65bb95f2f2d72e9"
  }
}

Widget call handshake

POST /v1/widgets/create-call returns:
  • call_id
  • assistant_id
  • gateway.url and gateway.path
Use these values to connect your client websocket to /new-web-call/connection. Common status codes: 201, 400, 403, 404, 500.

Other widget endpoints

  • GET /v1/widgets
  • GET /v1/widgets/{id}
  • DELETE /v1/widgets/{id}
Test these directly in API Reference with Try-it and the same X-API-Key.