# Subcontext for developers > How to add Subcontext's AI agents, quote forms, lead forms and other embeds to a website, and connect a firm's own systems to the Subcontext API with OAuth access tokens. The partner API is described by an OpenAPI 3.1 document: https://subcontext.com/developers/api/openapi.yaml (also as JSON: https://subcontext.com/developers/api/openapi.json). Questions: hello@subcontext.com. ## Getting started - [Getting started](https://subcontext.com/developers/getting-started): What you can build with Subcontext, what you need before you start, and where to go next. - [Keys and tokens](https://subcontext.com/developers/getting-started/keys-and-tokens): The public keys the website embeds use, and the OAuth access tokens your servers use for the API. - [Environments and support](https://subcontext.com/developers/getting-started/environments-and-support): The addresses Subcontext uses, how to test safely, and how to get help. ## Website embeds - [Website embeds](https://subcontext.com/developers/embeds): Guides and example pages for adding a chat with your AI agent, a quote form, an enquiry form and more to your website. - [Theming the embeds](https://subcontext.com/developers/embeds/theming): One theme object for the webchat, quote form, form guide, lead form and Nurture, what each embed does with it, dark mode and fonts. - [Ad clicks across pages](https://subcontext.com/developers/embeds/ad-clicks): How the embeds keep an ad click from the page a visitor lands on, read your ad tags' cookies, and when they may store anything. - [Webchat](https://subcontext.com/developers/embeds/webchat): Put your firm's Subcontext AI agent on your website as a chat window, in the corner of the page or inside your own layout. - [Webchat: Install the webchat](https://subcontext.com/developers/embeds/webchat/install): Add the chat to your pages with the paste-in snippet, or start it from your own JavaScript. - [Webchat: Webchat options](https://subcontext.com/developers/embeds/webchat/options): Every option for the look, wording and behaviour of the chat, as JavaScript options and data attributes, and the text you can re-word. - [Webchat: JavaScript API and events](https://subcontext.com/developers/embeds/webchat/api): Control the chat from your page, listen for its events, and pass in what your page knows about the visitor. - [Webchat: Security and troubleshooting](https://subcontext.com/developers/embeds/webchat/troubleshooting): What's public and what's checked, the content security policy to allow, fixes for common problems, and working with other Subcontext embeds. - [Webchat: Webchat examples](https://subcontext.com/developers/embeds/webchat/examples): Complete example pages for the webchat, from the minimal snippet to branding, context, embedded mode, events and handoff. - [Quote form](https://subcontext.com/developers/embeds/quoteform): Put a full insurance quote on your own website, where visitors answer the questions, see a price and can buy, without leaving your site. - [Quote form: Install the quote form](https://subcontext.com/developers/embeds/quoteform/install): Add the quote form with the paste-in snippet, start it from your own code, or give it tokens from your own server. - [Quote form: Quote form options](https://subcontext.com/developers/embeds/quoteform/options): Every option of Subcontext.Quote.init(), from starting values and the look to callbacks and the form's wording. - [Quote form: JavaScript API and events](https://subcontext.com/developers/embeds/quoteform/api): The quote form's methods, its callbacks, prefill, provenance and consent, and how it works with the webchat and form guide. - [Quote form: Security and troubleshooting](https://subcontext.com/developers/embeds/quoteform/troubleshooting): What is public and what is secret, the content security policy to allow, and how to fix the quote form's errors. - [Quote form: Quote form examples](https://subcontext.com/developers/embeds/quoteform/examples): Complete example pages to copy, from the paste-in snippet to a quote form backed by your own token server. - [Lead form](https://subcontext.com/developers/embeds/leadform): Put a Subcontext lead form on your website, or send leads to a campaign from a form you already have. - [Lead form: Install the lead form](https://subcontext.com/developers/embeds/leadform/install): Paste in the drawn form, change it for one page or set it up from JavaScript, or send leads from your own form. - [Lead form: Options and styling](https://subcontext.com/developers/embeds/leadform/options): Every setting for the script tag, the form element and init(), your own wording and error messages, and how to style the form. - [Lead form: JavaScript API and events](https://subcontext.com/developers/embeds/leadform/api): The lead form's JavaScript calls, form handle, results, events and callbacks, what a lead can carry, and the chat after the form. - [Lead form: Provenance, values and consent](https://subcontext.com/developers/embeds/leadform/provenance-and-consent): Where the visitor came from, prefilled and hidden values, and how consent answers are asked for and recorded. - [Lead form: Security and troubleshooting](https://subcontext.com/developers/embeds/leadform/troubleshooting): What is public and what is checked, content security policy, limits, and every error code with what to do. - [Lead form: Example pages](https://subcontext.com/developers/embeds/leadform/examples): Six complete pages to copy, from the paste-in snippet to sending leads from your own code. - [Form guide](https://subcontext.com/developers/embeds/formguide): Put your AI agent beside the questions on any web form, to explain each question and, if you like, fill in the answer. - [Form guide: Install the form guide](https://subcontext.com/developers/embeds/formguide/install): Add the form guide with the paste-in snippet, with attach() in JavaScript, or inside a Subcontext quote form. - [Form guide: Form guide options](https://subcontext.com/developers/embeds/formguide/options): The snippet's attributes and attach() options, panel styles, icons, theme and wording. - [Form guide: How it finds your fields](https://subcontext.com/developers/embeds/formguide/fields): Which fields get a help icon, how the guide finds their labels and help text, and how to choose which fields get help. - [Form guide: Filling in fields, methods and events](https://subcontext.com/developers/embeds/formguide/api): Let the agent fill in fields, control the guide from your own code, and listen for its events. - [Form guide: Privacy and troubleshooting](https://subcontext.com/developers/embeds/formguide/troubleshooting): What the form guide sends and stores, privacy and security, the content security policy to allow, and how to fix problems. - [Form guide: Form guide examples](https://subcontext.com/developers/embeds/formguide/examples): Complete example pages to copy, from the simplest install to letting the agent fill in fields. - [Nurture](https://subcontext.com/developers/embeds/nurture): A "Nurture with AI" button for the client record page of your adviser portal or CRM, so advisers can follow up after a call. - [Nurture: Install the widget](https://subcontext.com/developers/embeds/nurture/install): Add the widget with the paste-in snippet or start it from JavaScript, and what the client and adviser details you pass are used for. - [Nurture: Options](https://subcontext.com/developers/embeds/nurture/options): Every setting for the script tag and init(), merge fields, and how to change any of the widget's wording. - [Nurture: JavaScript API and events](https://subcontext.com/developers/embeds/nurture/api): The SubcontextNurture methods, switching client without a reload, and the events and callbacks your page can listen for. - [Nurture: Signed identity](https://subcontext.com/developers/embeds/nurture/signed-identity): Create the signed identity pass on your server that proves which firm and adviser a page is for. - [Nurture: Security and troubleshooting](https://subcontext.com/developers/embeds/nurture/troubleshooting): Privacy and security, rate limits, content security policy, and what each message and error code means. - [Nurture: Example pages](https://subcontext.com/developers/embeds/nurture/examples): Six working pages to copy, from the paste-in snippet to switching client and signed identity. - [WebMCP](https://subcontext.com/developers/embeds/webmcp): Let AI assistants in your visitors' browsers use your Subcontext tools for products, questions, callbacks and leads. - [WebMCP: Install WebMCP](https://subcontext.com/developers/embeds/webmcp/install): Add the WebMCP script to your pages with the paste-in snippet or from your own JavaScript, and its options. - [WebMCP: Starting and stopping from JavaScript](https://subcontext.com/developers/embeds/webmcp/api): The SubcontextWebMCP object, the result of init, and the console messages the script writes. - [WebMCP: The tools](https://subcontext.com/developers/embeds/webmcp/tools): The tools an integration can offer, their inputs and results, what they save, and what is public and what is protected. - [WebMCP: Troubleshooting WebMCP](https://subcontext.com/developers/embeds/webmcp/troubleshooting): The content security policy to allow, what each console message and error means, and how to fix it. - [WebMCP: WebMCP examples](https://subcontext.com/developers/embeds/webmcp/examples): Complete example pages for WebMCP, from the minimal snippet to a setup checker and a visitor's journey through your tools. ## Access tokens (OAuth) - [Access tokens (OAuth)](https://subcontext.com/developers/oauth): Get a short-lived access token for your API application and use it from your server or your web pages: sending leads, reading products, the quote form. - [Create your API applications](https://subcontext.com/developers/oauth/applications): Create the API applications your code signs in with, choose their scopes and allowed origins, and decide which are server-only and which are for the browser. - [Get a token](https://subcontext.com/developers/oauth/tokens): Ask Subcontext for an access token with your application's client id and secret, and keep reusing it until shortly before it runs out. - [Send leads from your server](https://subcontext.com/developers/oauth/from-your-server): Use a server-only application's token with the leads API to send leads from your own systems and check what became of them. - [Use a token in the browser](https://subcontext.com/developers/oauth/in-the-browser): Hand a browser application's token to the quote form or your own page scripts through a small token endpoint on your server, without ever showing the client secret. - [Errors, limits and security](https://subcontext.com/developers/oauth/reference): What the API offers, a security checklist, every error a token request or API call can give and how to fix it, and the limits. - [The example files](https://subcontext.com/developers/oauth/examples): Complete examples in curl, Node, Python, PHP and C# for getting a token, sending a lead and running a token endpoint, plus two pages to try in a browser. ## REST API - [REST API](https://subcontext.com/developers/api): Quote and sell your products, send leads, read what became of them and report outcomes with the Subcontext API. - [Quote and sell through the API](https://subcontext.com/developers/api/quote-and-sell): Ask a product's questions, quote the customer, take their Direct Debit and first payment, and set up the policy, step by step. - [Send leads and read what happened to them](https://subcontext.com/developers/api/leads): Send leads from your own systems, check each one was taken in, and keep up with where your leads are and what has happened to them. - [Report outcomes](https://subcontext.com/developers/api/outcomes): Tell Subcontext what became of each lead after it left (quoted, sold, cancelled, commission paid) so your reports show what each campaign earns. - [Loyalty partners](https://subcontext.com/developers/api/loyalty): For a loyalty programme that runs alongside a firm's policies, confirm each member's enrolment, change their status, and send the points and tiers they earn. - [Outreach streams](https://subcontext.com/developers/api/outreach): Follow an outreach stream's progress from your own systems, and get people into one by sending them as leads. - [Use the API console](https://subcontext.com/developers/api/console): Try any API request from your browser with your own API application, check it against the docs and copy it as code. - [API reference](https://subcontext.com/developers/api/reference): Every request the Subcontext API answers, from its OpenAPI document. - [API reference: Products](https://subcontext.com/developers/api/reference/products): Your organisation's products, as they're sold right now: the terms customers see (cooling-off period, what's included and excluded) and the limits on the cover you can quote for (amounts, ages and terms). - [API reference: Journeys](https://subcontext.com/developers/api/reference/journeys): A product's journeys: the sets of questions a customer answers to be quoted for it, such as a short "express" journey and a full one. - [API reference: Quotes and applications](https://subcontext.com/developers/api/reference/quotes-and-applications): An application is one customer's request for cover: their answers, their details and the cover they want. A quote prices it. - [API reference: Checkout](https://subcontext.com/developers/api/reference/checkout): Turning an accepted quote into a policy: what the customer must see before they buy, their Direct Debit details, the first premium by card (through Stripe), and setting up the policy. - [API reference: Lookups](https://subcontext.com/developers/api/reference/lookups): Help for your own forms: check a phone number as the customer types it, and find the addresses at a UK postcode. Browser and server-only applications can both call these. - [API reference: CRM: leads](https://subcontext.com/developers/api/reference/crm-leads): Send leads in from your own systems or a partner's, and read what became of them: where each lead is now, and a feed of what has happened to them. - [API reference: CRM: outcomes](https://subcontext.com/developers/api/reference/crm-outcomes): Report what became of a lead after it left Subcontext: quoted, sold, cancelled, commission paid. Outcomes feed your organisation's reports on what each campaign and source earns. - [API reference: Loyalty](https://subcontext.com/developers/api/reference/loyalty): For a loyalty programme partner: read a membership, confirm a policyholder's enrolment, suspend or cancel it, and send the points and tiers they earn. - [API reference: Outreach](https://subcontext.com/developers/api/reference/outreach): Follow an outreach stream's progress: how many people it has reached, on which channels, and how many replied, booked or bought. ## AI assistants - [AI assistants](https://subcontext.com/developers/ai-assistants): Connect AI assistants such as Claude and ChatGPT to Subcontext, with MCP, assistant apps and A2A. - [Connect an AI assistant (MCP)](https://subcontext.com/developers/ai-assistants/mcp): Work in Subcontext from Claude, ChatGPT, Codex, Claude Code or any assistant that supports MCP, signed in as yourself. - [Your agent in ChatGPT and Claude](https://subcontext.com/developers/ai-assistants/assistant-apps): Publish an assistant app so people can get quotes, register interest and book a callback with your firm from inside ChatGPT or Claude. - [A2A agent card](https://subcontext.com/developers/ai-assistants/a2a): Publish an agent card so other AI agents can find your agent and ask it questions directly, server to server. - [WebMCP](https://subcontext.com/developers/ai-assistants/webmcp): Offer your tools to AI assistants in your visitors' browsers with one script tag, and how that fits with the MCP server, assistant apps and A2A. - [MCP tool reference](https://subcontext.com/developers/ai-assistants/mcp-tools): Every tool an AI assistant can use through the Subcontext MCP server, by permission group. - [MCP tool reference: Always available](https://subcontext.com/developers/ai-assistants/mcp-tools/always-available): The 12 MCP tools every connection has, whatever you grant. - [MCP tool reference: Product admin](https://subcontext.com/developers/ai-assistants/mcp-tools/products): The 8 MCP tools in Product admin, granted with the products scope under Product configuration. - [MCP tool reference: Covers](https://subcontext.com/developers/ai-assistants/mcp-tools/covers): The 6 MCP tools in Covers, granted with the covers scope under Product configuration. - [MCP tool reference: Journeys, questions & answers](https://subcontext.com/developers/ai-assistants/mcp-tools/journeys): The 17 MCP tools in Journeys, questions & answers, granted with the journeys scope under Product configuration. - [MCP tool reference: Presentations](https://subcontext.com/developers/ai-assistants/mcp-tools/presentations): The 7 MCP tools in Presentations, granted with the presentations scope under Product configuration. - [MCP tool reference: Customer documents](https://subcontext.com/developers/ai-assistants/mcp-tools/documents): The 8 MCP tools in Customer documents, granted with the documents scope under Product configuration. - [MCP tool reference: Lifecycle events](https://subcontext.com/developers/ai-assistants/mcp-tools/lifecycle): The 9 MCP tools in Lifecycle events, granted with the lifecycle scope under Product configuration. - [MCP tool reference: Releases](https://subcontext.com/developers/ai-assistants/mcp-tools/releases): The 9 MCP tools in Releases, granted with the releases scope under Product configuration. - [MCP tool reference: Mini-sites](https://subcontext.com/developers/ai-assistants/mcp-tools/sites): The 15 MCP tools in Mini-sites, granted with the sites scope under Product configuration. - [MCP tool reference: Sales pipeline](https://subcontext.com/developers/ai-assistants/mcp-tools/pipeline): The 8 MCP tools in Sales pipeline, granted with the pipeline scope under Insurance operations. - [MCP tool reference: Customers](https://subcontext.com/developers/ai-assistants/mcp-tools/customers): The 2 MCP tools in Customers, granted with the customers scope under Insurance operations. - [MCP tool reference: Claims](https://subcontext.com/developers/ai-assistants/mcp-tools/claims): The 13 MCP tools in Claims, granted with the claims scope under Insurance operations. - [MCP tool reference: Policies](https://subcontext.com/developers/ai-assistants/mcp-tools/policies): The 8 MCP tools in Policies, granted with the policies scope under Insurance operations. - [MCP tool reference: Billing](https://subcontext.com/developers/ai-assistants/mcp-tools/billing): The 8 MCP tools in Billing, granted with the billing scope under Insurance operations. - [MCP tool reference: Reinsurance](https://subcontext.com/developers/ai-assistants/mcp-tools/reinsurance): The 9 MCP tools in Reinsurance, granted with the reinsurance scope under Insurance operations. - [MCP tool reference: Loyalty programmes](https://subcontext.com/developers/ai-assistants/mcp-tools/loyalty): The 11 MCP tools in Loyalty programmes, granted with the loyalty scope under Insurance operations. - [MCP tool reference: Agents](https://subcontext.com/developers/ai-assistants/mcp-tools/agents): The 12 MCP tools in Agents, granted with the agents scope under AI agents. - [MCP tool reference: Agent knowledge & library](https://subcontext.com/developers/ai-assistants/mcp-tools/agent-knowledge): The 27 MCP tools in Agent knowledge & library, granted with the agent_knowledge scope under AI agents. - [MCP tool reference: Agent compliance](https://subcontext.com/developers/ai-assistants/mcp-tools/agent-compliance): The 27 MCP tools in Agent compliance, granted with the agent_compliance scope under AI agents. - [MCP tool reference: Compliance checks](https://subcontext.com/developers/ai-assistants/mcp-tools/compliance-checks): The 28 MCP tools in Compliance checks, granted with the compliance_checks scope under AI agents. - [MCP tool reference: Channels](https://subcontext.com/developers/ai-assistants/mcp-tools/channels): The 39 MCP tools in Channels, granted with the channels scope under AI agents. - [MCP tool reference: Integrations (custom HTTP)](https://subcontext.com/developers/ai-assistants/mcp-tools/integrations): The 39 MCP tools in Integrations (custom HTTP), granted with the integrations scope under AI agents. - [MCP tool reference: Agent access (WebMCP, A2A, ChatGPT and Claude apps)](https://subcontext.com/developers/ai-assistants/mcp-tools/agent-access): The 21 MCP tools in Agent access (WebMCP, A2A, ChatGPT and Claude apps), granted with the agent_access scope under AI agents. - [MCP tool reference: Conversations & inbox](https://subcontext.com/developers/ai-assistants/mcp-tools/conversations): The 33 MCP tools in Conversations & inbox, granted with the conversations scope under AI agents. - [MCP tool reference: Bookings](https://subcontext.com/developers/ai-assistants/mcp-tools/bookings): The 7 MCP tools in Bookings, granted with the bookings scope under AI agents. - [MCP tool reference: CRM leads & facts](https://subcontext.com/developers/ai-assistants/mcp-tools/crm): The 61 MCP tools in CRM leads & facts, granted with the crm scope under Customer CRM. - [MCP tool reference: Outcomes & conversion goals](https://subcontext.com/developers/ai-assistants/mcp-tools/outcomes): The 20 MCP tools in Outcomes & conversion goals, granted with the outcomes scope under Customer CRM. - [MCP tool reference: CRM pipeline & vocabulary](https://subcontext.com/developers/ai-assistants/mcp-tools/crm-pipeline): The 38 MCP tools in CRM pipeline & vocabulary, granted with the crm_pipeline scope under Customer CRM. - [MCP tool reference: Outreach streams](https://subcontext.com/developers/ai-assistants/mcp-tools/outreach): The 35 MCP tools in Outreach streams, granted with the outreach scope under Customer CRM. - [MCP tool reference: Support tickets](https://subcontext.com/developers/ai-assistants/mcp-tools/support): The 3 MCP tools in Support tickets, granted with the support scope under Organisation. - [MCP tool reference: Consent](https://subcontext.com/developers/ai-assistants/mcp-tools/consent): The 7 MCP tools in Consent, granted with the consent scope under Organisation. - [MCP tool reference: Organisation](https://subcontext.com/developers/ai-assistants/mcp-tools/organisation): The 23 MCP tools in Organisation, granted with the organisation scope under Organisation. - [MCP tool reference: Usage & spend](https://subcontext.com/developers/ai-assistants/mcp-tools/usage): The 5 MCP tools in Usage & spend, granted with the usage scope under Organisation. - [MCP tool reference: My notifications](https://subcontext.com/developers/ai-assistants/mcp-tools/notifications): The 6 MCP tools in My notifications, granted with the notifications scope under Organisation. - [MCP tool reference: Subcontext plan & credit](https://subcontext.com/developers/ai-assistants/mcp-tools/subscription): The 18 MCP tools in Subcontext plan & credit, granted with the subscription scope under Organisation. ## Integrations - [Integrations](https://subcontext.com/developers/integrations): How Subcontext connects to your firm's own systems, what it sends them, and how to build the receiving end. - [How Subcontext calls your systems](https://subcontext.com/developers/integrations/calling-your-systems): The rules every request from Subcontext to your server follows, from HTTPS and timeouts to status codes, retries and duplicate protection. - [Your API as an agent tool](https://subcontext.com/developers/integrations/agent-tools): Let an agent call your own API during a conversation, exactly what Subcontext sends your endpoint, and what the agent sees of your answer. - [Webhooks Subcontext sends](https://subcontext.com/developers/integrations/webhooks-from-subcontext): Receive each new lead and other lead events as signed JSON, check the signature, and push leads into your CRM's own API. - [Sending events to Subcontext](https://subcontext.com/developers/integrations/webhooks-to-subcontext): Have your CRM or policy system post signed webhooks to Subcontext, to record sales, quotes and commission against leads, or news about policies. - [Built-in integrations](https://subcontext.com/developers/integrations/built-in): Google Calendar, Google Sheets, Google Ads and Meta ads, what each one does, what you grant on your side, and what Subcontext sends. - [Outcomes to ad platforms](https://subcontext.com/developers/integrations/ad-platforms): What Subcontext sends to Google Ads and Meta about the people who clicked your ads, how they're matched, and what to tell your customers. - [Troubleshooting](https://subcontext.com/developers/integrations/troubleshooting): Where to look when an integration call fails, what each error means, and how to fix the common ones. ## Setup - [Setup](https://subcontext.com/developers/setup): Your own domain names, phone numbers and WhatsApp, set up for Subcontext. - [Send email from your own domain](https://subcontext.com/developers/setup/sending-domain): The DNS records that let your agents' emails come from your domain, how verification works, and the common DNS mistakes. - [Receive email into an agent](https://subcontext.com/developers/setup/receiving-email): The agent's own email addresses, forwarding your mailbox to one of them, and what Subcontext keeps from each email. - [Your website on your own domain](https://subcontext.com/developers/setup/website-domain): Serve a Subcontext site at your own address, such as quote.example.com, through your own CDN, with your own certificate. - [Short links on your own domain](https://subcontext.com/developers/setup/short-link-domain): Make the shortened links in your texts and emails use your own short hostname, such as go.example.com. - [Phone numbers for SMS and voice](https://subcontext.com/developers/setup/phone-numbers): Getting numbers for your agents, the business details the regulator needs, what people see when you text or call, and how opt-outs work. - [WhatsApp](https://subcontext.com/developers/setup/whatsapp): Connect your WhatsApp Business account with Facebook, get your templates approved, and understand the 24-hour window and what messages cost. - [Content security policy and firewalls](https://subcontext.com/developers/setup/allowlists): Every host to allow in your website's content security policy, your office network and your mail filter, and how to recognise Subcontext calling your systems. ## Example files - [embeds/one-theme.html](https://subcontext.com/developers/examples/embeds/one-theme.html): One theme object passed to the webchat, a quote form, a form guide and a lead form, so they all share your colours and font. Download: https://subcontext.com/developers/downloads/embeds/one-theme.html - [embeds/webchat/01-minimal.html](https://subcontext.com/developers/examples/embeds/webchat/01-minimal.html): The dashboard's paste-in snippet on its own. Download: https://subcontext.com/developers/downloads/embeds/webchat/01-minimal.html - [embeds/webchat/02-programmatic.html](https://subcontext.com/developers/examples/embeds/webchat/02-programmatic.html): init() with the main options, waiting for cookie consent, and the JavaScript API on buttons. Download: https://subcontext.com/developers/downloads/embeds/webchat/02-programmatic.html - [embeds/webchat/03-branding.html](https://subcontext.com/developers/examples/embeds/webchat/03-branding.html): The theme object, dark mode, fonts, your own wording, the corner and a launcher animation, switched live. Download: https://subcontext.com/developers/downloads/embeds/webchat/03-branding.html - [embeds/webchat/04-context-and-provenance.html](https://subcontext.com/developers/examples/embeds/webchat/04-context-and-provenance.html): Partner details for the agent, setContext() from your own form, and campaign tracking. Download: https://subcontext.com/developers/downloads/embeds/webchat/04-context-and-provenance.html - [embeds/webchat/05-embedded-and-events.html](https://subcontext.com/developers/examples/embeds/webchat/05-embedded-and-events.html): The chat inside your own page layout, your own microphone and question buttons, and every event. Download: https://subcontext.com/developers/downloads/embeds/webchat/05-embedded-and-events.html - [embeds/webchat/06-handoff.html](https://subcontext.com/developers/examples/embeds/webchat/06-handoff.html): Carrying the chat on by text, WhatsApp, email or a phone call, from your own form and from the built-in Switch channel button. Download: https://subcontext.com/developers/downloads/embeds/webchat/06-handoff.html - [embeds/quoteform/01-minimal.html](https://subcontext.com/developers/examples/embeds/quoteform/01-minimal.html): The paste-in snippet the dashboard gives you: a placeholder and the script. Download: https://subcontext.com/developers/downloads/embeds/quoteform/01-minimal.html - [embeds/quoteform/02-programmatic.html](https://subcontext.com/developers/examples/embeds/quoteform/02-programmatic.html): Subcontext.Quote.init() with the main options, and the disable, enable, restartApplication and destroy methods. Download: https://subcontext.com/developers/downloads/embeds/quoteform/02-programmatic.html - [embeds/quoteform/03-theming.html](https://subcontext.com/developers/examples/embeds/quoteform/03-theming.html): Matching your website with theme, displayFont, a labelled stepper (steps), showHeader and reworded buttons (strings). Download: https://subcontext.com/developers/downloads/embeds/quoteform/03-theming.html - [embeds/quoteform/04-prefill-and-provenance.html](https://subcontext.com/developers/examples/embeds/quoteform/04-prefill-and-provenance.html): Details you already know with initialCustomer and initialValues (cover from the address), starting afresh with fresh, and UTM links. Download: https://subcontext.com/developers/downloads/embeds/quoteform/04-prefill-and-provenance.html - [embeds/quoteform/05-events.html](https://subcontext.com/developers/examples/embeds/quoteform/05-events.html): Every callback written to a log, the form starting switched off (enabled: false), and the subcontext:application-ready event. Download: https://subcontext.com/developers/downloads/embeds/quoteform/05-events.html - [embeds/quoteform/06-own-token-server.html](https://subcontext.com/developers/examples/embeds/quoteform/06-own-token-server.html): getToken backed by your own token server (token-server.mjs) and an API application instead of a key. Download: https://subcontext.com/developers/downloads/embeds/quoteform/06-own-token-server.html - [embeds/quoteform/07-with-webchat.html](https://subcontext.com/developers/examples/embeds/quoteform/07-with-webchat.html): The quote form with the webchat beside it, sharing one application and one theme, with a log of what each one does. Download: https://subcontext.com/developers/downloads/embeds/quoteform/07-with-webchat.html - [embeds/quoteform/token-server.mjs](https://subcontext.com/developers/examples/embeds/quoteform/token-server.mjs): A small Node token server that swaps an API application's client id and secret for a short-lived token for your page. Download: https://subcontext.com/developers/downloads/embeds/quoteform/token-server.mjs - [embeds/leadform/01-minimal.html](https://subcontext.com/developers/examples/embeds/leadform/01-minimal.html): Minimal install: the paste-in snippet, showing the form you designed in Subcontext. Download: https://subcontext.com/developers/downloads/embeds/leadform/01-minimal.html - [embeds/leadform/02-programmatic.html](https://subcontext.com/developers/examples/embeds/leadform/02-programmatic.html): Set up from JavaScript, with init() and your own fields, wording, messages and callbacks, and a log of every event. Download: https://subcontext.com/developers/downloads/embeds/leadform/02-programmatic.html - [embeds/leadform/03-theming.html](https://subcontext.com/developers/examples/embeds/leadform/03-theming.html): Styling with theme settings on the element, CSS custom properties on a dark section, and your own CSS on the form's classes. Download: https://subcontext.com/developers/downloads/embeds/leadform/03-theming.html - [embeds/leadform/04-provenance-and-values.html](https://subcontext.com/developers/examples/embeds/leadform/04-provenance-and-values.html): Campaign tags, ad click ids, prefilled and hidden values, and a thank-you with the visitor's name. Download: https://subcontext.com/developers/downloads/embeds/leadform/04-provenance-and-values.html - [embeds/leadform/05-headless-own-form.html](https://subcontext.com/developers/examples/embeds/leadform/05-headless-own-form.html): Your own HTML form with the firm's consent block, createLead, field errors and the chat after the form. Download: https://subcontext.com/developers/downloads/embeds/leadform/05-headless-own-form.html - [embeds/leadform/06-headless-code-only.html](https://subcontext.com/developers/examples/embeds/leadform/06-headless-code-only.html): No form: read consent(), draw your own boxes, and send from code through a handle with its own settings. Download: https://subcontext.com/developers/downloads/embeds/leadform/06-headless-code-only.html - [embeds/formguide/01-minimal.html](https://subcontext.com/developers/examples/embeds/formguide/01-minimal.html): The paste-in snippet on an ordinary form. Download: https://subcontext.com/developers/downloads/embeds/formguide/01-minimal.html - [embeds/formguide/02-programmatic-attach.html](https://subcontext.com/developers/examples/embeds/formguide/02-programmatic-attach.html): attach() on one form only, leaving fields out, field rules, and the guide's methods. Download: https://subcontext.com/developers/downloads/embeds/formguide/02-programmatic-attach.html - [embeds/formguide/03-theming.html](https://subcontext.com/developers/examples/embeds/formguide/03-theming.html): Two forms on one page, each with its own panel style, icon and colours. Download: https://subcontext.com/developers/downloads/embeds/formguide/03-theming.html - [embeds/formguide/04-field-context.html](https://subcontext.com/developers/examples/embeds/formguide/04-field-context.html): The markup the agent reads: help text, label overrides, radio groups, button questions, skipped fields, and UTM tags from the page address. Download: https://subcontext.com/developers/downloads/embeds/formguide/04-field-context.html - [embeds/formguide/05-extraction-events.html](https://subcontext.com/developers/examples/embeds/formguide/05-extraction-events.html): The agent filling in several kinds of field, with the formguide:done and formguide:generated events shown as they happen. Download: https://subcontext.com/developers/downloads/embeds/formguide/05-extraction-events.html - [embeds/formguide/06-script-api.html](https://subcontext.com/developers/examples/embeds/formguide/06-script-api.html): Starting switched off, your own buttons calling the methods (enable, trigger, hide and the rest), and translated wording. Download: https://subcontext.com/developers/downloads/embeds/formguide/06-script-api.html - [embeds/nurture/01-minimal.html](https://subcontext.com/developers/examples/embeds/nurture/01-minimal.html): The paste-in snippet: a floating button, with client and adviser from data attributes. Download: https://subcontext.com/developers/downloads/embeds/nurture/01-minimal.html - [embeds/nurture/02-programmatic.html](https://subcontext.com/developers/examples/embeds/nurture/02-programmatic.html): Loading the script without starting it, then starting it with init(), and every method on a button. Download: https://subcontext.com/developers/downloads/embeds/nurture/02-programmatic.html - [embeds/nurture/03-branding.html](https://subcontext.com/developers/examples/embeds/nurture/03-branding.html): Colours, button text, position, a button in your own toolbar, the shared theme object in dark mode, and your own wording. Download: https://subcontext.com/developers/downloads/embeds/nurture/03-branding.html - [embeds/nurture/04-call-note-and-context.html](https://subcontext.com/developers/examples/embeds/nurture/04-call-note-and-context.html): A call note instead of the menus, previous quotes as background, and an unreplaced merge field. Download: https://subcontext.com/developers/downloads/embeds/nurture/04-call-note-and-context.html - [embeds/nurture/05-portal-record-swap.html](https://subcontext.com/developers/examples/embeds/nurture/05-portal-record-swap.html): Docked mode in a single-page portal, switching client with setConsumer(). Download: https://subcontext.com/developers/downloads/embeds/nurture/05-portal-record-swap.html - [embeds/nurture/06-signed-identity.html](https://subcontext.com/developers/examples/embeds/nurture/06-signed-identity.html): Using a signed identity pass, and what happens when the firm id is edited. Download: https://subcontext.com/developers/downloads/embeds/nurture/06-signed-identity.html - [embeds/webmcp/01-minimal.html](https://subcontext.com/developers/examples/embeds/webmcp/01-minimal.html): The paste-in snippet, and whether this browser can offer tools. Download: https://subcontext.com/developers/downloads/embeds/webmcp/01-minimal.html - [embeds/webmcp/02-programmatic.html](https://subcontext.com/developers/examples/embeds/webmcp/02-programmatic.html): init with every option, its result, destroy, and starting again with another key. Download: https://subcontext.com/developers/downloads/embeds/webmcp/02-programmatic.html - [embeds/webmcp/03-inspect-and-call.html](https://subcontext.com/developers/examples/embeds/webmcp/03-inspect-and-call.html): Lists the tools the script registers and lets you call any of them yourself, in any browser. Download: https://subcontext.com/developers/downloads/embeds/webmcp/03-inspect-and-call.html - [embeds/webmcp/04-check-setup.html](https://subcontext.com/developers/examples/embeds/webmcp/04-check-setup.html): A setup checker: secure page, WebMCP support, and your integration's tool list or the exact error. Download: https://subcontext.com/developers/downloads/embeds/webmcp/04-check-setup.html - [embeds/webmcp/05-visitor-journey.html](https://subcontext.com/developers/examples/embeds/webmcp/05-visitor-journey.html): Plays the part of an AI assistant, asking a question and a follow-up, registering interest, sharing requirements and getting a link to a specialist. Download: https://subcontext.com/developers/downloads/embeds/webmcp/05-visitor-journey.html - [oauth/call-the-api-from-the-browser.html](https://subcontext.com/developers/examples/oauth/call-the-api-from-the-browser.html): Your own JavaScript listing your products with a token from your token endpoint. Download: https://subcontext.com/developers/downloads/oauth/call-the-api-from-the-browser.html - [oauth/dotnet/Program.cs](https://subcontext.com/developers/examples/oauth/dotnet/Program.cs): C# (.NET 8) with three modes, get-token, send-lead and token-server. Copy the SubcontextTokens class into your own code. Download: https://subcontext.com/developers/downloads/oauth/dotnet/Program.cs - [oauth/dotnet/SubcontextExamples.csproj](https://subcontext.com/developers/examples/oauth/dotnet/SubcontextExamples.csproj): The project file for the .NET 8 examples, with no NuGet packages. Download: https://subcontext.com/developers/downloads/oauth/dotnet/SubcontextExamples.csproj - [oauth/get-token.mjs](https://subcontext.com/developers/examples/oauth/get-token.mjs): Node: gets a token and keeps it in memory until shortly before it runs out. Download: https://subcontext.com/developers/downloads/oauth/get-token.mjs - [oauth/get-token.php](https://subcontext.com/developers/examples/oauth/get-token.php): PHP: gets a token and keeps it in a small private file until shortly before it runs out. Download: https://subcontext.com/developers/downloads/oauth/get-token.php - [oauth/get-token.sh](https://subcontext.com/developers/examples/oauth/get-token.sh): Asks for a token with curl and prints the answer. Download: https://subcontext.com/developers/downloads/oauth/get-token.sh - [oauth/get_token.py](https://subcontext.com/developers/examples/oauth/get_token.py): Python: gets a token and keeps it in memory, with the standard library only. Download: https://subcontext.com/developers/downloads/oauth/get_token.py - [oauth/quote-form-with-your-token.html](https://subcontext.com/developers/examples/oauth/quote-form-with-your-token.html): The quote form with getToken calling your token endpoint. Download: https://subcontext.com/developers/downloads/oauth/quote-form-with-your-token.html - [oauth/send-lead.mjs](https://subcontext.com/developers/examples/oauth/send-lead.mjs): Node: gets a token, sends a lead with an Idempotency-Key, and checks what became of it. Download: https://subcontext.com/developers/downloads/oauth/send-lead.mjs - [oauth/send-lead.php](https://subcontext.com/developers/examples/oauth/send-lead.php): PHP: gets a token, sends a lead with an Idempotency-Key, and checks what became of it. Download: https://subcontext.com/developers/downloads/oauth/send-lead.php - [oauth/token-server.mjs](https://subcontext.com/developers/examples/oauth/token-server.mjs): Node: a small token endpoint for your pages, GET /subcontext-token. Download: https://subcontext.com/developers/downloads/oauth/token-server.mjs - [oauth/token-server.php](https://subcontext.com/developers/examples/oauth/token-server.php): PHP: a small token endpoint for your pages, for PHP's built-in web server or your own. Download: https://subcontext.com/developers/downloads/oauth/token-server.php - [integrations/agent-tool-endpoint.mjs](https://subcontext.com/developers/examples/integrations/agent-tool-endpoint.mjs): Node: an endpoint for agent tools, with a policy lookup (GET) and a callback booking (POST), API key check and Idempotency-Key handling. Download: https://subcontext.com/developers/downloads/integrations/agent-tool-endpoint.mjs - [integrations/agent-tool-endpoint.php](https://subcontext.com/developers/examples/integrations/agent-tool-endpoint.php): PHP: the same agent tool endpoint, for PHP's built-in web server or your own. Download: https://subcontext.com/developers/downloads/integrations/agent-tool-endpoint.php - [integrations/agent_tool_endpoint.py](https://subcontext.com/developers/examples/integrations/agent_tool_endpoint.py): Python: the same agent tool endpoint, with the standard library only. Download: https://subcontext.com/developers/downloads/integrations/agent_tool_endpoint.py - [integrations/send-event.mjs](https://subcontext.com/developers/examples/integrations/send-event.mjs): Node: signs and sends a sale from your CRM to an inbound custom integration's delivery URL. Download: https://subcontext.com/developers/downloads/integrations/send-event.mjs - [integrations/send-event.php](https://subcontext.com/developers/examples/integrations/send-event.php): PHP: signs and sends a sale from your CRM to an inbound custom integration's delivery URL. Download: https://subcontext.com/developers/downloads/integrations/send-event.php - [integrations/send_event.py](https://subcontext.com/developers/examples/integrations/send_event.py): Python: signs and sends a sale from your CRM to an inbound custom integration's delivery URL. Download: https://subcontext.com/developers/downloads/integrations/send_event.py - [integrations/webhook-receiver.mjs](https://subcontext.com/developers/examples/integrations/webhook-receiver.mjs): Node: receives Subcontext webhooks, checks the X-Subcontext-Signature header and skips repeats. Download: https://subcontext.com/developers/downloads/integrations/webhook-receiver.mjs - [integrations/webhook-receiver.php](https://subcontext.com/developers/examples/integrations/webhook-receiver.php): PHP: receives Subcontext webhooks, checks the signature and skips repeats. Download: https://subcontext.com/developers/downloads/integrations/webhook-receiver.php - [integrations/webhook_receiver.py](https://subcontext.com/developers/examples/integrations/webhook_receiver.py): Python: receives Subcontext webhooks, checks the signature and skips repeats, with the standard library only. Download: https://subcontext.com/developers/downloads/integrations/webhook_receiver.py