lads_get_dmp_segment
LinkedIn Ads read low risk
Part of the LinkedIn Audience Agent.
What it does
Fetch one DMP segment by id: GET /rest/dmpSegments/{id}. Returns name, account, type, accessPolicy, sourcePlatform, sourceSegmentId, created/lastModified (epoch ms), inputCount (number of users/companies the source pushed), and destinations[] with status (BUILDING/READY) and destinationSegmentId=urn:li:adSegment:{id}. Compare inputCount against the >=300 match floor to explain why a segment is / isn't serving (note: inputCount is uploaded count, not matched count — matched is always <= inputCount). Read-only.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
segment_id | string | yes | Numeric DMP segment id (the long, NOT the adSegment URN). Strip any urn: prefix; if given urn:li:adSegment use the corresponding dmpSegment id. |
Safeguards
Policy
Return segment detail only for a segment under the bearer's scoped account; do not expose inputCount or membership for accounts the bearer is not authorized for.
Reminder
inputCount/membership is sensitive — surface counts only, never member identifiers, and do not retain them.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
NOT_FOUND | Entity with key {id} is not found (404). | Confirm the numeric segment id (not the adSegment URN); surface to user. | no |
PERMISSION_DENIED | No read access to the owning account or missing rw_dmp_segments (403). | Verify account role/scope; re-auth if needed (needs_reauth). | no |
INVALID_ARGUMENT | Segment id is not a number (400). | Pass the numeric id, not the urn:li:adSegment value. | no |
TOKEN_REVOKED | Token expired/revoked (401). | Refresh and retry once; else re-auth. | yes |
RESOURCE_EXHAUSTED | Rate limit (429). | Backoff 5/10/20s cap 60s; respect Retry-After. | yes |
PLATFORM_ERROR | LinkedIn 5xx. | Retry with backoff. | yes |
Edge cases
- Segment still BUILDING -> destinations[].destinationSegmentId may be missing; report status.
- inputCount below 300 -> explain the segment cannot serve yet (and matched count is <= inputCount, so it may still be short even if inputCount >=300).
- User passes the urn:li:adSegment URN instead of the numeric dmpSegment id -> 400/404; normalize/explain.
- Empty/zero inputCount on a newly created segment is normal — return success.
- The segment names its owning ad account: when that account is turned off for Claude (or not connected), the read returns account_forbidden and nothing from the segment.