Document Ads API

LinkedIn Document Ads are a type of Sponsored Content that allow advertisers to promote documents directly in the LinkedIn feed. Members can read and download the document content without leaving LinkedIn.

You can create and manage Document Ads with the external Creatives API.

Note

If the creative is associated with a Campaign with the Lead Generation objective, we do not allow the reuse of the same underlying post or document for multiple creatives. If the same asset needs to be used in multiple creatives, it needs to be uploaded multiple times.

Try in Postman

Permissions

Permission Description
w_organization_social Post, comment and like posts on behalf of an organization. Restricted to organizations in which the authenticated member has one of the following company page roles:
  • ADMINISTRATOR
  • DIRECT_SPONSORED_CONTENT_POSTER
  • CONTENT_ADMIN
  • r_organization_social Retrieve organizations' posts, comments, and likes. Restricted to organizations in which the authenticated member has one of the following company page roles:
  • ADMINISTRATOR
  • DIRECT_SPONSORED_CONTENT_POSTER
  • CONTENT_ADMIN
  • w_member_social Post, comment and like posts on behalf of an authenticated member.
    r_member_social (Restricted) Retrieve posts, comments, and likes on behalf of an authenticated member. This is a restricted permission.

    See Account Access Controls for more information on company page roles.

    Prerequisites

    Any assets (e.g. documents) must be uploaded via Documents API.

    Workflow

    1. Upload Document assets via Documents API
    2. Create a new Post content.
    3. Create a new Creative referencing the Post content (alternatively, a post can be created inline with the creative).

    Note

    Ensure you include the request header "Content-Type": "application/json"

    API Schema

    Document Ads are similar to existing Article, Image and Video ads as they require a UGC post to be created. The only difference is that for Article, Image and Video ads we set the reference to the UGC post inside the content field. For Document Ads, the content field requires a documentAd object with the following field.

    Field Name Type Description Required
    reference String URN identifying the content which will be sponsored in this creative. It can be a share or ugcPost Urn. Yes
    gatedLeadgenPreviewPageCount Int The number of pages to include in the gated preview. The preview will begin at page 1. This field is only applicable to LeadGen content. No

    Note

    Make sure you include the request header "Content-Type": "application/json".

    Sample Request

    POST https://api.linkedin.com/rest/posts
    
    {
       "adContext": {
           "dscAdAccount": "urn:li:sponsoredAccount:508915158",
           "dscStatus": "ACTIVE"
       },
      "author": "urn:li:organization:5515715",
      "commentary": "Sample Document Post",
      "visibility": "PUBLIC",
      "distribution": {
        "feedDistribution": "NONE"
        "thirdPartyDistributionChannels": []
      },
      "content":{
        "media":{
          "title":"title of the document",
          "id": "urn:li:document:C5F10AQGKQg_6y2a4sQ"
          }
        },
      "lifecycleState": "PUBLISHED",
      "isReshareDisabledByAuthor": true
    }
    

    A successful response returns a 201 Created HTTP status code and the ID in the x-linkedin-id response header.

    Create a Document Ad with an Inline Post

    You can directly create a sponsored document post that will not show to Company Page followers but will be directly sponsored to target LinkedIn members' news feeds.

    1. Create a Document campaign. For more information, see Create a Campaign.
    2. Create a Document Creative with inlineContent. You can pass the gatedLeadgenPreviewPageCount to the content.documentAd object if needed.