## TL;DR
The agent's round-robin roster contains an email that is not an active HubSpot owner, so assignment fails and leads land with no owner at all. Validate each roster entry against the owners API before assigning, fall back to a default queue owner with an alert when validation fails, and fix the roster so the miss does not repeat.

## The query

```text
hubspot owners API 'no owner found for email'  -  agent's round-robin assignment fell back to nobody
```

## Steps

### 1. List the actual owners from the HubSpot owners API
Fetch the current owner list from the owners API and compare it against the agent's round-robin roster. Note every roster email with no matching active owner: deactivated users, typos, and people who changed teams.

Expected: a diff showing exactly which roster entries are invalid.

### 2. Repair the roster
Remove or replace the invalid entries. For reps who left, decide deliberately whether their leads redistribute to the team or to a specific replacement. Do not just delete entries and shrink the rotation silently.

Expected: every roster entry matches an active owner.

### 3. Validate before every assignment
Add a pre-assignment check: confirm the chosen owner exists in the cached owner list (refreshed daily) before writing it to the contact. Cache the list rather than calling the API per assignment.

Expected: no assignment is attempted for a nonexistent owner.

### 4. Fall back to a queue owner with an alert on any miss
If validation ever fails despite the roster fix, assign a default queue owner so the lead is never ownerless, and alert the operator with the bad email. Ownerless leads are invisible leads.

Expected: every lead has an owner and every fallback triggers an alert.

## Use this when

- HubSpot owner assignment fails with no owner found for email
- Round-robin assigns leads that end up with no owner
- A rep left or changed email and the roster was never updated

## Not for this skill when

- HubSpot calls fail with 429 (that is rate limiting)
- Contact creation fails validation on other properties
- The owner exists but lacks permission for the record

## Variant phrasings

### hubspot no owner found for email
Short form. Same roster-diff fix.

### hubspot round robin assigning to missing owner
Mechanism phrasing. The pre-assignment validation is the guardrail.

### leads ending up with no owner hubspot agent
Symptom phrasing. Step 4 guarantees no lead stays ownerless.

## Why it happens
HubSpot owners are tied to users, and users churn: reps leave, emails change, seats get deactivated. The agent's round-robin roster is a static list nobody updates, so it keeps nominating ghosts. HubSpot rejects the assignment, the agent has no fallback, and the lead sits ownerless, which usually means it sits untouched.

## Edge cases

- An owner can exist but be deactivated. Match on active status, not just email presence.
- Email case differences can cause misses in naive comparisons. Normalize case on both sides before matching.
- If the whole roster is stale after a reorg, rebuild it from the owners API rather than patching entries one by one.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_VQ1_svutao1w5HOZhQh8uw
