Lead Lookup and Profile Update by Alias
Look up a lead by a known alias (such as an email address) and update their profile metadata without needing the internal lead ID. These endpoints are designed for situations where you know a lead's email but not their kenbun ID -- for example, when the Chrome extension identifies a lead on a page, or when an external system needs to enrich a lead by email.
When to Use This
- Chrome Extension Lead Profile: The extension auto-detects a lead's email on the page and uses these endpoints to display and update their profile
- CRM Enrichment: Push contextual data (deal stage, meeting notes, plan interest) from your CRM into kenbun by email
- Automation Workflows: Update lead attributes from Zapier, Make, or custom scripts that know the lead's email but not their kenbun ID
GET /lead/by-alias
Look up a lead by alias and return their ID, email, and current metadata attributes.
Authentication
Required: Yes -- Bearer token (JWT) or HTTP Basic Auth (client_id:client_secret)
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
kind | string | No | Alias type to search by. Defaults to email. |
value | string | Yes | The alias value to look up (e.g., the lead's email address) |
Response
200 OK
| Field | Type | Description |
|---|---|---|
lead_id | string | Unique lead identifier |
email | string | The email alias that matched |
metadata | object | Current lead metadata attributes (key-value pairs) |
Example
curl -X GET "https://api.kenbun.io/lead/by-alias?kind=email&value=alex@example.com" \
-u "CLIENT_ID:CLIENT_SECRET"
Response:
{
"lead_id": "ld_abc123",
"email": "alex@example.com",
"metadata": {
"first_name": "Alex",
"company": "Acme Corp",
"quote_step": "Step 1"
}
}
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Missing value parameter | Include ?value=email@example.com in the query string |
| 401 | Unauthorized | Check your API credentials or bearer token |
| 404 | No lead found for this alias | Verify the email exists as a lead alias in the active OU |
PATCH /lead/by-alias/metadata
Update a lead's metadata attributes by resolving the lead from an alias. This is a silent update -- no event is created in the activity timeline. Only the specified attributes are merged; existing attributes not included in the request are preserved.
Authentication
Required: Yes -- Bearer token (JWT) or HTTP Basic Auth (client_id:client_secret)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
alias_kind | string | No | Alias type. Defaults to email. |
alias_value | string | Yes | The alias value to resolve the lead (e.g., email address) |
attributes | object | No | Key-value pairs to merge into the lead's metadata. Required if account_id is not provided. |
account_id | string | No | Account ID to associate with this lead. Required if attributes is not provided. |
At least one of attributes or account_id must be included.
Attribute key rules:
- 1 to 64 characters long
- May contain letters, digits, underscores (
_), dashes (-), dots (.), or spaces - Keys that do not meet these requirements are rejected with a 400 error
Response
200 OK
| Field | Type | Description |
|---|---|---|
lead_id | string | The lead that was updated |
updated | integer | Number of metadata attributes written (0 if only account_id was provided) |
attributes | object | The metadata attributes that were saved |
account_linked | boolean | Whether the lead was successfully associated with the specified account |
Example: Update Metadata
curl -X PATCH "https://api.kenbun.io/lead/by-alias/metadata" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"alias_kind": "email",
"alias_value": "alex@example.com",
"attributes": {
"quote_step": "Step 1",
"interest_level": "high"
}
}'
Response:
{
"lead_id": "ld_abc123",
"updated": 2,
"attributes": {
"quote_step": "Step 1",
"interest_level": "high"
},
"account_linked": false
}
Example: Link Lead to an Account
curl -X PATCH "https://api.kenbun.io/lead/by-alias/metadata" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"alias_kind": "email",
"alias_value": "alex@example.com",
"account_id": "acct_abc123"
}'
Response:
{
"lead_id": "ld_abc123",
"updated": 0,
"attributes": {},
"account_linked": true
}
Example: Update Metadata and Link to Account
Both operations can be combined in a single request:
curl -X PATCH "https://api.kenbun.io/lead/by-alias/metadata" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"alias_kind": "email",
"alias_value": "alex@example.com",
"attributes": {
"title": "VP Marketing",
"linkedin_url": "https://linkedin.com/in/alexjohnson"
},
"account_id": "acct_abc123"
}'
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Missing alias_value, or neither attributes nor account_id provided, or invalid attribute key | Check that alias_value is provided, at least one of attributes or account_id is included, and all attribute keys follow the naming rules above |
| 401 | Unauthorized | Check your API credentials or bearer token |
| 404 | No lead found for this alias | Verify the email exists as a lead alias in the active OU |
| 413 | Metadata payload too large | Reduce the number or size of attributes in a single request |
Notes
- Both endpoints are OU-scoped to the active Organizational Unit. The lead must exist within your current OU.
- The PATCH endpoint performs a partial merge -- existing metadata fields not included in the request are preserved unchanged.
- Updates via this endpoint are silent: they do not create an event in the lead's activity timeline. This keeps profile annotations separate from behavioral engagement data.
- Account linking via
account_idis non-fatal -- if the account association fails, the metadata update still succeeds andaccount_linkedwill befalsein the response. - The
kindparameter currently supportsemail. Additional alias types may be added in the future.
Related Endpoints
- Lead Detail -- View full lead details by ID
- Lead Metadata -- Update metadata when you know the lead ID
- Lead Aliases -- List all aliases for a lead
- Lead Metadata Properties -- List available property keys