Create and update a customer through the API
POST /api/v1/leads: fields, examples, type, tags, company and preventing duplicate customers with external_id.
On this page
Purpose
This article describes POST /api/v1/leads and PATCH /api/v1/leads/{id}, with working examples.
See Getting started
with the Leads API for your API key and the Authorization header.
What happens to a request
A request sent through the API becomes a Customer in Plenno. If it is a sales lead, Plenno automatically creates a linked Opportunity (in the API: deal) as well. Which sales process and stage that opportunity starts in is explained in Route new opportunities to a sales process. You do not need to send this in your request.
An automatically created opportunity gets the name of the person who sent the request. You can rename it later in Plenno; no API call is needed for that.
A minimal request
curl -X POST https://app.plenno.nl/api/v1/leads \
-H "Authorization: Bearer pln_live_xxxxxxxx_REPLACE_WITH_YOUR_OWN_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Jan Voorbeeld",
"email": "jan@example.com",
"phone": "+31 6 12345678",
"external_id": "website-lead-1001",
"type": "lead"
}'
Response: HTTP 201
{
"success": true,
"lead_id": "00000000-0000-4000-8000-000000000001",
"url": "https://app.plenno.nl/app/leads/00000000-0000-4000-8000-000000000001",
"status": "Nieuw",
"created": true,
"mode": "live"
}
lead_idis the customer’s ID in Plenno. Store it if you want to update the request later.urlis the direct link to the customer in Plenno.statusis the name of the request’s stage. It can differ between Plenno accounts.createdistruefor a new request.modeis"live"or"test", depending on the key you used.
The response does not include the opportunity’s ID. You can find the opportunity in Plenno, on the customer.
Fields when creating (POST)
| Field | Type | Required | Max | Notes |
|---|---|---|---|---|
name |
string | yes | 120 | Name of the person sending the request. |
email |
string | yes* | 160 | A valid email address. |
phone |
string | yes* | 40 | Phone number, any format. |
message |
string | no | 4000 | The message from the form. |
company |
string | no | 120 | The sender’s company name. |
address |
string | no | 240 | Address. |
source |
string | no | 80 | Where the request comes from, for example website. |
form |
string | no | 120 | Which form, for example offerte-aanvraag. |
external_id |
string | no | 128 | Your own reference, to prevent duplicate requests. See below. |
type |
string | no | 40 | Kind of request. Determines whether an opportunity is created. See below. |
tags |
array | no | 10 items | Free labels, for example ["website"]. Each label up to 40 characters. |
metadata |
object | no | 25 fields | Extra context, such as the page, campaign, UTM parameters and gclid. |
assignee_email |
string | no | 160 | Email address of the team member to assign. See Assign a team member through the API. |
* email or phone is required: at least one of the two.
Rules
- The whole body is at most 16 kB.
- Fields that are not in the table are rejected (
422 validation_error). This way you notice a typo straight away, instead of a field silently disappearing. metadatais flat: values may only be text, a number ortrue/false. No nested objects or lists. At most 4 kB in total.external_idmay contain letters, digits and_ . : @ / + -, without spaces.- You never send a
pipeline_id,stage_idor organisation ID. The company follows from your key; the opportunity’s destination follows from your settings.
type: when is an opportunity created?
type determines whether Plenno automatically creates an opportunity for the customer.
type |
What Plenno does |
|---|---|
lead, or no type |
Customer and linked opportunity (with a live key). |
any other type, for example download or application |
Customer only. No automatic opportunity. |
type is a free label of lowercase letters, digits, _ or - (up to 40 characters). There is no
fixed list: only lead (or empty) creates an opportunity. Any other type still comes in and can be
found in Plenno, but does not appear unasked in your sales process. This lets you collect downloads or
job applications through the same key without cluttering your sales process.
A test key never creates an opportunity, whatever type you send. See
Live and test API keys.
{
"name": "Jan Voorbeeld",
"email": "jan@example.com",
"external_id": "website-download-2001",
"type": "download",
"tags": ["website", "whitepaper"]
}
This request comes in as a customer, without an opportunity.
company and tags
companyis stored with the customer as the company name, in its own searchable field. Plenno never automatically turns it into a CRM company: a slightly different spelling of the same customer would then create a duplicate. If you want to link the request to an existing or new company, you do that yourself in Plenno.tagsare free labels for your own use, for example["website", "whitepaper"]. They do not affect whether an opportunity is created; onlytypedoes.
{
"name": "Jan Voorbeeld",
"email": "jan@example.com",
"company": "Demo Installatiebedrijf",
"tags": ["website"],
"metadata": { "page": "/offerte", "utm_source": "google", "utm_medium": "cpc" }
}
Prevent duplicates with external_id
external_id is the ID of the same item in your own system, for example the number of a form
submission: website-lead-1001. If you send it, Plenno guarantees one customer and one
opportunity per external_id, even if your system sends the same request twice, for example after a
timeout.
| Call | HTTP status | created |
What happens |
|---|---|---|---|
First time with this external_id |
201 |
true |
Plenno creates the customer (and, for a sales lead, the opportunity). |
Again with the same external_id |
200 |
false |
Plenno creates nothing new and returns the existing customer. |
The response to a repeat call:
{
"success": true,
"lead_id": "00000000-0000-4000-8000-000000000001",
"url": "https://app.plenno.nl/app/leads/00000000-0000-4000-8000-000000000001",
"status": "Nieuw",
"created": false,
"mode": "live"
}
Good to know:
- An
external_idapplies per company and per key type. A live key and a test key may use the sameexternal_idwithout blocking each other. - The fields of a repeat call are ignored. So a repeat does not change the existing customer; use
PATCHfor that. - If you leave out
external_id, every call creates a new customer. - Plenno remembers an
external_idfor 90 days; after that it is available again. - If the same
external_idis still being processed at that moment, you briefly get409 duplicate_in_progress. Try again after a few seconds. - If the customer has since been deleted in Plenno, you get
410 lead_deleted. Plenno deliberately does not create it again. Use a newexternal_idfor a new request.
Update a request (PATCH)
PATCH https://app.plenno.nl/api/v1/leads/{lead_id}
With the default permission Submit requests (leads:create) you can update a customer that you
created earlier with the same key. All fields are optional; only send what you want to change.
| Field | Notes |
|---|---|
name |
Same rules as when creating. |
email |
Same rules as when creating. |
phone |
Same rules as when creating. |
address |
Same rules as when creating. |
company |
Replaces the company name. Never links to a CRM company. |
message |
Replaces the customer’s entire note. |
tags |
Replaces all labels. |
Cannot be updated through the API: external_id, type, assignee_email, metadata, source and
form. With extra API v1.1 permissions, you can also change the stage, assignee and follow-up date of
a request or an existing opportunity. See
API v1.1: customers, opportunities and actions.
curl -X PATCH https://app.plenno.nl/api/v1/leads/00000000-0000-4000-8000-000000000001 \
-H "Authorization: Bearer pln_live_xxxxxxxx_REPLACE_WITH_YOUR_OWN_KEY" \
-H "Content-Type: application/json" \
-d '{ "phone": "+31 6 87654321", "tags": ["website", "followed-up"] }'
The response is HTTP 200 with the same fields as above, without created.
A key with only leads:create may only update its own requests. With leads:write, it may also
update other requests from the same company, within the key’s live or test mode. An unknown ID, or one
that does not belong to the key, returns 404 not_found.
Recommended approach
- Send from your server, not from the browser.
- Always send an
external_id, so a retry never creates a duplicate. - Try it out with a test key first.
- Use
typeto keep non-sales submissions out of your sales process. Leave it out for a normal quote request.
Next steps
Read Route new opportunities to a sales process or Error codes and limits.
Updated November 19, 2026 · Checked against Plenno 9.5.5