API

Send leads
to Byggers.

Post an inquiry from your website, your form tool or your own code, and it lands in Byggers as a new lead.

Overview

Byggers gives each contact form its own endpoint. Anything that can send an HTTP request can post an inquiry to it: your website, a form tool, an automation or your own code. Each request becomes a new lead in Leads, with the stage New and the source Website, and your company gets a notification about it.

This is the API Byggers offers today. It does one thing, receive leads, and the rest of this page is all of it.

Your endpoint

Set it up in Byggers under Settings > Integrations: find Contact form and choose Connect. The setup gives you a Webhook URL like this one, with your own key in it:

https://www.byggers.dk/api/webhooks/leads/YOUR_ENDPOINT_KEY

The key in the URL is how Byggers knows which company and which form the lead belongs to. There is no separate token or header. Treat the URL like a password, and copy it exactly as the setup shows it.

Sending a lead

Send a POST request to your endpoint. The body can be JSON (application/json), a classic form post (application/x-www-form-urlencoded) or multipart/form-data.

curl
curl -X POST https://www.byggers.dk/api/webhooks/leads/YOUR_ENDPOINT_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alex Morgan",
    "email": "alex@example.com",
    "phone": "+1 555 0100",
    "address": "22 Ashley Road",
    "message": "We would like a quote for a new deck."
  }'
JavaScript
await fetch("https://www.byggers.dk/api/webhooks/leads/YOUR_ENDPOINT_KEY", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name, email, phone, message }),
});

Only text values are read: files are skipped, and a JSON value that is a nested object is ignored. If your form tool nests every field under a fields or form_fields object, Byggers reads the fields from there.

Fields

Byggers matches the names in your request to these fields:

nameThe person's full name
first_nameFirst name, if your form splits the name
last_nameLast name, if your form splits the name
emailEmail address
phonePhone number
addressThe address of the job
messageWhat the customer wrote
companyCompany name

Your field names don't have to match exactly. During the setup you confirm which of your form's fields goes where, and Byggers saves that mapping for your endpoint. A field it has no mapping for is still recognized by its name where it can be.

Form housekeeping, such as security tokens, nonces and the page your form sat on, is left out, so it never ends up on the lead.

The response

Every accepted request is answered with 200 and the same body:

{ "ok": true }

The answer is the same whether a lead was created or the request was dropped, for example because the key is unknown or the body was empty. That keeps the endpoint from revealing anything to someone guessing at it. To see that a lead arrived, look in Leads, or use the test step in the setup.

Limits and safety

  • Each endpoint takes a limited number of requests per minute. Above it you get 429 with a Retry-After header, so wait and send again.
  • The same submission sent twice within a short time becomes one lead, not two.
  • A request body has a size limit. A normal contact form is far below it.
  • When your endpoint is set up for a website, Byggers only accepts browser posts that come from that website, so a copied key can't be used on another site.
  • Cross-origin requests are allowed (POST and OPTIONS), so your form can post straight from the visitor's browser.

The script tag

Prefer not to write any code? The setup also gives you a script tag. Put it on the page with your form, and it sends each submission to your endpoint for you:

<script src="https://www.byggers.dk/api/lead-capture/script/YOUR_ENDPOINT_KEY.js" defer></script>

The setup also has step-by-step instructions for common website builders, and a message you can send straight to your web developer.

Get your endpoint

Try Byggers free for 7 days, then get 2 months for $1/month.

Get started
  1. 01

    Create your Byggers account.

  2. 02

    Connect your contact form under Settings > Integrations.

  3. 03

    Post your first lead and see it in Leads.