Integrate Agent
Embed, call, or drive your agent from your own applications.
If you want people to use this agent outside the platform — in your own app, product, or website — set it up here. Pick Agent API to call it from your backend, or Embedded Chat to drop a ready-made chat widget into your site. Find it under Agent Config → Integrate Agent, under Credentials & access; it opens as a side panel with two tabs, Embedded Chat and Agent API.

<BASE_URL> in every sample on this page is a placeholder for the Qore API host your organization uses. Confirm your production host with your Uptiq contact or your platform administrator before you ship — it differs by deployment, and a sample host will not work against your environment. (The panel's own "Download as MD" export shows a real host for your environment — copy the sample from there once you've confirmed it's the right one for where you're shipping.)
Choosing an integration
Start by matching the tab to where your agent runs and how much of the interface you want to own.
Drop a chat onto a web page with no UI to build
Embedded Chat
Browser (prebuilt UI)
Call the agent from a backend, service, or scheduled job
Agent API — Client: raw (HTTP)
Server-to-server (no browser)
Build your own custom chat UI in the browser
Agent API — Client: TypeScript SDK
Browser (your UI)
Shared prerequisites. Both tabs connect using credentials and domain rules configured on the agent:
Widget Key
Agent Config → Access & Security
Embedded Chat, TypeScript SDK client (and optionally the API)
API Key + Secret
Agent Config → Access & Security
Agent API, raw HTTP client (server-to-server)
Whitelisted domain
Agent Config → Access & Security
Embedded Chat, TypeScript SDK client — add the full URL or hostname, no trailing spaces
To obtain a Widget Key: open your agent's Access & Security page, then generate and copy the key — the same Widget key step the Embedded Chat wizard walks you through below. To whitelist a domain: on the same page, add and save your domain under Allowed Domains.
Set up Access & Security first. It holds both the Access Keys and the Allowed Domains list.
Wherever you supply a user object, it must represent a trusted, authenticated identity from your own auth system — the user currently logged into your application and verified by your auth system. Never populate it from query parameters or untrusted input, which can be manipulated.
Embedded Chat
Embedded Chat is the quickest path — a prebuilt chat UI you drop onto a page, with no interface to build yourself. The panel walks you through it as three steps.
Step 1 — Widget key
Choose Use existing key to reuse a key already issued for this agent, or Generate new key. A public key lets the widget talk to this agent from the browser — safe to ship in client code. Select Generate key, then Continue.
Step 2 — Whitelist domains
Only these origins may load the widget; requests from anywhere else are rejected. Add each domain your widget will run on (for example app.yourdomain.com), then Continue. The domains go on the same Allowed Domains list as Access & Security.
Step 3 — Install widget
Install the React SDK and mount the widget in your app:
That's enough to get a working chat widget live. The rest of this section is reference material for going further: the framework-agnostic HTML web component, the Full Screen layout, theming, and the headless JS SDK for a fully custom UI.
Reference: widget variants
The Embed Agent widget is a drop-in chat interface backed by @uptiqai/widgets-sdk. Beyond the React ChatWidget shown above, it also comes as a framework-agnostic HTML web component, and each offers a compact Chat Widget (floating popover) or an immersive Full Screen layout with sidebar navigation. The widget handles conversation state, history, and messaging for you.
Install
Import the stylesheet once in your application entry point:
Chat Widget vs. Full Screen — both share the same config, user, theme, instanceId, and ref API. Full Screen adds a hideTrigger / hide-trigger option to hide the default launcher and open via your own button. Expand the variant you need:
Props / attributes reference
React uses props (objects); the HTML web component uses attributes (JSON-stringified objects, kebab-case names). Otherwise they map 1:1.
config
config
Yes
WidgetConfig
Backend/agent config — see below.
user
user
Yes
WidgetUser
Authenticated user — see below.
instanceId
instance-id
No
string
Unique ID when rendering multiple widgets on one page. Default: auto-generated.
theme
theme
No
WidgetTheme
Palette overrides — see Theme customization.
defaultExecutionId
default-execution-id
No
string
Start with a specific conversation/execution loaded (continue a previous chat).
onExecutionChange
—
No
(executionId?) => void
Fires when the current conversation changes.
defaultOpen
default-open
No
boolean
Open on mount. Default false.
hideTrigger
hide-trigger
No
boolean
(Full Screen) Hide the default launcher; open via your own button + ref. Default false.
onClose
—
No
() => void
Fires when the user closes the widget.
widgetRef
—
No
React.Ref<…Ref>
Programmatic open() / close() control.
authToken
auth-token
No
string
The signed-in user's identity token, for an agent with Authentication on. Sent with every message, held in memory only.
allowDeveloperMode
allow-developer-mode
No
boolean
Available on request. Shows a Developer Mode switch in the sidebar, which reveals Setup Identity Token. Default false.
config (required) — WidgetConfig:
user (required) — WidgetUser:
Security: populate user from your authenticated session — e.g. const currentUser = useAuth(); — never from query params, form input, or other untrusted sources.
Theme customization
Pass a theme (React object / HTML JSON string) to match your design system:
Examples
Features
Chat interface (floating popover or full-screen) with responsive design
Conversation sidebar for managing multiple chats
New chat creation for starting fresh conversations
Message history persistence across sessions
Real-time messaging with the AI agent
Agent avatar display in the trigger button
Customizable theming to match your brand
TypeScript support with full type definitions
Browser support
All modern browsers: Chrome/Edge (latest), Firefox (latest), Safari (latest), and mobile browsers (iOS Safari, Chrome Mobile).
Troubleshooting
Widget not appearing — ensure you imported the CSS (
import '@uptiqai/widgets-sdk/dist/style.css';), that both required props (configanduser) are provided, and that your Widget Key is correct and active."Unauthorized" errors — confirm your application's domain is whitelisted exactly (full URL with protocol or hostname only, no trailing spaces).
Agent API
When you'd rather drive the agent from your own code than a prebuilt UI, use the Agent API tab. It generates one code sample from three selectors:
Client
raw (HTTP), TypeScript SDK, Python SDK
Python SDK is Coming soon.
Mode
Sync, Async, Realtime
This page documents Sync and Async in full. Realtime appears as a selector on screen; its request/response shape isn't documented yet — check back or ask your Uptiq contact before building against it.
Dialect
Native, OpenAI
Native is Qore's own request/response shape, documented below. OpenAI exposes an OpenAI-compatible surface (chat completions-style requests); it isn't documented on this page yet — the selector is live, the reference isn't.
The credentials panel above the generated sample reads: "Every request needs both the API key below (sent as the x-api-key header, always visible here) and its matching API secret (sent as x-api-key-secret, shown only once when generated). Keep both server-side — never expose them in the browser." Generate the key pair from the panel, or from Access & Security.

