Developers
Build with Subcontext
Put your firm's AI agent, quote forms and lead forms on your website, send leads in from your own systems, and read your products and results through the Subcontext API.
What you can build
- Getting started What you can build with Subcontext, what you need before you start, and where to go next.
- Website embeds Guides and example pages for adding a chat with your AI agent, a quote form, an enquiry form and more to your website.
- Access tokens (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.
- REST API Quote and sell your products, send leads, read what became of them and report outcomes with the Subcontext API.
- AI assistants Connect AI assistants such as Claude and ChatGPT to Subcontext, with MCP, assistant apps and A2A.
- Integrations How Subcontext connects to your firm's own systems, what it sends them, and how to build the receiving end.
- Setup Your own domain names, phone numbers and WhatsApp, set up for Subcontext.
Quick start
-
1
Add the chat to your website
In your Subcontext dashboard, open Agents, your agent, Channels, Web. Switch it on and paste the snippet before
</body>on your pages:html <script id="webchat-embed-script" src="https://js.subcontext.com/webchat-latest.js" data-agent-id="YOUR_AGENT_ID"></script> -
2
Get an access token for your server
Create an API application under Integrations, API applications, then exchange its client id and secret for a token that lasts two hours:
sh curl -X POST https://subcontext.com/oauth/token \ -d grant_type=client_credentials \ -d client_id=YOUR_CLIENT_ID \ -d client_secret=YOUR_CLIENT_SECRET \ -d scope=read \ -d resource=https://subcontext.com/api/v1 -
3
Call the API
Send the token in the
Authorizationheader. This lists your products:sh curl https://subcontext.com/api/v1/products \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"