{"skill":{"slug":"linkedin-community","displayName":"LinkedIn Community","summary":"LinkedIn Community Management API integration with managed OAuth. Manage organization pages, posts, comments, reactions, and analytics. Use this skill when u...","description":"---\nname: linkedin-community-management\ndescription: |\n  LinkedIn Community Management API integration with managed OAuth. Manage organization pages, posts, comments, reactions, and analytics.\n  Use this skill when users want to create or manage LinkedIn posts, comment on posts, react to content, look up organizations, or retrieve follower/page/share statistics.\n  For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\n  Requires network access and valid Maton API key.\nmetadata:\n  author: maton\n  version: \"1.0\"\n  openclaw:\n    emoji: 🧠\n    homepage: \"https://maton.ai\"\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# LinkedIn Community Management\n\nAccess the LinkedIn Community Management API with managed OAuth authentication. Manage organization pages, create and manage posts, comments, reactions, and retrieve analytics.\n\n## Quick Start\n\n```bash\n# Look up an organization by vanity name\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizations?q=vanityName&vanityName=LinkedIn\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n## Base URL\n\n```\nhttps://api.maton.ai/linkedin-community-management/rest/{resource}\n```\n\nThe gateway proxies requests to `api.linkedin.com/rest` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n### Required Headers\n\nAll LinkedIn API requests require these additional headers:\n\n| Header | Value | Description |\n|--------|-------|-------------|\n| `Linkedin-Version` | `YYYYMM` (e.g., `202605`) | API version |\n| `X-Restli-Protocol-Version` | `2.0.0` | Protocol version |\n\n## Connection Management\n\nManage your LinkedIn OAuth connections at `https://api.maton.ai`.\n\n### List Connections\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/connections?app=linkedin-community-management&status=ACTIVE\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n### Create Connection\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/connections\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -d '{\"app\": \"linkedin-community-management\"}'\n```\n\n### Get Connection\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/connections/{connection_id}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"{connection_id}\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"linkedin-community-management\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\ncurl -s -X DELETE \"https://api.maton.ai/connections/{connection_id}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n### Specifying Connection\n\nAlways specify which connection to use with the `Maton-Connection` header to ensure requests go to the intended LinkedIn account:\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/...\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Maton-Connection: {connection_id}\"\n```\n\nIf you have multiple connections, always list them first and confirm the correct one with the user before making requests.\n\n## Security & Permissions\n\n- **All write operations require explicit user confirmation.** Before creating, editing, or deleting a post, comment, or reaction, confirm the target resource, intended content, and the LinkedIn identity (person or organization) with the user.\n- Always verify the intended Maton connection and LinkedIn organization before performing actions.\n- Access is scoped to the organizations and permissions granted to the connected LinkedIn account.\n\n## API Reference\n\n### Current Member Profile\n\n#### Get Current Member\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/me\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n**Response:**\n```json\n{\n  \"localizedLastName\": \"Smith\",\n  \"localizedFirstName\": \"John\",\n  \"id\": \"abc123XYZ\",\n  \"vanityName\": \"john-smith\",\n  \"localizedHeadline\": \"Software Engineer at Acme Corp\"\n}\n```\n\n### People Lookup\n\n#### Get Person by ID\n\nLook up a LinkedIn member's profile by their person ID. The person ID can be obtained from `/rest/me`, `organizationAcls`, post authors, or comment actors.\n\n```bash\ncurl -s -g -X GET \"https://api.maton.ai/linkedin-community-management/rest/people/(id:{personId})\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n**Response:**\n```json\n{\n  \"localizedLastName\": \"Smith\",\n  \"profilePicture\": {\n    \"displayImage\": \"urn:li:digitalmediaAsset:C5603AQFWsrW4dwGzmg\"\n  },\n  \"vanityName\": \"john-smith\",\n  \"lastName\": {\n    \"localized\": {\"en_US\": \"Smith\"},\n    \"preferredLocale\": {\"country\": \"US\", \"language\": \"en\"}\n  },\n  \"firstName\": {\n    \"localized\": {\"en_US\": \"John\"},\n    \"preferredLocale\": {\"country\": \"US\", \"language\": \"en\"}\n  },\n  \"localizedHeadline\": \"Software Engineer at Acme Corp\",\n  \"id\": \"abc123XYZ\",\n  \"headline\": {\n    \"localized\": {\"en_US\": \"Software Engineer at Acme Corp\"},\n    \"preferredLocale\": {\"country\": \"US\", \"language\": \"en\"}\n  },\n  \"localizedFirstName\": \"John\"\n}\n```\n\n**Available fields:** `id`, `firstName`, `lastName`, `vanityName`, `localizedFirstName`, `localizedLastName`, `localizedHeadline`, `headline`, `profilePicture`\n\nYou can request a single field with the `fields` query parameter:\n\n```bash\ncurl -s -g -X GET \"https://api.maton.ai/linkedin-community-management/rest/people/(id:{personId})?fields=localizedHeadline\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n**Notes:**\n- The `(id:{personId})` syntax uses Rest.li composite key format — parentheses are required\n- Use `curl -g` to prevent shell glob expansion of parentheses\n- Non-connected members may return `{\"id\": \"private\"}` with limited data\n- The person ID comes from URNs like `urn:li:person:{personId}` found in org ACLs, post authors, and comment actors\n\n### Organization Operations\n\n#### Find Organization by Vanity Name\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizations?q=vanityName&vanityName={vanityName}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Get Organization by ID (Admin Required)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizations/{organizationId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Get Organization Follower Count\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/networkSizes/urn%3Ali%3Aorganization%3A{orgId}?edgeType=COMPANY_FOLLOWED_BY_MEMBER\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n**Response:**\n```json\n{\n  \"firstDegreeSize\": 33634367\n}\n```\n\n#### Find Administered Organizations\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Find Child Organizations (Brands)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizations?q=parentOrganization&parent=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n### Posts Operations\n\n#### Create a Post\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/posts\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"author\": \"urn:li:organization:{orgId}\",\n    \"commentary\": \"Your post text here\",\n    \"visibility\": \"PUBLIC\",\n    \"distribution\": {\n      \"feedDistribution\": \"MAIN_FEED\",\n      \"targetEntities\": [],\n      \"thirdPartyDistributionChannels\": []\n    },\n    \"lifecycleState\": \"PUBLISHED\",\n    \"isReshareDisabledByAuthor\": false\n  }'\n```\n\nReturns `201` with `x-restli-id` header containing the post URN (e.g., `urn:li:share:123456`).\n\nAuthor can be `urn:li:person:{personId}` for member posts or `urn:li:organization:{orgId}` for organization posts.\n\n#### Create a Post with Media\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/posts\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"author\": \"urn:li:organization:{orgId}\",\n    \"commentary\": \"Check out this video!\",\n    \"visibility\": \"PUBLIC\",\n    \"distribution\": {\n      \"feedDistribution\": \"MAIN_FEED\",\n      \"targetEntities\": [],\n      \"thirdPartyDistributionChannels\": []\n    },\n    \"content\": {\n      \"media\": {\n        \"title\": \"Video title\",\n        \"id\": \"urn:li:video:{videoId}\"\n      }\n    },\n    \"lifecycleState\": \"PUBLISHED\",\n    \"isReshareDisabledByAuthor\": false\n  }'\n```\n\n#### Create an Article Post\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/posts\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"author\": \"urn:li:organization:{orgId}\",\n    \"commentary\": \"Great article on AI\",\n    \"visibility\": \"PUBLIC\",\n    \"distribution\": {\n      \"feedDistribution\": \"MAIN_FEED\",\n      \"targetEntities\": [],\n      \"thirdPartyDistributionChannels\": []\n    },\n    \"content\": {\n      \"article\": {\n        \"source\": \"https://example.com/article\",\n        \"thumbnail\": \"urn:li:image:{imageId}\",\n        \"title\": \"Article Title\",\n        \"description\": \"Article description\"\n      }\n    },\n    \"lifecycleState\": \"PUBLISHED\",\n    \"isReshareDisabledByAuthor\": false\n  }'\n```\n\n#### Get Post by URN\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/posts/{encoded_postUrn}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\nURNs must be URL-encoded: `urn:li:share:123` becomes `urn%3Ali%3Ashare%3A123`.\n\n#### Find Posts by Author (Organization)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/posts?author=urn%3Ali%3Aorganization%3A{orgId}&q=author&count=10&sortBy=LAST_MODIFIED\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"X-RestLi-Method: FINDER\"\n```\n\n**Parameters:**\n\n| Field | Description | Required |\n|-------|-------------|----------|\n| author | Organization or Person URN (URL-encoded) | Yes |\n| q | Must be `author` | Yes |\n| count | Number of results (max 100, default 10) | No |\n| start | Offset for pagination (default 0) | No |\n| sortBy | `LAST_MODIFIED` or `CREATED` | No |\n\n#### Update a Post\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/posts/{encoded_postUrn}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"X-RestLi-Method: PARTIAL_UPDATE\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"patch\": {\n      \"$set\": {\n        \"commentary\": \"Updated post text\"\n      }\n    }\n  }'\n```\n\nReturns `204` on success. Only `commentary`, `contentCallToActionLabel`, `contentLandingPage`, and `lifecycleState` can be updated.\n\n#### Delete a Post\n\n```bash\ncurl -s -X DELETE \"https://api.maton.ai/linkedin-community-management/rest/posts/{encoded_postUrn}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"X-RestLi-Method: DELETE\"\n```\n\nReturns `204` on success.\n\n#### Reshare a Post\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/posts\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"author\": \"urn:li:organization:{orgId}\",\n    \"commentary\": \"Great insights!\",\n    \"visibility\": \"PUBLIC\",\n    \"distribution\": {\n      \"feedDistribution\": \"MAIN_FEED\",\n      \"targetEntities\": [],\n      \"thirdPartyDistributionChannels\": []\n    },\n    \"lifecycleState\": \"PUBLISHED\",\n    \"isReshareDisabledByAuthor\": false,\n    \"reshareContext\": {\n      \"parent\": \"urn:li:share:{originalPostId}\"\n    }\n  }'\n```\n\n### Comments Operations\n\n#### Get Comments on a Post\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_postUrn}/comments\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Get a Specific Comment\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_postUrn}/comments/{commentId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Create a Comment\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_postUrn}/comments\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"actor\": \"urn:li:organization:{orgId}\",\n    \"object\": \"urn:li:activity:{activityId}\",\n    \"message\": {\n      \"text\": \"Your comment text\"\n    }\n  }'\n```\n\nReturns `201` with `x-restli-id` header containing the comment ID.\n\n#### Create a Nested Comment (Reply)\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_commentUrn}/comments\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"actor\": \"urn:li:organization:{orgId}\",\n    \"object\": \"urn:li:share:{shareId}\",\n    \"message\": {\n      \"text\": \"Reply to comment\"\n    },\n    \"parentComment\": \"urn:li:comment:(urn:li:activity:{activityId},{commentId})\"\n  }'\n```\n\n#### Edit a Comment\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_postUrn}/comments/{commentId}?actor=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"X-RestLi-Method: PARTIAL_UPDATE\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"patch\": {\n      \"message\": {\n        \"$set\": {\n          \"text\": \"Updated comment text\"\n        }\n      }\n    }\n  }'\n```\n\n#### Delete a Comment\n\n```bash\ncurl -s -X DELETE \"https://api.maton.ai/linkedin-community-management/rest/socialActions/{encoded_postUrn}/comments/{commentId}?actor=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n### Reactions Operations\n\n#### Create a Reaction\n\n```bash\ncurl -s -X POST \"https://api.maton.ai/linkedin-community-management/rest/reactions?actor=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"root\": \"urn:li:activity:{activityId}\",\n    \"reactionType\": \"LIKE\"\n  }'\n```\n\n**Reaction types:** `LIKE`, `PRAISE` (Celebrate), `EMPATHY` (Love), `INTEREST` (Insightful), `APPRECIATION` (Support), `ENTERTAINMENT` (Funny).\n\n#### Get Reactions on a Post\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/reactions/(entity:{encoded_entityUrn})?q=entity\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Delete a Reaction\n\n```bash\ncurl -s -X DELETE \"https://api.maton.ai/linkedin-community-management/rest/reactions/(actor:urn%3Ali%3Aperson%3A{personId},entity:{encoded_entityUrn})\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\nReturns `204` on success.\n\n### Statistics (Admin Required)\n\nThese endpoints require the authenticated member to be an `ADMINISTRATOR` of the organization.\n\n#### Organization Follower Statistics (Lifetime)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\nReturns follower counts segmented by geo, function, industry, seniority, and staff count range.\n\n#### Organization Follower Statistics (Time-Bound)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganization%3A{orgId}&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start={startMs}&timeIntervals.timeRange.end={endMs}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n`timeGranularityType` can be `DAY`, `WEEK`, or `MONTH`. Timestamps are milliseconds since epoch.\n\n#### Organization Page Statistics (Lifetime)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationPageStatistics?q=organization&organization=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Organization Page Statistics (Time-Bound)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationPageStatistics?q=organization&organization=urn%3Ali%3Aorganization%3A{orgId}&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start={startMs}&timeIntervals.timeRange.end={endMs}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Organization Share Statistics (Lifetime)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganization%3A{orgId}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n**Response:**\n```json\n{\n  \"elements\": [{\n    \"totalShareStatistics\": {\n      \"uniqueImpressionsCount\": 36430528,\n      \"shareCount\": 0,\n      \"engagement\": 0.029,\n      \"clickCount\": 1999920,\n      \"likeCount\": 0,\n      \"impressionCount\": 67703905,\n      \"commentCount\": 0\n    },\n    \"organizationalEntity\": \"urn:li:organization:1337\"\n  }]\n}\n```\n\n#### Organization Share Statistics (Time-Bound)\n\n```bash\ncurl -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganization%3A{orgId}&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start={startMs}&timeIntervals.timeRange.end={endMs}\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n#### Share Statistics for Specific Posts\n\n```bash\ncurl -g -s -X GET \"https://api.maton.ai/linkedin-community-management/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganization%3A{orgId}&shares=List(urn%3Ali%3Ashare%3A{shareId1},urn%3Ali%3Ashare%3A{shareId2})\" \\\n  -H \"Authorization: Bearer $MATON_API_KEY\" \\\n  -H \"Linkedin-Version: 202605\" \\\n  -H \"X-Restli-Protocol-Version: 2.0.0\"\n```\n\n## Pagination\n\nLinkedIn uses offset-based pagination with `start` and `count` parameters:\n\n```bash\nGET /linkedin-community-management/rest/posts?author=...&q=author&count=10&start=0\n```\n\nResponse includes pagination info:\n\n```json\n{\n  \"paging\": {\n    \"start\": 0,\n    \"count\": 10,\n    \"links\": [\n      {\n        \"rel\": \"next\",\n        \"href\": \"/rest/posts?q=author&author=...&count=10&start=10\"\n      }\n    ],\n    \"total\": 500\n  },\n  \"elements\": [...]\n}\n```\n\nUse the `links[].href` with `rel: \"next\"` for the next page, or increment `start` by `count`.\n\n## Mentions and Hashtags\n\n### Mentioning an Organization\n\nUse `@[Display Name](urn:li:organization:{orgId})` syntax in `commentary`:\n\n```json\n{\n  \"commentary\": \"Congrats to @[LinkedIn](urn:li:organization:1337) on the milestone!\"\n}\n```\n\n### Hashtags\n\nUse `#keyword` syntax in `commentary`:\n\n```json\n{\n  \"commentary\": \"Follow best practices #coding #engineering\"\n}\n```\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst baseUrl = 'https://api.maton.ai/linkedin-community-management/rest';\nconst headers = {\n  'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n  'Linkedin-Version': '202605',\n  'X-Restli-Protocol-Version': '2.0.0'\n};\n\n// Find organization by vanity name\nconst response = await fetch(\n  `${baseUrl}/organizations?q=vanityName&vanityName=LinkedIn`,\n  { headers }\n);\nconst data = await response.json();\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nBASE_URL = \"https://api.maton.ai/linkedin-community-management/rest\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['MATON_API_KEY']}\",\n    \"Linkedin-Version\": \"202605\",\n    \"X-Restli-Protocol-Version\": \"2.0.0\"\n}\n\n# Create a post\nresponse = requests.post(\n    f\"{BASE_URL}/posts\",\n    headers={**HEADERS, \"Content-Type\": \"application/json\"},\n    json={\n        \"author\": \"urn:li:organization:12345\",\n        \"commentary\": \"Hello from Python!\",\n        \"visibility\": \"PUBLIC\",\n        \"distribution\": {\n            \"feedDistribution\": \"MAIN_FEED\",\n            \"targetEntities\": [],\n            \"thirdPartyDistributionChannels\": []\n        },\n        \"lifecycleState\": \"PUBLISHED\",\n        \"isReshareDisabledByAuthor\": False\n    }\n)\npost_urn = response.headers.get(\"x-restli-id\")\n```\n\n## Notes\n\n- All URNs in URL path segments and query parameters must be URL-encoded (`:` -> `%3A`)\n- Organization posts require `w_organization_social` permission and an admin role on the org\n- Member posts require `w_member_social` permission\n- Reading member posts requires `r_member_social` (restricted permission)\n- The `Linkedin-Version` header is required on all requests (format: `YYYYMM`, e.g., `202605`). LinkedIn keeps roughly the last ~12 monthly versions active and returns HTTP 426 `NONEXISTENT_VERSION` for retired or future-dated versions — pin to a recent month and bump periodically\n- Post content types: text-only, image (`urn:li:image:{id}`), video (`urn:li:video:{id}`), document (`urn:li:document:{id}`), article\n- Statistics endpoints return data only for administered organizations\n- Share statistics only cover the past 12 months (rolling window)\n- The `MAYBE` (Curious) reaction type is deprecated since version 202307\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain parentheses or brackets to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing LinkedIn connection or invalid request parameters |\n| 401 | Invalid or missing Maton API key |\n| 403 | Insufficient permissions (check org admin role or OAuth scopes) |\n| 404 | Resource not found |\n| 429 | Rate limited |\n| 4xx/5xx | Passthrough error from LinkedIn API |\n\n## Resources\n\n- [LinkedIn Community Management Overview](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/community-management-overview)\n- [Posts API](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api)\n- [Comments API](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/comments-api)\n- [Reactions API](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/reactions-api)\n- [Organization Lookup API](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-lookup-api)\n- [Follower Statistics](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/follower-statistics)\n- [Page Statistics](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/page-statistics)\n- [Share Statistics](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/share-statistics)\n","tags":{"latest":"1.0.2"},"stats":{"comments":0,"downloads":555,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":3},"createdAt":1778097734361,"updatedAt":1779879099661},"latestVersion":{"version":"1.0.2","createdAt":1779879099661,"changelog":"- Removed \"Private Beta\" status and references from documentation.\n- No functional or API changes detected.\n- Documentation is now targeted for general availability.","license":"MIT-0"},"metadata":{"setup":[{"key":"MATON_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"byungkyu","userId":"s174c3s2kc1ehqj1ytzntezj2983e2aj","displayName":"byungkyu","image":"https://avatars.githubusercontent.com/u/16563684?v=4"},"moderation":null}