ZakiPost

Publishing Posts to LinkedIn Through ZakiPost

ZakiPost lets you connect your LinkedIn account, whether it's your personal profile or your LinkedIn Company Page, and automatically publish content to it through the API. Whether you're looking to automate posting text updates, schedule images and videos on LinkedIn, or integrate LinkedIn with your own content management systems, LinkedIn integration with ZakiPost gives you the tools to do this programmatically without repeated manual intervention.

The process is simple and secure: all you need to do is connect your LinkedIn account to our platform through LinkedIn's official OAuth consent screen. Once this step is complete, you'll immediately receive dedicated programmatic access credentials for your account, giving you full freedom to automate publishing to your personal profile, or to your company page if linked, directly from any development environment or programmatic tool you prefer.

1. How It Works From The User's Side

Connecting LinkedIn and publishing content to it comes down to three main steps:

  1. Obtain your account's access credentials (client_key and client_secret) from the API Keys settings page.
  2. Link your LinkedIn account through the "Connect LinkedIn Account" button, the only step where you go through LinkedIn's official consent screen, choosing whether the connection will include company page publishing permissions or be limited to your personal profile only.
  3. Use your access credentials along with the connected account's identifier (linkedin_account_id) to send publish requests from any environment capable of sending HTTP requests, specifying the desired destination: personal profile, company page, or both.

Once these steps are complete, ZakiPost handles all the technical details of working with LinkedIn: refreshing tokens, storing them encrypted, sending the actual publish request to the correct destination, and verifying the result after it's sent.

2. Your Account's API Keys

When you create your ZakiPost account, two keys are automatically generated and permanently linked to it:

KeyDescription
client_keyA public identifier starting with zp_key_, used to identify your account on every request.
client_secretA private authentication key, viewable at any time from your account settings, with the option to regenerate and change it at any time from the same page if you wish.

These two keys are the same keys used across all platforms connected to your account, including LinkedIn. You can always view or copy them at any time from the API Keys settings page. If you suspect your client_secret has been exposed, you can regenerate it from the same page, keeping in mind that any application using the old value will need to be updated immediately. We recommend keeping your keys confidential and never sharing them with untrusted parties.

These keys have nothing to do with your LinkedIn account itself; they're simply the authentication method between you and the ZakiPost server. They must be sent with every publish request through the following two HTTP headers:

X-ZakiPost-Client-Key: zp_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-ZakiPost-Client-Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Since these keys are standard HTTP credentials, they can be used from any environment capable of sending HTTP requests, regardless of the programming language or tool used.

3. Connecting Your LinkedIn Account (Personal Profile and Company Page)

ZakiPost provides a "Connect LinkedIn Account" button in the dashboard, and clicking it triggers the following sequence:

  1. A random security token (state) is generated and temporarily stored to prevent request forgery attempts.
  2. You are redirected to LinkedIn's official consent screen, where you can choose to grant publishing permissions for your personal profile only, or grant additional permissions to manage a company page you have administrative access to.
  3. After you approve, you're redirected back to ZakiPost, which validates the request and exchanges the authorization code for a valid access token.
  4. The token is encrypted and stored securely, and is never shown to the user or any other party at any time.
  5. An internal identifier for this account (linkedin_account_id) is generated, to be used later when sending publish requests to the personal profile and/or company page.

Once this step is complete, your LinkedIn account appears in your list of connected accounts, showing the type of permissions granted (personal profile, company page, or both), and becomes ready for publishing through the ZakiPost API.

Important note about company pages: For company page publishing to work successfully, you must have administrative permissions on that page within LinkedIn, and you must approve, during the connection step, the page permissions w_organization_social and rw_organization_admin. If these permissions aren't granted, the connection will be limited to publishing to the personal profile only.

4. Publishing Content Through The API

The publishing endpoint accepts POST requests in the following format, supporting text, image, and video posts to the personal profile, the company page, or both at once:

POST https://api.zakipost.com/v1/linkedin/publish
Content-Type: application/json
X-ZakiPost-Client-Key: zp_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-ZakiPost-Client-Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

{
  "content": "Your post text here",
  "linkedin_account_id": "internal-token-uuid",
  "publish_to_profile": true,
  "publish_to_organization": false,
  "images": ["https://example.com/image1.jpg"],
  "video_url": "https://example.com/video.mp4"
}

Field Reference

FieldDescription
contentThe post text to publish on LinkedIn. Required if no images or video are attached. Maximum 4000 characters.
linkedin_account_idThe internal account identifier (internal_token) obtained after connecting your LinkedIn account.
publish_to_profileBoolean value determining publishing to the personal profile. Default value is true.
publish_to_organizationBoolean value determining publishing to the linked company page. Default value is false. Enabling it requires granting page administration permissions during the connection step.
imagesAn array containing the URLs of images to publish, up to a maximum of 9 images.
video_urlA direct link to a video file, which must be publicly downloadable and point directly to an mp4 file or similar.

Note: If both images and video_url are passed in the same request, priority is given to video_url. If video_url is empty, images will be used. If both are empty, content will be published as text only. Additionally, publish_to_profile and publish_to_organization can both be enabled in the same request to publish content to both destinations at once.

Success Response

{
  "success": true,
  "message": "Published successfully...",
  "data": {
    "post_url": "Post URL if available"
  }
}

5. Common Errors And Their Meanings

StatusLikely Cause
401 UnauthorizedThe client_key or client_secret are incorrect or not sent in the headers, or the credentials are invalid.
402 Payment Required (insufficient_points)Your account's point balance isn't sufficient to complete the publish operation. At least 400 points are required per publish operation.
403 ForbiddenYour current plan doesn't include API access, your subscription has expired, or there isn't enough capacity to add LinkedIn accounts.
Company page publish failure specificallyThe w_organization_social and rw_organization_admin permissions weren't granted during the connection step, or the user doesn't have administrative permissions on the page within LinkedIn.

6. Costs And Usage Limits

ItemDetails
Publishing cost400 points/credits are deducted for every successful publish operation via the API, whether to the personal profile or the company page.
Rate limiting10 requests per user per minute are allowed on the LinkedIn platform.
Plan requirementsYou must have a subscription plan that includes API Access with available capacity to add LinkedIn accounts.

You can track the status of posts sent via the API to LinkedIn (pending, successful, or failed) from the dashboard's API Reports page, where detailed error messages are logged in case publishing fails on LinkedIn's side.

7. Quick Summary

QuestionAnswer
How do I connect my personal LinkedIn account to ZakiPost?Connect your account through LinkedIn's official consent screen to immediately get your API keys and start automating publishing to your personal profile.
Can I publish to my LinkedIn company page?Yes, provided you have administrative permissions on the page and approve LinkedIn's page management permissions during the connection step.
Can I publish to my personal profile and company page at the same time?Yes, by enabling both the publish_to_profile and publish_to_organization fields together in the same publish request.
What's needed to publish to LinkedIn programmatically?Your account's API keys, and the account identifier (linkedin_account_id) for the connected LinkedIn account.
Where can I find my account's API keys?You can access and manage them from the API Keys settings page.