Skip to main content

Accounts API

List accounts with their scores, levels, engagement metrics, and metadata. Accounts represent companies or organizations that group related leads, providing an account-level view of engagement and buying signals.

GET /accounts/by-domain​

Look up an account by its domain or company name. Returns the first matching account, or an empty response if no match is found.

Query Parameters​

ParameterTypeRequiredDescription
domainstringNoDomain to search for (e.g., acme.com). Checked first when both parameters are provided.
namestringNoExact company name to search for. Used as a fallback when domain is not provided or returns no match.

At least one of domain or name must be provided.

Response​

200 OK

{
"account_id": "acct_abc123",
"name": "Acme Corporation",
"domain": "acme.com"
}

Returns null when no matching account is found.

FieldTypeDescription
account_idstringUnique account identifier
namestringAccount name
domainstringPrimary email domain

Example​

curl -X GET "https://api.kenbun.io/accounts/by-domain?domain=acme.com" \
-H "Authorization: Bearer <token>"

Common Errors​

StatusMeaningSolution
400Bad RequestNeither domain nor name was provided
401UnauthorizedCheck authentication credentials

GET /accounts/fuzzy​

Search for accounts by name using fuzzy matching. Returns the top accounts whose names are similar to the provided query, ranked by similarity score. This is useful when you have a company name that may not exactly match an existing account -- for example, "Salesforce" vs. "Salesforce LLC" or "ACME Corp" vs. "Acme Corporation".

The endpoint uses a combination of string similarity algorithms to find close matches, returning up to 5 results above a 60% similarity threshold.

When to Use This​

  • Lead imports: When importing contacts from external sources (e.g., LinkedIn), use this to find existing accounts before creating duplicates
  • Data deduplication: Check whether a company already exists under a slightly different name
  • Account linking: Match imported company names against your account list to link leads to the right account

Query Parameters​

ParameterTypeRequiredDescription
namestringYesCompany name to search for (e.g., Salesforce LLC)

Response​

200 OK

{
"matches": [
{
"account_id": "acct_abc123",
"name": "Salesforce",
"score": 0.92
},
{
"account_id": "acct_def456",
"name": "Salesforce.com Inc",
"score": 0.78
}
]
}
FieldTypeDescription
matchesarrayList of matching accounts, sorted by similarity (highest first). Maximum 5 results.
matches[].account_idstringUnique account identifier
matches[].namestringAccount name
matches[].scorenumberSimilarity score between 0 and 1 (higher is more similar)
cappedbooleanPresent and true when the account set is too large for fuzzy search. An empty matches array is returned in this case.

Score interpretation:

Score RangeMeaning
0.90 -- 1.0Very high confidence (near-exact match)
0.85 -- 0.89High confidence (safe for automated linking)
0.70 -- 0.84Moderate confidence (recommend user confirmation)
0.60 -- 0.69Low confidence (possible match, needs review)

Example​

curl -X GET "https://api.kenbun.io/accounts/fuzzy?name=Salesforce%20LLC" \
-H "Authorization: Bearer <token>"

Common Errors​

StatusMeaningSolution
400Bad RequestThe name parameter is missing or empty
401UnauthorizedCheck authentication credentials
500Server ErrorContact support if the issue persists

GET /accounts​

Returns a paginated list of accounts for the active Organizational Unit, including firmographic scores, engagement metrics, and surge activity.

Query Parameters​

ParameterTypeRequiredDescription
searchstringNoSearch by account name or domain
pageintegerNoPage number for pagination (default: 1)
per_pageintegerNoResults per page (default: 25, max: 100)
sort_bystringNoField to sort by: name, score, engagement, last_activity, owner_name
sort_orderstringNoSort direction: asc or desc (default: desc)
account_levelstringNoFilter by account level name (e.g., "Target", "Qualified")
min_scoreintegerNoMinimum account score
max_scoreintegerNoMaximum account score
min_engagementintegerNoMinimum engagement score
owner_namestringNoFilter by owner display name (partial match, case-insensitive)
has_leadsbooleanNoWhen true, returns only accounts that have at least one associated lead
created_afterstringNoISO 8601 timestamp - accounts created after this date
created_beforestringNoISO 8601 timestamp - accounts created before this date
last_activity_afterstringNoISO 8601 timestamp - accounts active after this date
surge_statusbooleanNoFilter by surge activity: true (active surge) or false

Example​

curl -X GET "https://api.kenbun.io/accounts?page=1&per_page=25&sort_by=score&account_level=Target" \
-H "Authorization: Bearer <token>"

Response​

200 OK

{
"accounts": [
{
"account_id": "acct_abc123",
"domain": "acme.com",
"name": "Acme Corporation",
"account_score": 85,
"account_level": "Target",
"total_leads": 12,
"engagement_score": 245,
"last_activity_at": "2026-01-30T14:23:00Z",
"surge_active": true,
"surge_window_start": "2026-01-28T00:00:00Z",
"surge_event_count": 47,
"metadata": {
"company_size": "Enterprise",
"industry": "Technology",
"country": "United States",
"employees": 2500,
"plan": "Pro"
},
"created_at": "2025-11-15T10:00:00Z",
"updated_at": "2026-01-30T14:23:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total_count": 142,
"total_pages": 6
}
}

Response Fields​

FieldTypeDescription
account_idstringUnique account identifier
domainstringPrimary email domain for the account
namestringAccount name (company name)
account_scoreintegerFirmographic score based on account attributes
account_levelstringAccount tier (Target, Qualified, Standard, etc.)
total_leadsintegerNumber of contacts associated with this account
engagement_scoreintegerCombined engagement across all contacts
last_activity_attimestampMost recent activity from any contact
surge_activebooleanWhether account is currently experiencing surge
surge_window_starttimestampWhen the current surge window started (if active)
surge_event_countintegerNumber of events during current surge (if active)
metadataobjectAccount metadata properties (firmographic data)
created_attimestampWhen the account was first created
updated_attimestampWhen the account was last modified

Pagination Object​

FieldTypeDescription
pageintegerCurrent page number
per_pageintegerResults per page
total_countintegerTotal number of accounts matching filters
total_pagesintegerTotal number of pages available

Common Errors​

StatusMeaningSolution
400Bad RequestInvalid query parameter value (e.g., invalid sort_by)
401UnauthorizedCheck authentication credentials
500Server ErrorContact support if the issue persists

Notes​

  • Accounts are automatically created when leads with new account_id values are added
  • Account scores are calculated based on Account Scoring Rules
  • Account levels are assigned based on Account Level thresholds
  • Surge detection is enabled at the organization level
  • All accounts are scoped to your Organizational Unit