Get Started

Leads from your website via the API

Ten minutes to turn every form submission on your site into a card in the CRM pipeline: the key, the board, the first request, wiring the form.

Every enquiry from a form on your site, a landing page or another system can become a card in a Witstally CRM pipeline on its own. One public API endpoint does it, POST /api/v1/public/leads. Setup takes about ten minutes and needs no developer until the last step.

Who can do this. The workspace Owner or the Full Access role can create API keys. Pipelines (boards) are visible to every board member.

How it works

A key belongs to one workspace (legal entity). It reaches exactly the boards that list this workspace among the board’s organisations. A new lead is tagged with your workspace and lands in the board’s first stage, together with the organisation, the contact and the message from the form.

Step 1. Prepare the pipeline

  1. Open CRM → Consolidated Board and pick the board that should receive enquiries, or create one, say “Website leads”.
  2. In the board’s settings add your workspace to the board’s organisations. Without this the API answers with no_board.
  3. Copy the board id from the address bar: app.witstally.com/crm/board/{boardId}. You will send it with every request.

With several products, make a board per product and send a different boardId from different pages of the site.

Step 2. Create an API key

  1. Settings → API keys → New key.
  2. A name, for example “Website form”.
  3. Tick leads:write only and press Create key.
  4. Copy the key right away: only its fingerprint is stored, it will not be shown again.

Why leads:write alone: it is the one scope that grants no reading. Such a key can only create leads, so it is safe to put straight into the page’s code. If it ever leaks, revoke it on the same page and create a new one.

Step 3. Send the first lead

curl -X POST https://api.witstally.com/api/v1/public/leads \
  -H "X-Authorization-Key: wsk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "company": "Acme Ltd",
    "contactName": "Jane Doe",
    "email": "jane@acme.example",
    "phone": "+441234567890",
    "message": "Please call me about the Professional plan",
    "source": "website",
    "externalId": "form-2026-10-12-001",
    "boardId": "YOUR_BOARD_ID"
  }'

The reply is 201 with the lead, including boardName and stageName. Open the board: the “Acme Ltd” card sits in the first stage, the Organisation block shows Acme Ltd, the contacts show Jane Doe, and the message is the first comment. The card’s timeline says “Lead created via API (website)”.

Request fields

FieldMeaning
boardIdthe board; required when the workspace is on more than one board
titlecard title; defaults to the company, then the contact, then the email or phone
companythe client organisation; matched by name or created
contactName, email, phonethe card’s contact
messagethe form text; becomes the first comment. A good place for the language, the page URL and UTM tags
sourcewhere the lead came from: website, landing, a system name; lowercase
externalIdyour own id of the submission; with source it prevents duplicates
expectedValue, currencyexpected amount and currency, when known
utmSource, utmMedium, utmCampaignUTM tags of the visit that produced the lead; stored on the card and used for attribution in Verimetriq when the visitor cannot be matched by cookie

At least one of title, company, contactName, email, phone must be present.

Step 4. Wire the form on the site

A minimal example for any site. Add it after your existing form submission, so nothing that already works changes:

const utm = new URLSearchParams(location.search);
const lead = {
  email: form.email.value,
  phone: form.phone.value,
  message: `${form.text.value}\nPage: ${location.href}`,
  source: 'website',
  externalId: crypto.randomUUID(),
  boardId: 'YOUR_BOARD_ID',
  utmSource: utm.get('utm_source') || undefined,
  utmMedium: utm.get('utm_medium') || undefined,
  utmCampaign: utm.get('utm_campaign') || undefined,
};

fetch('https://api.witstally.com/api/v1/public/leads', {
  method: 'POST',
  headers: {
    'X-Authorization-Key': 'wsk_YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(lead),
  keepalive: true,
}).catch(() => {});

On a site builder without code access, Zapier, Make or n8n make the same call: an HTTP request module with the X-Authorization-Key header.

Duplicates and retries

Sending the same source + externalId pair again returns 200 with the existing lead and creates nothing. Retries are therefore safe: generate externalId once per click on “Send” and repeat the request until you get a 2xx.

When something goes wrong

ReplyCauseWhat to do
401wrong or revoked keycheck the header and the key
403the key lacks leads:writecreate a key with that scope
400fields missing; details names themusually boardId
422 no_boardthe workspace is on no boardstep 1
429more than 300 requests a minutewait for Retry-After

The full API reference, with the other resources, is at api.witstally.com/api/v1/public/docs.

About Witstally

Witstally is a modern SaaS accounting platform designed for entrepreneurs, startups, and SaaS companies worldwide.

We provide enterprise-grade financial control tools that seamlessly bridge the gap between simple spreadsheets and complex legacy ERPs.

Key Platform Features:

  • Double-entry accounting: Compliant core ledger system.
  • Multi-tenant architecture: Manage multiple projects and companies in one account.
  • API-first platform: REST API with scoped API keys per workspace.
  • Automated financial reports: Instant P&L, balance sheets, and cash flow docs.