Webhook and API

Send enquiries from your website or other tools straight into your leads, and check what arrived.

Send enquiries from your website or other tools into OpusCRM. Find it in Settings > Lead Sources > Webhook / API. Only owners and admins can use it.

A webhook is a web address your website or tool sends each enquiry to. You choose which field is which. The Lead Capture API is for developers: they send enquiries as JSON or form fields with a key. Each enquiry becomes a lead in OpusCRM within seconds, with its follow-up and the response timer, like a form enquiry.

Add a connection

  1. Choose Add a connection, then Webhook or Lead Capture API. Give it a name, a lead source and, if you like, a default campaign.
  2. Copy the webhook address or the API key at once: "For your safety we show this only once. If you lose it, make a new one." Choose Make a new key for a new one: the old one stops working at once.
  3. Paste it into your website or tool. The page How to send enquiries shows ready-to-copy examples with your address.

Your plan includes a number of connections (1 on the base plan). Turn off stops a connection for good and frees its place; leads you already have stay.

What to send

Send at least a mobile number or an email. The Lead Capture API reads these fields: name, phone, email, company, message, source (a lead source name you use, like Website), campaign, product_service, location, external_id (your own ID for the enquiry), custom_fields (your custom fields by their key), utm (source, medium, campaign, content, term) and consent (given, text). It ignores fields it doesn't know.

A webhook takes any field names. We match the usual ones (name, phone, mobile, email, city, message and more) by ourselves; match the others under Match your fields. A field called just id is not used as the enquiry ID unless you match it, because many tools reuse such numbers. An enquiry without a mobile number or email is still received: it waits in Failed enquiries, where you can match your fields and try it again.

Sending the same enquiry twice

Send an Idempotency-Key header (up to 200 characters) or an external_id with each enquiry. If your system sends the same enquiry again, OpusCRM recognises it, answers with the first one and never makes a second lead.

Signing secret (webhook, optional)

With a signing secret, every request must carry an X-Webhook-Signature header: sha256= and the HMAC-SHA-256 of the request body, in hex, made with the secret. Requests without it, or with a wrong one, are refused.

The signature covers the request body only, not the time it was sent, so someone who copies a signed request could send it again. Send an Idempotency-Key or an external_id too: a repeat is then recognised and never makes a second lead.

Answers

  • 202: received. The answer holds capture_id and status; a repeat also says duplicate: true.
  • 400: the body could not be read. 413: larger than 64 KB. 415: not JSON or form fields.
  • 401: wrong address or key, or a wrong signature.
  • 422 (API): a field is wrong; the answer names it.
  • 429: too many requests (60 a minute for each connection). 503: try again. For both, wait the seconds in the Retry-After header and send the same request again.

Google Forms

OpusCRM has no Google Forms connection; send its responses to your webhook instead. In the form, open More (⋮) > Apps Script, paste the script from How to send enquiries (it has your address), then add a trigger: onFormSubmit, From form, On form submit. Each question's title becomes a field name.

Check what arrived

  • Recent requests lists the last 50 requests, kept for 30 days, with their result. Personal details are hidden: you see field names and masked values only.
  • Send test lead shows what a lead would look like from a sample enquiry or the last request we received. Nothing is saved and nothing counts against your plan.
  • If a connection stops working, Lead Sources shows Needs attention and owners and admins are told once (see Lead sources).

Still need help?

Call or email OpusCRM support.

Log in to send us a message from OpusCRM.

OpusCRM support never asks for your password or a code sent to you.