Transactional calls with LinkedIn Ads audiences

The connection proxy lets you call LinkedIn’s API directly through a Polytomic LinkedIn Ads Connection. Polytomic authenticates the request and injects the required LinkedIn headers automatically — you only need to supply the method, path, and body.

Set your Polytomic API key as an environment variable:

export POLYTOMIC_API_KEY=YOUR-API-TOKEN
Proxy info

Call GET /api/connections/{id}/proxy/info to inspect the inherited base URL, locked headers, allowed methods, and rate limits before building requests dynamically.

1. Get a DMP segment

Retrieve a single DMP segment by ID.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "GET",
"path": "/dmpSegments/11204"
}
}'

2. Get multiple DMP segments

Retrieve several segments in one call using LinkedIn’s ids=List(...) query syntax. Use rawQuery instead of query for non-standard query strings like this one.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "GET",
"path": "/dmpSegments",
"rawQuery": "ids=List(10804,10814)"
}
}'

3. Add or remove a company audience member

Add or remove a single company from a DMP segment.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "POST",
"path": "/dmpSegments/10804/companies",
"body": {
"action": "ADD",
"companyName": "LinkedIn",
"companyWebsiteDomain": "linkedin.com",
"companyPageUrl": "www.linkedin.com/company/linkedin",
"stockSymbol": "MSFT",
"industries": ["information technology", "software"],
"city": "Seattle",
"state": "WA",
"country": "US"
}
}
}'

4. Batch add or remove companies

Add or remove multiple companies in a single request. Pass X-RestLi-Method: BATCH_CREATE as a per-request header via request.headers.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "POST",
"path": "/dmpSegments/10804/companies",
"headers": {
"X-RestLi-Method": "BATCH_CREATE"
},
"body": {
"elements": [
{"action": "ADD", "companyName": "LinkedIn"},
{"action": "ADD", "companyName": "Microsoft"}
]
}
}
}'

5. Batch add or remove users

Add multiple users to a segment in one request. Each element can carry one or more identity types (SHA256_EMAIL, GOOGLE_AID, etc.) and optional profile attributes.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "POST",
"path": "/dmpSegments/10804/users",
"body": {
"elements": [
{
"action": "ADD",
"userIds": [
{"idType": "SHA256_EMAIL", "idValue": "692682111bc191d915ac7009d118a78bc496cf7a2ba8c2d0134ade012ac1234"},
{"idType": "GOOGLE_AID", "idValue": "cffg876e-gm9v-98de-0013d927s873"}
]
},
{
"action": "ADD",
"userIds": [
{"idType": "SHA256_EMAIL", "idValue": "09d118a78b69261bc191d915ac70c496cf7a9e0502ba8c2d016f2f134ade"},
{"idType": "GOOGLE_AID", "idValue": "cdda802e-12cd-fb9c-47ad-0794d394c912"}
],
"firstname": "mike",
"lastname": "smith"
}
]
}
}
}'

6. Add or remove a single user

Add or remove one user from a segment, optionally including profile attributes to improve match rates.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "POST",
"path": "/dmpSegments/10804/users",
"body": {
"action": "ADD",
"userIds": [
{"idType": "SHA256_EMAIL", "idValue": "09d118a78b69261bc191d915ac70c496cf7a9e0502ba8c2d016f2f134ade"},
{"idType": "GOOGLE_AID", "idValue": "cdda802e-fb9c-47ad-0794d394c912"}
],
"firstname": "mike",
"lastname": "smith",
"titleName": "software engineer",
"companyName": "microsoft",
"countryName": "us"
}
}
}'

7. Create a DMP segment

Create a new DMP segment and associate it with a LinkedIn Ads account.

curl --request POST \
--url "https://app.polytomic.com/api/connections/${LINKEDIN_CONNECTION_ID}/proxy" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "X-Polytomic-Version: 2025-09-18" \
--header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
-d '{
"request": {
"method": "POST",
"path": "/dmpSegments",
"body": {
"name": "DMP Segment 1",
"sourcePlatform": "DMP_PARTNER_PLATFORM",
"account": "urn:li:sponsoredAccount:516848833",
"type": "USER",
"destinations": [
{"destination": "LINKEDIN"}
]
}
}
}'