This section is for the developers who build the other end of an integration: the endpoint an agent calls, the server that receives Subcontext's webhooks, or the code in your CRM that tells Subcontext what became of a lead. It describes exactly what goes over the wire, so you can build and test your side.
The dashboard's Help articles cover the dashboard screens, and each page here names the article to read. Most integration settings are for owners and managers, and custom integrations and webhooks are a plan feature.
Which integration do I need?#
| You want to... | Use | Read |
|---|---|---|
| Let an agent look something up in your system, or do something there, during a conversation | A custom integration's endpoint, exposed as an agent tool | Your API as an agent tool |
| Hear about every new lead, or other lead events, in a standard signed format | A Webhook endpoint connection and a workflow's Send a webhook action | Webhooks Subcontext sends |
| Push each lead into your CRM's own API, shaped the way it wants | A custom integration's endpoint and a workflow's Send to an integration action | Webhooks Subcontext sends |
| Have your CRM tell Subcontext about sales, quotes and commission, using its webhooks | An inbound custom integration | Sending events to Subcontext |
| Write code that sends leads or outcomes to Subcontext | The Subcontext API, with an access token | API and Access tokens |
| Add bookings to Google Calendar, or rows to a Google Sheet | The built-in Google connections | Built-in integrations |
| Tell Google Ads or Meta which leads went on to buy | The built-in ad platform connections | Outcomes to ad platforms |
Integrations work in one of two directions:
- Subcontext calls you: agent tools, webhooks, Send to an integration, policy sync. Your server answers Subcontext's requests. The rules all of these share (HTTPS, timeouts, retries, status codes) are in How Subcontext calls your systems.
- You call Subcontext: the API (you ask for a token and send requests), or an inbound custom integration (your system posts signed events to a delivery address).
A first integration in ten minutes#
- Save webhook-receiver.mjs on a server that
has an
https://address, and start it with a signing secret you make up:SUBCONTEXT_SIGNING_SECRET=A_LONG_RANDOM_VALUE node webhook-receiver.mjs. - In the dashboard, open Integrations, External systems, press Connect and choose Webhook endpoint. Enter your address as the Base url and the same value as the Signing secret.
- Open CRM, Workflows, press New workflow, set When to A lead arrives, add the action Send a webhook and pick your connection.
- Add a test lead with your own details (Leads, New lead). Your server
prints
lead.createdand the name.
Need help?#
Email hello@subcontext.com. Say which integration you're building and, if something failed, the time of the call. The Integration logs in the dashboard hold the request and the answer.
In this section
- How Subcontext calls 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 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 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 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 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 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 Where to look when an integration call fails, what each error means, and how to fix the common ones.