Carousel Ads API

Warning

Deprecation Notice
The Marketing Version 202311 (Marketing November 2023) and earlier versions (excluding 202306 and 202307) have been sunset. Additionally, the unversioned APIs will be sunset soon. We recommend that you migrate to the versioned APIs as well as migrate to the new Content and Community Management 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.

You can create and manage Carousel Ad content inline while publishing a creative using the Posts API with images assets uploaded via the Images API. You can also create a Carousel Ad using the Creatives API and using a Post with Carousel content inline.

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_socialads 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.

    Prerequisite

    Any assets (for example, images) must be uploaded via Images API.

    Workflow

    1. Upload Carousel image assets via Images API.
    2. Create Carousel content
    3. Get Carousel content
    4. Batch Get Carousel content

    Schema

    Field Type Details Required
    id CarouselUrn (Read-Only) The URN of the carousel content read-only
    cards CarouselCard The array of cards in the carousel required

    Cards

    Field Type Details/Notes/Values Required
    landingPage URL The web page that can be associated with the content and is opened when the member clicks on the content. For example, if the content is an image and the landing page is a web page then clicking on the image will take the member to the web page. If empty, then there is no landing page associated with the content. required
    media MediaContent The media contained in the card. Only supports images. required

    Media

    Field Type Details Required
    id ImageUrn The id of the media required
    altText string The alternative text for the media. None if empty. Must be less than 4086 characters in length. optional
    title string The title for media. None if empty. Must be less than 400 characters in length. required

    Carousel posts must be sponsored and are not intended to be a regular post.

    Sample Request

    POST https://api.linkedin.com/rest/posts
    
    {
     "author": "urn:li:organization:2414183",
       "adContext": {
           "dscAdAccount": "urn:li:sponsoredAccount:508915158",
           "dscStatus": "ACTIVE"
       },
     "commentary": "sample commentary",
     "visibility": "PUBLIC",
     "distribution": {
       "feedDistribution": "NONE",
       "targetEntities": [],
       "thirdPartyDistributionChannels": []
     },
     "lifecycleState": "PUBLISHED",
     "isReshareDisabledByAuthor": false,
     "content": {
         "carousel": {
             "cards": [
                 {"media": {
                     "id": "urn:li:image:C4E22AQGX_uq7mQBfAA",
                     "title": "first card"
                 },
                 "landingPage": "http://www.linkedin.com/"
                 },
                 {"media": {
                     "id": "urn:li:image:C4E22AQGX_uq7mQBfAA",
                     "title": "second card"
                 },
                 "landingPage": "http://www.linkedin.com/"
                 }
             ]
         }
     },  
    "contentLandingPage": "http://www.linkedin.com/contentLandingPage"
    }
    

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

    You can retrieve carousel content associated with a Post by performing a GET operation to the Posts API on a post that was created with carousel content. Example post ID: urn:li:ugcPost:6914373086788128769

    GET https://api.linkedin.com/rest/posts/{postId}
    

    Sample Response

    {
       "lifecycleState": "PUBLISHED",
       "lastModifiedAt": 1648516563685,
       "visibility": "PUBLIC",
       "publishedAt": 1648515006906,
       "author": "urn:li:organization:1234567",
       "distribution": {
           "feedDistribution": "NONE",
           "thirdPartyDistributionChannels": []
       },
       "content": {
           "carousel": {
               "cards": [
                   {
                       "landingPage": "http://www.linkedin.com/",
                       "media": {
                           "title": "first card",
                           "taggedEntities": [],
                           "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                       }
                   },
                   {
                       "landingPage": "http://www.linkedin.com/",
                       "media": {
                           "title": "second card",
                           "taggedEntities": [],
                           "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                       }
                   }
               ]
           }
       },
       "lifecycleStateInfo": {
           "isEditedByAuthor": false
       },
       "contentLandingPage": "http://www.linkedin.com/contentLandingPage",
       "isReshareDisabledByAuthor": false,
       "createdAt": 1648515006906,
       "id": "urn:li:ugcPost:6914373086788128769",
       "commentary": "sample commentary",
       "adContext": {
           "dscStatus": "ACTIVE",
           "dscAdType": "CAROUSEL",
           "isDsc": true,
           "dscAdAccount": "urn:li:sponsoredAccount:508915158"
       }
    }
    

    You can fetch multiple posts with carousel content by providing multiple post IDs.

    GET https://api.linkedin.com/rest/posts?ids=List({encoded postId},{encoded postId})
    

    Sample Response

    {
       "results": {
           "urn:li:ugcPost:6914374851449270272": {
               "lifecycleState": "PUBLISHED",
               "lastModifiedAt": 1648515427782,
               "visibility": "PUBLIC",
               "publishedAt": 1648515427701,
               "author": "urn:li:organization:1234567",
               "distribution": {
                   "feedDistribution": "NONE",
                   "thirdPartyDistributionChannels": []
               },
               "content": {
                   "carousel": {
                       "cards": [
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "first card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           },
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "second card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           }
                       ]
                   }
               },
               "lifecycleStateInfo": {
                   "isEditedByAuthor": false
               },
               "contentLandingPage": "http://www.linkedin.com/contentLandingPage",
               "isReshareDisabledByAuthor": false,
               "createdAt": 1648515427701,
               "id": "urn:li:ugcPost:6914374851449270272",
               "commentary": "sample commentary",
               "adContext": {
                   "dscStatus": "ACTIVE",
                   "dscAdType": "CAROUSEL",
                   "isDsc": true,
                   "dscAdAccount": "urn:li:sponsoredAccount:508915158"
               }
           },
           "urn:li:ugcPost:6914373086788128769": {
               "lifecycleState": "PUBLISHED",
               "lastModifiedAt": 1648516563685,
               "visibility": "PUBLIC",
               "publishedAt": 1648515006906,
               "author": "urn:li:organization:1234567",
               "distribution": {
                   "feedDistribution": "NONE",
                   "thirdPartyDistributionChannels": []
               },
               "content": {
                   "carousel": {
                       "cards": [
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "first card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           },
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "second card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           }
                       ]
                   }
               },
               "lifecycleStateInfo": {
                   "isEditedByAuthor": false
               },
               "contentLandingPage": "http://www.linkedin.com/contentLandingPage",
               "isReshareDisabledByAuthor": false,
               "createdAt": 1648515006906,
               "id": "urn:li:ugcPost:6914373086788128769",
               "commentary": "sample commentary",
               "adContext": {
                   "dscStatus": "ACTIVE",
                   "dscAdType": "CAROUSEL",
                   "isDsc": true,
                   "dscAdAccount": "urn:li:sponsoredAccount:508915158"
               }
           }
       },
       "statuses": {
           "urn:li:ugcPost:6914374851449270272": 200,
           "urn:li:ugcPost:6914373086788128769": 200
       },
       "errors": {}
    }
    

    References