Skip to main content

Lead Owner Assignment API

Assign and manage ownership of leads. Owners represent the sales or marketing team member responsible for following up with a lead. Assigning owners helps your team coordinate outreach and avoid duplicate efforts.

POST /leads/{leadID}/owner

Assign or unassign an owner for a single lead. To unassign, send an empty or null owner_id.

When to Use This

  • Sales handoff: Assign a lead to a sales rep when they reach a score threshold
  • Territory routing: Set ownership based on lead geography or account
  • Unassigning: Remove ownership when a rep leaves or lead is reassigned

Request

ParameterTypeRequiredDescription
leadIDstring (UUID)YesLead identifier (path parameter)

Request Body

FieldTypeRequiredDescription
owner_idstring or nullNoUser ID of the new owner. Send null or omit to unassign.
owner_namestring or nullNoDisplay name of the new owner

Assign an owner:

{
"owner_id": "user_abc123",
"owner_name": "Jane Smith"
}

Unassign an owner:

{
"owner_id": null,
"owner_name": null
}

Response

200 OK

{
"status": "ok",
"message": "owner assigned"
}

When unassigning:

{
"status": "ok",
"message": "owner unassigned"
}

Example

curl -X POST "https://api.kenbun.io/leads/ld_123/owner" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"owner_id": "user_abc123", "owner_name": "Jane Smith"}'

Common Errors

StatusMeaningSolution
400Bad RequestLead ID is missing or request body is invalid
401UnauthorizedCheck authentication credentials
404Not FoundLead does not exist in the active OU

POST /leads/bulk-assign-owner

Assign an owner to multiple leads at once. This is useful when routing a batch of leads to a sales rep or reassigning leads in bulk.

Request Body

FieldTypeRequiredDescription
lead_idsarray of stringsYesList of lead IDs to assign. Maximum 500 per request.
owner_idstring or nullNoUser ID of the owner. Send null to unassign all.
owner_namestring or nullNoDisplay name of the owner
{
"lead_ids": ["ld_001", "ld_002", "ld_003"],
"owner_id": "user_abc123",
"owner_name": "Jane Smith"
}

Response

200 OK

{
"status": "ok",
"affected": 3
}
FieldTypeDescription
statusstringAlways "ok" on success
affectedintegerNumber of leads that were updated

Example

curl -X POST "https://api.kenbun.io/leads/bulk-assign-owner" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"lead_ids": ["ld_001", "ld_002", "ld_003"],
"owner_id": "user_abc123",
"owner_name": "Jane Smith"
}'

Common Errors

StatusMeaningSolution
400Bad Requestlead_ids is empty or exceeds the 500-lead limit
401UnauthorizedCheck authentication credentials

Notes

  • Owner assignment is OU-scoped to the active Organizational Unit
  • Both endpoints create an audit log entry recording the assignment action
  • The owner_name field appears in lead list views and can be used for filtering
  • Bulk assignment processes all leads in a single transaction for consistency