Generate new secret key creates a new API key and secret, and shows the secret once. Copy it straight away. It adds a key and doesn't deactivate any existing one; deactivate keys you no longer use on Access & Security.
If the agent already has an API key, the panel shows it. Its secret can't be shown again, so if you didn't save it, generate a new pair.
Download as MD
Copy copies the generated sample. Download as MD opens a preview of the exact Markdown file you'll download: the agent's name, executor version and base URL, the credentials guidance, and the sample for the Client, Mode and Dialect you chose. Embedded Chat has the same button on its Install widget step.
On the Agent API tab, the dialog has an Include secrets option. Tick it to write the agent's API key and its secret into the file, so the file works as-is. It needs an API key to exist.

A file downloaded with Include secrets is a credential. Anyone who has it can call the agent. Keep it out of shared drives, tickets and repositories, and deactivate the key on Access & Security if the file leaks.
The rest of this section documents the Native dialect for the raw (HTTP) client — Sync and Async modes — plus the TypeScript SDK client. Both run server-to-server or in the browser respectively; pick based on where your integration runs:
Native dialect, raw HTTP client
The Headless Agent Trigger API invokes an agent over HTTP — no UI or browser. Use it for backend services, scheduled jobs, or any workflow that starts the agent from your own systems.
Base URL:
<BASE_URL>· Format: JSON
Authentication
Every request must include exactly one of the following header sets.
Trigger an agent
Starts a new agent execution or resumes a paused one.
Path parameters
agentId
string
Yes
The unique identifier of the agent to run.
Request body — provide either message or resumeData; all other fields are optional.
message
string
The instruction sent to the agent. Required for new executions.
payload
object
Structured data sent alongside message for programmatic inputs.
documents
array
File attachments. See Document handling.
executionId
string
Specific execution ID. Auto-generated if omitted.
executionMode
string
async (default) or sync. Use sync only when you need an immediate response.
responseFormat
string
Markdown (default) or Json.
webhooks
array
Webhook URLs to receive execution updates. See Webhooks.
token
string
The caller's identity token, for an agent with Authentication on. Optional: a run without it still proceeds, with no authenticated caller.
Success response: { "executionId": "exec_123" }
That is an acknowledgement, not an answer — executions default to async. Poll the execution or receive a webhook to turn an executionId into a result.
Document handling
Attaching documents is a two-step process: upload the file, then reference it in the trigger request.
Passing variables and a business ID
Two more fields on the trigger request, alongside message and documents:
uid
string
The calling user's ID in your system — the same identity concept as the widget's user.uid.
variables
object
Key/value pairs the agent's instructions can reference. Every key must already be declared in the agent's Agent Variables section under Agent Config — an undeclared key is rejected.
businessId
string
Attributes this run to a business or tenant of your own. Accepted on every trigger request.
Checking and managing a running execution
Once an execution is triggered, four more endpoints let you check on it or stop it — all under the same :agentId path used to trigger it.
Listing and inspecting conversations
Webhooks
Register webhooks in the trigger request to receive real-time updates when an execution completes or needs input:
Your endpoint receives:
Common examples
Error responses
400
Invalid request
{ "error": "Message or resume data is required" }
401
Bad credentials
{ "error": "Invalid or missing agent API key" }
403
Forbidden
{ "message": "You're not authorized to perform this action." }
500
Server error
{ "message": "Something went wrong. Please try again later." }
TypeScript SDK client
Select TypeScript SDK as the Client to drive the agent from your own code instead of raw HTTP. The Headless Agent JS SDK lets you build a custom chat interface while it handles the socket connection, real-time agent events, and file uploads automatically. Runs in the browser (React, Vue, or vanilla JS). Entry point: createHeadlessAgentInstance(params), which returns an instance with emit(), on(), and cleanup() methods.
Install & import
Authentication uses the Widget Key; your application's domain must be whitelisted (see Shared prerequisites above).
Create an instance
config
WidgetConfig
Yes
serverUrl, agentId, widgetKey, optional agentExecutorVersion.
user
WidgetUser
Yes
uid, firstName, email (required); lastName (optional).
instanceId
string
Yes
Unique identifier used for socket scoping.
Instance API
emit
(event: 'query', payload: QueryPayload) => void
Send a query to the agent, optionally with file attachments.
on
(event: 'agent-interrupt', handler) => () => void
Subscribe to agent events. Returns an unsubscribe function.
cleanup
() => void
Remove listeners and disconnect the socket (call on unmount).
setAuthToken
(token?: string) => void
Replace the identity token sent with every later message, for example after your app refreshes it.
React integration example
Best practices
Single instance — create one instance per chat context and reuse it for the whole conversation.
Subscribe before sending — attach your
on('agent-interrupt', …)handler before the firstemitso no responses are missed.Handle multiple subtypes — capture
final,question, andfinal_stream, not justfinal.Always clean up — call
cleanup()on unmount to prevent memory leaks.Persist
executionId— store and pass it to continue a conversation across page reloads.Let the SDK handle uploads — pass
Fileobjects; presigned-URL upload is automatic.
How this relates to the agent's other settings
Whichever integration you choose, a few other settings shape how it behaves:
Access & Security — the Access Keys are the credentials your Embedded Chat widget, TypeScript SDK client, or Agent API integration uses; the Allowed Domains list governs where the widget and TypeScript SDK client can run.
Secrets & Variables — the credentials and values the agent uses at runtime; the widget, SDK, and API all invoke the agent against these same configured secrets.
Tighten these before you publish embeds or share API credentials — once a widget is live on a page, every visitor reaches the agent through whatever auth and domain rules you have set.
Maintained by Abhishek Paul
AI-assisted, human-approved

Last updated
Was this helpful?

