Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Warning
Deprecation Notice The Marketing Version 202411 (Marketing November 2024) has been sunset. We recommend that you migrate to the latest versioned APIs to avoid disruptions. See the Migration page for more details. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.
When serving Sponsored Content off network, LinkedIn offers a way for advertisers to opt out of serving certain sites and mobile applications. Manage mobile application restrictions using mobile IAB (Interactive Advertising Bureau) categories and desktop and mobile web restrictions by domains.
Additionally you can also create an allowlist of domains and mobile applications and option to serve only on those sites and mobile applications.
Permissions
| Permission | Description |
|---|---|
| rw_ads | Manage and read an authenticated member's ad accounts. Restricted to ad accounts in which the authenticated member has one of the following ad account roles.
|
| r_ads | Read an authenticated member's ad accounts. Restricted to ad accounts in which the authenticated member has one of the following ad account roles.
|
See Account Access Controls for more information on ad account roles.
Manage IAB Categories
- Create A Campaign With IAB Category Exclusions
- Update IAB Category Exclusions In An Existing Campaign
- Delete IAB Category Exclusions From A Campaign
- Disable Offsite Sponsored Content Delivery
Request Body Fields
| Field Name | Type | Description |
|---|---|---|
| offsitePreferences | optional iabCategories | The set of IAB categories that this campaign may be excluded from based on where the ad request is from. Mobile Apps, Mobile Web, and Desktop inventory are all classified into one or more of these categories. |
| offsitePreferences.iabCategories.exclude | optional IABCategoryUrn[] | Excluded list of IAB categories. |
| offsiteDeliveryEnabled | boolean | Allow this campaign access to be served on the LinkedIn Advertising Network |
Create a Campaign with IAB Category Exclusions
To exclude a campaign from certain websites or applications, enter an IAB category URN in the exclusion list of offsitePreferences. Generate an IAB category URN using the iabCategory API, and append it to urn:li:iabCategory:.
As these categories don't change often, we recommend that you call the iabCategory discovery API, cache the data, and do occasional refreshes.
To add the URN to the excluded list in offsitePreferences, the offsiteDeliveryEnabled flag must be set to true.
POST https://api.linkedin.com/rest/adAccounts/{adAccountId}/adCampaigns
{
//Standard request to create a campaign. See campaign documentation for full samples.
"offsiteDeliveryEnabled":true,
"offsitePreferences":{
"iabCategories":{
"exclude":[
"urn:li:iabCategory:IAB5-3",
"urn:li:iabCategory:IAB1-1"
]
}
}
}
Update IAB Category Exclusions
Add IAB category exclusions through a partial update to an existing campaign.
To add the URN to the excluded list in offsitePreferences, the offsiteDeliveryEnabled flag must be set to true.
POST https://api.linkedin.com/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}
{
"patch": {
"$set": {
"offsiteDeliveryEnabled": true,
"offsitePreferences": {
"iabCategories": {
"exclude": [
"urn:li:iabCategory:IAB5-3",
"urn:li:iabCategory:IAB1-1"
]
}
}
}
}
}
Delete IAB Exclusions
To remove any exclusions, clear the exclude object.
POST https://api.linkedin.com/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}
{
"patch": {
"$set": {
"offsitePreferences": {
"iabCategories": {
"exclude": []
}
}
}
}
}
Disable Offsite Sponsored Content Delivery
If you don't want LinkedIn to serve your content off network, set the offsiteDeliveryEnabled flag on your campaign to false.
Viewing Domain Block/Allow Lists
By using domain block/allow lists, advertisers ensure that their ads are only served to their target audience and excluded/included from certain specific websites. Learn more about uploading a block/allow list within Campaign Manager.
Domain block/allow lists can be uploaded through the Campaign Manager UI as documented here or through the API as documented below in Creating Domain Publisher Lists.
- Get a Campaign with Domain Restricted List
- Get Publisher Restriction List File Details
- Get All Publisher Restriction List File Details by Advertiser Account
- Get Global Publisher Allow List of Domains and Apps
- Get Publisher List File Download URL
- Get Publisher Restriction Files Details Applied at Advertiser Account
Get a Campaign with Domain Restricted List
The following example fetches a Sponsored Update campaign that has offsite serving enabled. The offsite audience excludes/includes some domains. For brevity, the campaign response has been limited to the relevant fields using projection.
Note
A block list is named adPublisherFile in the API and is listed under publisherRestrictionFiles.
Request Body Fields
| Field Name | Type | Description |
|---|---|---|
| offsitePreferences.publisherRestrictionFiles.exclude | optional AdPublisherFileUrn[] | Excluded list of domains |
| offsitePreferences.publisherRestrictionFiles.include | optional AdPublisherFileUrn[] | Included list of domains |
| offsiteDeliveryEnabled | boolean | Allow this campaign access to be served on the LinkedIn Advertising Network |
Sample Request
https://api.linkedin.com/rest/adAccounts/{adAccountId}/adCampaigns/{campaignId}?fields=offsitePreferences,offsiteDeliveryEnabled,type
Sample Response
{
"offsiteDeliveryEnabled": true,
"offsitePreferences": {
"iabCategories": {
"exclude": []
},
"publisherRestrictionFiles": {
"exclude": [
"urn:li:adPublisherFile:1603"
],
"include": [
"urn:li:adPublisherFile:1604"
]
}
},
"type": "SPONSORED_UPDATES"
}
Get Publisher Restriction List File Details
To get more details on the adPublisherFile URN in the previous sample response, make an additional request.
Sample Request
Sample Response
{
"fileName": "Test Block List",
"changeAuditStamps": {
"created": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
},
"lastModified": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
}
},
"dataId": "urn:li:media:/AAMB_wDxAAUAAQAAAAAAAAydAAAAJDc4MzJkMDk4LThkNTMtNDkzZC05NmY0LTk0MDc5YzA3ODJhNQ.csv",
"compressionFormat": "NONE",
"id": 1603,
"entity": "urn:li:sponsoredAccount:506106200",
"type": "BLOCKLIST"
"status": "SUCCESS"
}
Alternatively when you fetch the campaign, you can resolve the adPublisherFile by decorating the URN.
Sample Request
GET https://api.linkedin.com/rest/adAccounts/{adAccountId}/adCampaigns/133066184?projection=(offsitePreferences(publisherRestrictionFiles(exclude*~)),offsiteDeliveryEnabled,type)
Sample Response
{
"offsitePreferences": {
"publisherRestrictionFiles": {
"exclude": [
"urn:li:adPublisherFile:1603"
],
"exclude~": [
{
"fileName": "Test Block List",
"changeAuditStamps": {
"created": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
},
"lastModified": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
}
},
"dataId": "urn:li:media:/AAMB_wDxAAUAAQAAAAAAAAydAAAAJDc4MzJkMDk4LThkNTMtNDkzZC05NmY0LTk0MDc5YzA3ODJhNQ.csv",
"compressionFormat": "NONE",
"id": 1603,
"entity": "urn:li:sponsoredAccount:506106200",
"type": "BLOCKLIST",
"status": "SUCCESS"
}
]
}
},
"offsiteDeliveryEnabled": true,
"type": "SPONSORED_UPDATES"
}
Get All Publisher List File Details by Advertiser Account
Fetch publisher restriction lists by Ad Account.
Sample Request
GET https://api.linkedin.com/rest/adPublisherRestrictions?q=entity&entity=urn:li:sponsoredAccount:506106200
Sample Response
{
"elements": [
{
"fileName": "Test Block List",
"dataId": "urn:li:media:/AAMB_wDxAAUAAQAAAAAAAAydAAAAJDc4MzJkMDk4LThkNTMtNDkzZC05NmY0LTk0MDc5YzA3ODJhNQ.csv",
"changeAuditStamps": {
"created": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
},
"lastModified": {
"actor": "urn:li:unknown:0",
"time": 1501619504000
}
},
"compressionFormat": "NONE",
"id": 1603,
"entity": "urn:li:sponsoredAccount:506106200",
"type": "BLOCKLIST",
"status": "SUCCESS"
}
],
"paging": {
"total": 1,
"count": 10,
"start": 0,
"links": []
}
}
Get Global Publisher Allow List of Domains and Apps
The following example retrieves a URL that can be utilized to perform a basic GET request and retrieve a comprehensive list of domains and apps curated by LAN for displaying ads. You can select from a predefined list of categories to specify the type of publisher list you want to download: either CONNECTED_TELEVISION or WEB_AND_APP, with the default option set to WEB_AND_APP. This list can serve as a reference to reduce the size of allowlists and blocklists created by advertisers, as it contains the superset of publishers. Publishers outside of this list will not have ads displayed to them.
Request Body
| Name | Description | Format | Optional |
|---|---|---|---|
| publisherListType | The global publisher list category specifies the type of publisher list to be downloaded. CONNECTED_TELEVISION / WEB_AND_APP. Default to WEB_AND_APP. | ENUM | YES |
Request Header
| Name | Description | Format | Optional |
|---|---|---|---|
| Content-Type | Content type for the request, must be: application/json | String | NO |
Response Body Fields
| Field Name | Description | Format | Guaranteed in Response |
|---|---|---|---|
| value | Collection for the response data | collection | YES |
| downloadSignedUrl | URL to download block list content | URL | YES |
Sample Request
POST https://api.linkedin.com/rest/globalPublisherList
{
"publisherListType": "WEB_AND_APP"
}
Sample Response
{
"value": {
"downloadSignedUrl": "https://www.linkedin.com/ambry/?x-li-ambry-ep=AQE_0g8A8UiOFgAAAWaEbHjizKrQZ4dPxDltpmPEHS-wdlXITXHYJp7SHZkbeCdS_Tqo077_EpEB1IO-i-m_LZzmIfHXhtGAJj1f1JZ4HOozhzfjZ_U3U7U-jkRm3nt5VXQp2tiDm2GsQbspN4MKhSRjF_zsmPF_XPU4kT5m09_2qSPlMTT40ICFfInn4H8rCygOlxLEX7kuMbjPjRQoogc-VBZuYIHv8q6r2yzjWqoBLzjKYyN79PpJ18DBu08xYnrNufHcuBX9QPCK8lTX_1bt1Rgl-Ml2Fwi13aslsvvBg9dERu0I0TBboKmSx-O4s_V_AwTGz4FDhyjDwvpftCF1D2uSjtkk-4BV6tdaLpn3nupuRY9sl9MleWd08fJ2UR0EOxHz_PbC5e_iPgw3XXpyDvhjreMofoqQ0DFtLZS-T922Y_m-Jv28Uv1C0x4OOKRmTOvcBQgfRy0So2UnwSl1JMaKa9L-WFlQGPCuksnnc81hoh3zUGjW9D01NxJZ2v7RwJOQtCjeEug1Ktb8AGTE7Purpidh_0P867MtAaCQ0YV-h0o61K2sOx_VK4mcPzdF1GikN2m3prO_b8LHjhNtxxEg"
}
}
Download Content of Block/Allow List File
The contents of a Publisher list file can be download through the following API.
Get Publisher List File Download URL
The following API returns a URL where the block/allow list file content can be downloaded.
POST https://api.linkedin.com/rest/adPublisherRestrictions?action=generateRestrictionsDownloadUrl
Request Body
| Name | Description | Format | Optional |
|---|---|---|---|
| publisherRestrictionId | Id of the publisher restriction record | Numeric | NO |
Request Header
| Name | Description | Format | Optional |
|---|---|---|---|
| Content-Type | Content type for the request, must be: application/json | String | NO |
Sample Request
POST https://api.linkedin.com/rest/adPublisherRestrictions?action=generateRestrictionsDownloadUrl
{
"publisherRestrictionId": {id}
}
Sample Response
{
"value": {
"downloadSignedUrl": "https://www.linkedin.com/ambry/?x-li-ambry-ep=AQE_0g8A8UiOFgAAAWaEbHjizKrQZ4dPxDltpmPEHS-wdlXITXHYJp7SHZkbeCdS_Tqo077_EpEB1IO-i-m_LZzmIfHXhtGAJj1f1JZ4HOozhzfjZ_U3U7U-jkRm3nt5VXQp2tiDm2GsQbspN4MKhSRjF_zsmPF_XPU4kT5m09_2qSPlMTT40ICFfInn4H8rCygOlxLEX7kuMbjPjRQoogc-VBZuYIHv8q6r2yzjWqoBLzjKYyN79PpJ18DBu08xYnrNufHcuBX9QPCK8lTX_1bt1Rgl-Ml2Fwi13aslsvvBg9dERu0I0TBboKmSx-O4s_V_AwTGz4FDhyjDwvpftCF1D2uSjtkk-4BV6tdaLpn3nupuRY9sl9MleWd08fJ2UR0EOxHz_PbC5e_iPgw3XXpyDvhjreMofoqQ0DFtLZS-T922Y_m-Jv28Uv1C0x4OOKRmTOvcBQgfRy0So2UnwSl1JMaKa9L-WFlQGPCuksnnc81hoh3zUGjW9D01NxJZ2v7RwJOQtCjeEug1Ktb8AGTE7Purpidh_0P867MtAaCQ0YV-h0o61K2sOx_VK4mcPzdF1GikN2m3prO_b8LHjhNtxxEg"
}
}
Response Body Fields
| Field Name | Description | Format | Guaranteed in Response? |
|---|---|---|---|
| value | Collection for the response data | collection | YES |
| downloadSignedUrl | URL to download publisher list content | URL | YES |
Download Content of the Publisher List File
To download the content of the publisher list file, simply invoke downloadSignedUrl obtained from the previous GET call. The URL is fully qualified including www.linkedin.com part.
GET {downloadSignedUrl}
Get Publisher Restriction Files Details Applied at Advertiser Account
Retrieves the allowlist/blocklist applied at the ad account level. Allows you to view the current publisher restriction files configured for a specific sponsored account. The response provides include lists (allowlists) and exclude lists (blocklists) of publisher file URNs, along with audit information about when the preferences were created and last modified.
Sample Request
Sample Response
{
"offsiteAccountPreferences": {
"publisherRestrictionFiles": {
"include": [
"urn:li:adPublisherFile:11",
"urn:li:adPublisherFile:12"
],
"exclude": [
"urn:li:adPublisherFile:15",
"urn:li:adPublisherFile:16"
]
}
},
"changeAuditStamps": {
"created": {
"time": 1755070193854
},
"lastModified": {
"time": 1755610707430
}
}
}
Response Fields
| Field | Type | Description | Optional |
|---|---|---|---|
| offsiteAccountPreferences | OffsiteAccountPreferences | Offsite account preferences for this account. | No |
| offsiteAccountPreferences.publisherRestrictionFiles | PublisherRestrictionFiles | Contains allowlist/blocklist file URNs. | No |
| offsiteAccountPreferences.publisherRestrictionFiles.include | AdPublisherFileUrn[] | List of publisher file URNs to allow (allowlist). | No |
| offsiteAccountPreferences.publisherRestrictionFiles.exclude | AdPublisherFileUrn[] | List of publisher file URNs to block (blocklist). | No |
| changeAuditStamps | ChangeAuditStamps | Audit stamps tracking last modification (read-only). | No |
| changeAuditStamps.created | Timestamp | Creation time in epoch milliseconds. | No |
| changeAuditStamps.lastModified | Timestamp | Last modification time in epoch milliseconds. | No |
Creating Domain Publisher Lists
The Publisher List APIs provide higher control to advertisers by giving them the ability to define where their ads should or shouldn't appear. You have the ability to disable/enable serving their campaigns from certain apps and websites by creating block/allow lists through the API.
Schema
| Field Name | Type | Description |
|---|---|---|
| uploadSignUrl | URL | URL to upload block list csv file |
| data-binary | file | File details with location that has block list to upload |
| location | string | Location of the uploaded file |
| dataId | media URN | Media URN with details of uploaded file location |
| entity | URN | Sponsored Account URN of the Campaign |
| fileName | string | Description of the uploaded file |
| publisherRestrictionId | numeric | Id of the newly created adPublisherRestrictions record |
| downloadSignedUrl | URL | URL to download the content of uploaded block list file |
| type | ENUM | Type of the uploaded file BLOCKLIST/ALLOWLIST |
Upload Domain Block Lists And Create Restriction
Uploading of a list with blocked/allowed domains and creating a campaign restriction to use it's a multi-step process.
- Please review the CSV template and guidelines in this help center article to prepare a successful publisher list file.
- Obtain a URL to upload the content
- Upload the publisher list file
- Create the publisher restriction
- Please review the CSV template and guidelines in this help center article to prepare a successful publisher list file.
- Obtain a URL to upload the content
- Upload the publisher list file
- Create the publisher restriction
- Apply publisher restriction at ad account level
Obtain a URL to Upload the Content
Use the following API to get the URL where you can upload your publisher restriction list file.
Sample Request
POST https://api.linkedin.com/rest/adPublisherRestrictions?action=generateRestrictionsUploadUrl
Sample Response
{
"value": {
"uploadSignUrl": "https://www.linkedin.com/ambry/?x-li-ambry-ep=AQFFC-Geqr_KYwAAAWZpL87yDFipgwXwWnG72OKIeDoTKqBzpXK_xMYgWYJu_A3dnSqPFUjBY9xhhx3z8FVVzKbwyg6A-ZuMkKJs4cUCnbMZJ4Qz3xug9FwVTGnnqWgB5_BLKr-HP-90a6P2drsm459tSOeuOgNqrsL1P2Cpj7MDuHgV9qqnxbEaxbHeMLHrzk8zVJx4yZTzkEUguBX6PPCOss3uSbzntZt7wk9B5ZtVSdwUd4eOe9hkuKEt78dN9u3KAyoJ3oonnt8sl2Gyvq_X2et6PW5GpHGcnM4Zy16iJIjzffTn5Xp1Im1vp7JSYw5J_eDtJE98-6mgYeOIF0oX8m0-BJF1H0u1j0rIt01t3y-DrGR9EyyDtArc9mMrllrR7SyuuYz0T106yjyxd8mrJVJqWDavo-1kpRTLUGKrQjusTfcIDbbkTWQaW13NSUiZkZsEzJuP1-GBbWuebj1GlZLUaijePOvni3lS8DO9SNqBtF4AUK4KwhuqYvJCrCBkZ5JmktEoPsAq6RJBPlFiFgS1VvXPZ2Xb4KjlnyxdM98NQTdfZcs_1kTo68YDZF-1CwTofXdBJtwXH-R_gGMq0Z74Imh7QwAns5osgp96Tm3qXuvYUF9R0ndXtPrd3DGIOgapJ7XYQZtIlEt9DXkEtwTqFiSvq3USYmQSBHDDaCP-Usfik-ILKgQ8UNWQ2lund8tQeO3yqj-hH2ObI7vRANkH4Q1i-25tVAYjEgmV20tqrRSxZZJfiOy6FxzEhmgxw3xLhkAiSmFDT_2Z9PUZ7HXQDguBcsBqguvvjQW56-ud2S9CEk9cfos3zFcuLr2llHFN6pOW5tgkFxY8nHydcJnNkrSvh_DUvqPcuV2vFi7F5kzRoDDNJ2CkUqCEbyJ0C5AnFvTQm9LgndlJjpvdxyIhIRjPzWjhcLRkiifKpwywQID3WQ0mUOieSypKkUflOPY5Ah7_Gvr38uX6F8kqLQAUd7mDnDrvaVKzTNIuMLaEoJLp5Rs"
}
}
Response Body Fields
| Field Name | Description | Format | Guaranteed in Response? |
|---|---|---|---|
| value | Collection for the response data | collection | YES |
| uploadSignUrl | URL to upload publisher list file | URL | YES |
Upload the Publisher List File
Using the uploadSignUrl from the above request, you can upload the block/allow list file stored in your local computer.
- Find the full file path and name for your block/allow list file.
- Use the following API call to upload the block/allow list csv file.
curl -i {uploadSignUrl} --data-binary @{csv file name}
Sample Request
curl -i "https://www.linkedin.com/ambry/?x-li-ambry-ep=AQFVRiTireeDqQAAAWcaXRMl2JPZd5aIs9gs70cBHxBxCa_Hg6wMRJEf7BuAtu_Xd_JFxrlqay3cGNxqif64gXA4NvTrDhCluxjDaaKkUG066nGIJm-wglQS2a8JzMdwrvJ7el5ATTjbONRv0xVT-dXF0zbej5RblSnuRmpk66Ar8s_dA9EPOhkX0rQiPnUZ967iFutSX0aBINoXE_fOLx1LHKZtx6AfpYZuQ7CnMxDBS-UDnRrJma--O2-vx1MfGN4GRXikFR37EhRFc4z-OiOPSw2z3M6Qv8XfaBrx7J8bS2fVhy2tS4OhfR5jusDm02e_Byhipn_Zm-iiGF9GUkT3CZXOplI83NLr0Tmy6Lb1M4tegVZGIuAe4EBrYCPEhParwe16GQ0J6TDR430M0HRh0KSOJhNQFwI_jQCRFulK0VNXtIXzPGcL90B3SPrk1xzeT5XXKU264BENYBcqJhAJ38rUc4Z75xaJhBR29QMGWYp4QAX9f15W_F7AKdKRUrZ1HkCH1ssCLiOaffSNt0WpOOqfdDR_tUsXGhbqNszEPpLPhHyOT9G-9iEWDvnfWO6KCgjNiZMX46vBl_Ypm53ScwQBoc9UOeGd_dmqLIzMrUSF69ciQW0U91yqficNcWCMZpexEyIiK1PkfvQn4kI0ig2b3YSKswNJuLbezExB2WKh2U9Yamqqf3t46-XP3YBLnmBS_hBLQJOJIbyDAqpYuTxOonHqOOmjHZWkwmso4mQls8Kxh5eMLIyHyMbIScWwHb7T1ZUaBR91P-SDJww3bXalThbDU1RXThKPtgKwPlUqhSrVtGQx0ccsbfzlRtPkSPnnPx6V9RIRLsrFLe_NcELEBXWjDv0VNEkjriExmxKpSPwp5P8DZXlmEg8KN0CTmFUQi4NETUcZ1LkF9PeT5WAKvhdR_XxmOJ7qnrm3rw"
-H 'Authorization: Bearer AQW8ysj2IxGNn_imaWMQazugeb4bhwvTqQ7m1jIeI2Sk1Iop8qz65Ns4-0QgMGuqM9zlV21tP3sbHkLLiiz3DEQoNbxK5XeXdQ69Nzd4aK7qwbNt99T49-bBSrGDFqCAeqXNYP2SXCYsMb1-xDumJCfh1UAtsg5qYwzwlVyIcPmz7yEJq9FQ0rDwHMFB3ls8rg7TXIZCPfxXqpE0abX4A3uPu2ozvMOLP3Dmz-TTOfdTlJv5CzLCyffrHdG57-Xq5Wjq_d_NMi2tM5AB_zOpiZkfKFBh0YiDaG7Ek7Ey9CR1LowFE9SekT74f_K6IhOrYvP1M009iRrs4yKf0OzTsVwFxZeS_A'
--data-binary @BlockList.csv
Sample Response
From the API response, find the value of the location header. This value is used for the media URN while creating the publisher restrictions in the next step.
location: /AAUQBADxAAQAAQAAAAAAABB7AAAAJDBjOTY0ODk5LTMyMTMsfdsBkNS1iMjkyLThmNDJlYjVkNmI4ZQ.csv
Create the Publisher Restriction
Now that the Publisher list file has been uploaded, you can create an adPublisherRestriction to be used in an Ad Campaign.
POST https://api.linkedin.com/rest/adPublisherRestrictions
Request Body Fields
| Name | Description | Format | Optional |
|---|---|---|---|
| dataId | Media URN of the location | URN | NO |
| entity | SponsoredAccount URN | URN | NO |
| fileName | File name | String | NO |
| type | File type BLOCKLIST/ALLOWLIST, BLOCKLIST is default | ENUM | YES |
Request Header
| Name | Description | Format | Optional |
|---|---|---|---|
| Content-Type | Content type for the request, must be: application/json | String | NO |
Sample Request for Allowlist
POST https://api.linkedin.com/rest/adPublisherRestrictions
{
"dataId": "urn:li:media:/AAUQAQCwAAQAAQAAAAAAAADPAAAAJDIxYTllNzllLTQ0Y2EtNDgdfgfd4i05NTcyLTEwYWVmYTgxNWY4Yg.csv",
"entity": "urn:li:sponsoredAccount:518306371",
"fileName": "Allowlist.csv",
"type": "ALLOWLIST"
}
Sample Request for Blocklist
POST https://api.linkedin.com/rest/adPublisherRestrictions
{
"dataId": "urn:li:media:/AAUQAQCwAAQAAQAAAAAAAADPAAAAJDIxYTllNzllLTQ0Y2EtNDgdfgfd4i05NTcyLTEwYWVmYTgxNWY4Yg.csv",
"entity": "urn:li:sponsoredAccount:518306371",
"fileName": "BlockList.csv"
}
Sample Response
The ID of the newly created record can be parsed out of the location header.
location: /adPublisherRestrictions/28424
Apply Publisher Restriction at Ad Account Level
The /adAccountTrustPreferences API is used to manage account-level brand safety controls, specifically allowlists and blocklists for the LinkedIn Audience Network. This API enables you to view and update publisher restrictions (web domains/app store URLs) at the ad account level.
https://api.linkedin.com/rest/adAccountTrustPreferences/{sponsoredAccountId}
Create or update the allowlist/blocklist for an ad account. This endpoint performs an upsert operation, which means if trust preferences don't exist for the account, they will be created. If they already exist, they will be updated with the new values. You can specify publisher restriction files for both include lists (allowlists) and exclude lists (blocklists).
Request Schema
| Field Name | Type | Description | Required |
|---|---|---|---|
| offsiteAccountPreferences | OffsiteAccountPreferences | Account-level offsite preferences configuration | Yes |
| offsiteAccountPreferences.publisherRestrictionFiles | PublisherRestrictionFiles | Publisher restriction files configuration | Yes |
| offsiteAccountPreferences.publisherRestrictionFiles.include | AdPublisherFileUrn[] | List of publisher file URNs to allow (allowlist). Only ads on these domains/apps will be served. | No |
| offsiteAccountPreferences.publisherRestrictionFiles.exclude | AdPublisherFileUrn[] | List of publisher file URNs to block (blocklist). Ads will not be served on these domains/apps. | No |
Request Header
| Name | Description | Format | Optional |
|---|---|---|---|
| Content-Type | Content type for the request, must be: application/json | String | NO |
Sample Request
PUT https://api.linkedin.com/rest/adAccountTrustPreferences/{sponsoredAccountId}
{
"offsiteAccountPreferences": {
"publisherRestrictionFiles": {
"include": [
"urn:li:adPublisherFile:13"
],
"exclude": [
"urn:li:adPublisherFile:12"
]
}
}
}
Sample Response
A successful response returns a 204 No Content HTTP status code.