> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seekout.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Entity resolution

> Turn company, title, and location names into entity ids, then search on exact entities.

`POST /v2/search/entities/canonical-resolutions` turns names, such as a company, a title or a location, into entity ids. Search on an id and you get that exact entity, not every record whose text happens to match.

## Resolve a batch of names

Send up to 25 lookups in one request. Each has an `entity_type` and exactly one `name`, or an `entity_id` from an earlier lookup to confirm it still resolves (a merged id answers the entity that replaced it). `region` is required and locations are checked against it, so use the region you will search. The `Idempotency-Key` header is required: it is what makes the request safe to retry without paying twice.

```bash theme={null}
curl --request POST "https://developer-api.seekout.io/v2/search/entities/canonical-resolutions" \
  --header "Authorization: Bearer $SEEKOUT_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $(uuidgen)" \
  --data '{
    "schema_version": "public_canonical_entity_lookup_request.v2",
    "region": "north_america",
    "requests": [
      { "entity_type": "company", "name": "Example Co" },
      { "entity_type": "title", "name": "Software Engineer" }
    ]
  }'
```

A `200` carries one result per lookup; `selector_index` is its position in your `requests`. Below, the company resolved and the title matched more than one entity. Each candidate carries `entity_id`, the numeric entity id. Use it in the matching supported entity-id search filter.

```http theme={null}
HTTP/1.1 200 OK

{
  "schema_version": "public_canonical_entity_lookup_response.v2",
  "results": [
    {
      "selector_index": 0,
      "entity_type": "company",
      "status": "resolved",
      "selected": {
        "entity_id": 15,
        "entity_type": "company",
        "display_name": "Example Co"
      },
      "candidates": []
    },
    {
      "selector_index": 1,
      "entity_type": "title",
      "status": "selection_required",
      "selected": null,
      "candidates": [
        { "entity_id": 10, "entity_type": "title", "display_name": "Software Engineer" },
        { "entity_id": 40, "entity_type": "title", "display_name": "Software Engineer II" }
      ]
    }
  ]
}
```

The response also carries a `billing` object that reports what the lookup charged. Current rates are available to signed-in accounts in the console.

## Result statuses

| Status | What to do |
| - | - |
| `resolved` | Use `selected.entity_id` |
| `selection_required` | The name matches more than one entity. Pick one from `candidates`; the API does not guess. `max_candidates` (1 to 5, default 5) caps the list |
| `not_found` | Nothing matches. Check the spelling and `entity_type`, or search on the text filter (`current_companies`, `skills`, and so on) instead |

`entity_type` is one of `company`, `title`, `skill`, `school`, `location`, `major`, `degree`, `certification` or `industry`. A name may be up to 256 characters.

## Search on the ids

Put each id in the matching filter of a [candidate search](https://docs.seekout.com/developer-platform/guides/search.md). Text filters such as `current_companies` still work beside them. Entity-id filters accept entity ids as integers or canonical decimal strings, including in nested filters. Each id must match the filter's entity type. One filter takes up to 200 ids but only 25 names, so resolve a longer list of names, such as every company in a sector, a batch at a time and search on the ids.

| Entity type | Search filter |
| - | - |
| `company` | `current_company_ids`, `past_company_ids` |
| `title` | `current_title_ids`, `past_title_ids` |
| `location` | `location_ids` |
| `skill` | `skill_ids` |
| `school` | `school_ids` |
| `industry` | `industry_ids` |
| `degree` | `degree_ids` |
| `major` | `major_ids` |
| `certification` | `certification_ids` |

```bash theme={null}
curl --request POST "https://developer-api.seekout.io/v2/candidates/search" \
  --header "Authorization: Bearer $SEEKOUT_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $(uuidgen)" \
  --data '{
    "schema_version": "public_developer_candidate_search_request.v2",
    "include": "preview",
    "searches": [{
      "source": "public",
      "query": {
        "regions": ["north_america"],
        "current_company_ids": [15],
        "current_title_ids": [10]
      }
    }]
  }'
```

Numeric ids must be at most 2147483647. Canonical decimal strings contain digits only and no leading zeroes, except for `0` itself. Zero is valid only for degree and industry ids; other entity types require a positive id. An id may resolve through an unambiguous redirect to the current entity. Unknown, ambiguous or wrong-type ids are refused with reason `entity_id_not_usable`.

The first search response can include `entity_resolution.resolved_entities` for resolved names. Entries include the `entity_id` and `search_index`, the zero-based position in `searches`. `entity_resolution.fallback` entries also carry `search_index` to identify which search used the fallback. Continuation pages do not repeat these details.

The search is billed exactly like a candidate search, and the ids add no lookup charge. Follow `pagination.cursor` to the next page as described in the [Search guide](https://docs.seekout.com/developer-platform/guides/search.md).

## Billing and retries

Each successful request is one entity lookup unit, however many names it carries or results it returns. A batch where nothing was found, or an empty list of suggestions, is still a completed lookup.

* Reuse the same `Idempotency-Key` to retry: inside 24 hours the stored answer comes back with `reused: true` and nothing is charged again.
* Reusing a key with a different body is `409`. Generate a new key for different work.
* Keep the original key after a timeout or a `503`. A fresh key is new work and is charged as such.
* Your key's access to the source and region is checked again before a stored answer is returned.

## Failures worth handling

| Status | Code | What to do |
| - | - | - |
| `402` | `insufficient_credits` | Add credits, then retry with a new idempotency key: the old key replays this refusal for 24 hours. Nothing was charged |
| `403` | Not applicable | The key needs the Candidates Search access set, and your organization must be enabled for the source and region you asked for |
| `409` | `idempotency_conflict` | The idempotency key was already used with a different body |
| `422` | Not applicable | The body breaks a rule on this page, such as a field the source does not support or a region on a non-public source |
| `429` | Not applicable | Wait for `Retry-After`, then retry with the same key |
| `503` | Not applicable | Lookup is temporarily unavailable. Nothing was charged; retry after `Retry-After` with the same key |

See the [API reference overview](https://docs.seekout.com/developer-platform/api-overview.md) for the generated page of each operation. To suggest values while someone types, see [Autosuggest](https://docs.seekout.com/developer-platform/guides/autosuggest.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.