lads_get_targeting_entities
LinkedIn Ads read low risk
Part of the LinkedIn Audience Agent.
What it does
Resolves concrete targeting entities for a given facet via GET /rest/adTargetingEntities. Supports q=typeahead (search entities matching a query string within one facet) and q=adTargetingFacet (list all entities for a facet; it takes no query, and a facet with more than 1,000 entries, e.g. titles or skills, returns invalid_argument: search it by typeahead instead). Returns entity URNs + display names ready to drop into a campaign's targetingCriteria, as values under the facet's URN in an include.and[].or or in exclude.or. This is the generic resolver behind the specific list_* helpers (industries, seniorities, titles, skills, geo, companies).
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
facet | urn:li:adTargetingFacet|string | yes | Facet to resolve (from lads_get_targeting_facets): a plain URN (urn:li:adTargetingFacet:skills), an already percent-encoded URN (urn%3Ali%3AadTargetingFacet%3Askills) or the short name ('skills') are all accepted; Scalix percent-encodes it exactly once for Rest.li 2.0. |
finder | enum(typeahead|adTargetingFacet) | no | typeahead (default when query given) searches; adTargetingFacet lists all entities for the facet and takes no query (with a query, or over 1,000 entries, it returns invalid_argument: use typeahead). Must match a finder the facet supports. |
query | string|array<string> | no | Search text for typeahead (e.g. 'soft' -> Software entities). Required when finder=typeahead. Or a LIST of up to 20 terms, resolved in parallel in one call: one row per term, {query, elements} or {query, error} — use it instead of one call per term. |
locale | string | no | Locale for entity names, e.g. 'en_US', 'de-DE' or 'fr' (country defaults to US); sent as locale=(language:xx,country:YY). Default en/US. |
start | integer | no | Keyword search (typeahead) only: the result to start from, for the next page. An answer with more to come carries next_start (with a list query, on each row). The whole-facet listing is not paged, so start or count with finder=adTargetingFacet is refused. |
count | integer | no | Keyword search (typeahead) only: results per page (LinkedIn's default is 10; it answered 1,000 in one call, probe 1 Oct 2026). |
Safeguards
Policy
Entity resolution must support compliant targeting only: for employment/housing/education/credit ads, do not resolve entities used to target or exclude protected attributes; never use Groups for exclusion in those verticals; age is disabled for recruitment.
Reminder
Resolved entities feed targeting that must obey anti-discrimination rules and the 300-member minimum to serve.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | A facet LinkedIn does not know, or one the finder cannot query: LinkedIn answers 400 "Specified facet is not available for the finder being used", returned as invalid_argument. | Pick the facet's URN and a finder it supports (availableEntityFinders) from lads_get_targeting_facets, then call again. | no |
MISSING_QUERY | q=typeahead requires a non-empty query string. | Provide a query, or use finder=adTargetingFacet to list all entities. | no |
TOKEN_REVOKED | Token expired/revoked (HTTP 401). | Refresh once and retry; else needs_reauth. | yes |
PERMISSION_DENIED | Missing r_ads scope (HTTP 403). | Request r_ads. | no |
RATE_LIMITED | Daily quota exceeded (HTTP 429). | Exponential backoff 5/10/20s cap 60s honoring X-RateLimit-Reset. | yes |
PLATFORM_UNAVAILABLE | LinkedIn returned a 5xx. | Retry with backoff. | yes |
Edge cases
- typeahead with no matches -> success with an empty elements list (with a list query, that term's row has elements []).
- adTargetingFacet returns the whole facet in one unpaged response; a facet over 1,000 entries (titles, skills...) returns invalid_argument: search it with typeahead instead.
- The facet may be a short name, a plain URN or an already percent-encoded URN; Scalix encodes it exactly once.
- Some facets are typeahead-only and reject adTargetingFacet listing (and vice versa): LinkedIn's 400 comes back as invalid_argument pointing to lads_get_targeting_facets, which names each facet's finders.
- Display names are localized; URNs are the stable key for targetingCriteria.
- Expired token -> refresh and retry once.