AgentStack Docs
AgentStack Docs
AgentStack documentation
Get started
Build your agent
Actions
Analytics
Channels
Help Desk
Help Center
Developers
Embed the widgetControl the widgetListen for widget eventsBrowser integration boundariesClient-side formsREST API authenticationPagination and errorsRate limitsREST API: agent sign-upREST API: agentsREST API: sources and ingestionREST API: actionsREST API: channelsREST API: analytics and activityREST API: topicsREST API: contactsREST API: conversations and notesREST API: inbox and teamsREST API: chatREST API: roles and membersREST API: organizationREST API: API keysREST API: audit logsREST API: billingREST API: custom domainsREST API: domainsREST API: Help CenterREST API: Help PageREST API: Notion connectionREST API: voice callsIdentity verificationWebhooksMCP serverMCP scopesMCP toolsMCP clientsllms.txt
Workspace
    Developers

    Browser integration boundaries

    Keep browser input, supported widget forms, and privileged server actions separate.

    Use browser input to collect a visitor's intent. Send that intent to a backend that you control. Validate the input on the server, and authenticate the caller when needed. Call the AgentStack REST API with a server-held API key. This method keeps a clean boundary between an untrusted browser and privileged organization operations. For an AI-invoked widget form, use the supported Client-side forms contract instead of an improvised browser callback.

    Design each backend action as a small, recoverable workflow. Give the visitor a pending state. If validation fails, show a useful error. Make retries safe where possible. A submission must not rely on a chat transcript being present. It must not assume that the widget can authorize administrative work. If an integration needs to create a contact, send a message, or update agent data, make the operation explicit in the backend. Use the documented REST response envelope.

    Keep consent and privacy clear. Send only the fields that the requested outcome needs. Describe what happens after submission. In the Chat Widget embed, the widget runs a handler registered with window.agentstack.registerTools(...) and shows the visitor that the action completed or the error it returned. The handler has 5 seconds to respond. Its result is not sent back to the agent, so do not build a flow that needs the agent to read it. For a verified contact flow, use the dedicated identity-verification endpoints instead of a browser-only proof mechanism.

    Listen for widget events

    Measure and coordinate the embedded chat experience without scraping it.

    Client-side forms

    Register supported widget forms and handle verified webhook delivery.