Skip to main content
POST
Create lead
Add one contact to the workspace. Required scope: leads:manage. A lead is the unit campaigns enroll and calls match against, so this is usually the first write of an outreach journey: create the lead, tag it, enroll the tag into a campaign. You do not have to create a lead to place a single call — POST /calls takes a bare number — but a lead is what carries memory and tags between calls.
source is optional and defaults to api. A create may claim api, manual or csv_import; any other value is refused with 400 INVALID_LEAD_SOURCE rather than quietly rewritten. call is Yappr’s own and cannot be claimed.

Response

201, with the same object List leads returns — including tags expanded to full objects:

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Body

application/json
phone_number
string
required

E.164, or the local form (0501234567) which is normalised to E.164 before it is stored. A number that could never be dialled — too short, non-numeric, an impossible Israeli prefix or length — is 400 INVALID_PHONE_NUMBER rather than a lead that looks real and can never be called.

Example:

"+972501234567"

name
string | null
email
string<email> | null
source
enum<string>
default:api

Where the lead came from. Omitted means api. Any other value is 400 INVALID_LEAD_SOURCE — it used to be accepted and then stored as api. Leads Yappr creates from a call are stored as call, which a request cannot claim.

Available options:
api,
manual,
csv_import
tags
string[]

Tag names to attach, exactly as GET /lead-tags returns them. Resolved to IDs server-side; matching is exact. A name no tag in this workspace carries is 400 INVALID_TAG_NAMES — the names that did resolve used to be kept and the rest dropped, which returned 201 with fewer tags than were asked for. Use tag_ids to pass UUIDs directly.

tag_ids
string<uuid>[]

Tag IDs to attach. Use tags (names) or tag_ids (UUIDs), not both.

metadata
object

Stored as sent, except the reserved key extracted, which only a call writes and is dropped from a create.

Response

Lead created

id
string<uuid>
phone_number
string
Example:

"+972501234567"

name
string | null
email
string<email> | null
source
enum<string>

How the lead first appeared.

call — created from a call this workspace took or placed. The most common value by far, and written only by Yappr: a request cannot claim it. api — created through this API. manual — typed into the dashboard. csv_import — arrived in a spreadsheet.

A create may send api, manual or csv_import; any other value is refused rather than silently rewritten.

Available options:
api,
manual,
csv_import,
call
Example:

"api"

tags
object[]
long_term_context
string | null

AI memory for this lead. Injected into the agent's system prompt at call time when lead_memory_enabled is true on the agent.

extracted
object | null

What this lead's calls collected, keyed by the extraction parameter's own name, merged across every call with this person. The most recent call that answered a field wins it; a field that call never covered keeps the answer an earlier one found. Only answers are merged: unlike a call's own extracted_data on GET /calls/{id}, which carries every parameter with null for the ones that call never covered, a parameter no call has answered is absent here. Read-only and written only by the post-call pass: it is stored under the reserved metadata.extracted key, neither a create nor a PATCH can set it, and replacing metadata does not erase it. Null until a call collects something.

extracted_precision
object | null

The date parameters the latest call that answered them gave as a month and no day ("sometime in November"), keyed by parameter name, each {"precision": "month", "month": "YYYY-MM"}, with "approximate": true when the call's own extracted_data_precision has it (a month worked out from a length of time ago, such as "three months ago", rather than named). Such a field is absent from extracted, because a month is not a day; a later call that names the day moves it back to extracted and out of here. Read-only, stored under the reserved metadata.extracted_precision key like extracted, and null when no call has given a month alone. The same member is on the lead inside GET /calls/{id}.

metadata
object
created_at
string<date-time>
updated_at
string<date-time>