Skip to main content
Documentation

Leads

leads.create

Add a new lead to the shop's pipeline
WritesReaches the customerWrite budget

REST

Shipping
POST /api/v1/leads/create

MCP tool

Live
leads.create

Exposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Leads domain.

Operating contract

Runs the same intake pipeline every website form, lead form and public API submission runs, which means it DE-DUPLICATES: when this contact already has an open lead, the enquiry is folded into it and merged comes back true with the existing lead's id, rather than a second lead appearing on the board.

That is the reason to use this rather than assembling a lead yourself. A shop working two half-records for one person is the most common mess in this domain, and it is created one hand-typed lead at a time.

Something to work with is required: a name, a company, a phone number or an email. A lead nobody can contact is not a lead.

source is where this enquiry came from and it should be the truth — call leads.sources for the keys this shop already uses. It flows into every attribution report, so a lead stamped with the wrong channel quietly credits the wrong spend.

message becomes the first note on the lead's timeline, in the customer's own words. Put what they actually said there rather than a summary of it.

The shop's round-robin rotation, its new-lead alerts and its Lead Responder all fire from here exactly as they do for a website submission — so this can result in the shop texting the customer if they have that automation on.

Returns lead_id and merged. lead_id is what every other capability in this domain takes.

Who may call it

Permission
leads.accessThe caller must hold Leads at the ACT level. A read-only dashboard grant on the same section is refused.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
writeCounted against the write budget, which is tighter than a read.

Input

FieldTypeDescription
first_namestringmax 120 chars

Their first name.

last_namestringmax 120 chars

Their last name.

company_namestringmax 200 chars

Their company, for a fleet or trade enquiry.

phonestringmax 40 chars

A phone number in any format. Required unless an email or a name is given.

emailstringmax 200 chars

An email address.

vehicle_descriptionstringmax 300 chars

The car in their own words — '2022 Model Y', 'my wife's Q5'.

servicesstring[]

What they asked about, as free text. Up to 12.

sourcestringmax 60 chars

Where the enquiry came from, as a key from leads.sources.

Default: "api"
messagestringmax 2000 chars

What they actually said. Becomes the first note on the lead's timeline.

estimated_valuenumber0–10000000

What the job is worth if it lands, in the shop's currency.

Output

FieldTypeDescription
lead_idstring

mergedboolean

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/leads/create \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source":"api"}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/leads/create", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "source": "api"
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/leads/create",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "source": "api"
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "leads.create",
    "arguments": {
      "source": "api"
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403forbiddenThis login does not hold leads.access.
403insufficient_scopeThe credential is read-only and this capability writes.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many write calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.