REST API v1 · Resource
Draft, schedule and publish LinkedIn posts and events, and read page insights.
API reference · LinkedIn
Last updated
Endpoints
Paths are relative to https://fliok.com/api/v1. Each endpoint names the scope and the lowest key role it needs; a key without them gets 403 (see Authentication).
LinkedIn is a paid add-on on the Basic plan and up. Connect LinkedIn in Integrations first: it is a browser sign-in, so it can’t be done with a key (GET /integrations/linkedin gives the connectUrl to open). These endpoints then run the same code as the dashboard, with the same roles, rules and limits. Reads need any key; drafts, comments and likes need the agent role; scheduling, publishing, retrying and deleting what isn’t a draft need admin.
- The add-on. Without it, every write answers
402 linkedin_addon_required, withoffersaying what the workspace owner can buy in Plan & billing. Reading your posts and events stays open, as in the dashboard. Page insights and comments need the add-on to read too. - What LinkedIn approved. Events, and page insights and comments, work only when LinkedIn has approved them for Fliok. Until then events answer
404 not_found, and insights and comments answer as the dashboard does. Page insights and comments also need your company page picked in Integrations. - Files by URL.
POST /linkedin/mediadownloads a photo (JPG, PNG or GIF, up to 10 MB), an MP4 video or a PDF, PPTX or DOCX (up to 100 MB) from a public https:// address and checks it like a dashboard upload. Private and internal addresses are refused. Pass themediaIdin a post’smedia, an article’sthumbnailKeyor an event’simageKey. - Not in the API. Connecting and picking the company page are browser sign-ins. LinkedIn Live is read-only here (
GET /linkedin/live): scheduling a Live and its stream keys stay in the dashboard, so a key never sees a stream address. Member data and page data stay in the dashboard for now. LinkedIn ads have their own page.
- GET
/linkedin/postsLinkedIn posts written in Fliok: drafts, scheduled, publishing, published, failed and cancelled, newest first. Filter with ?status=Scopelinkedin:read· viewer role or higherNeeds an API key - POST
/linkedin/postsSave a draft (agent keys), or schedule or publish now (admin keys): text, photos, video, document, article link or poll, as you or your pageScopelinkedin:write· agent role or higherNeeds an API key - GET
/linkedin/posts/{id}One LinkedIn post written in Fliok. Poll it after publishing: publishing turns into published (with a permalink) or failed (with the reason)Scopelinkedin:read· viewer role or higherNeeds an API key - PATCH
/linkedin/posts/{id}Edit a post, or move it with action draft, schedule, publish or cancel. Agent keys edit drafts; anything that schedules or publishes needs an admin keyScopelinkedin:write· agent role or higherNeeds an API key - DELETE
/linkedin/posts/{id}Delete a post. Agent keys delete drafts; others need an admin key. A published post is deleted on LinkedIn firstScopelinkedin:write· agent role or higherNeeds an API key - POST
/linkedin/posts/{id}/retryTry a failed post again now (admin keys). Files already sent to LinkedIn are kept, so nothing is uploaded twiceScopelinkedin:write· admin role or higherNeeds an API key - GET
/linkedin/eventsLinkedIn events kept in Fliok: drafts, made on LinkedIn, shared. Upcoming first, then past ones. 404 when LinkedIn events are not availableScopelinkedin:read· viewer role or higherNeeds an API key - POST
/linkedin/eventsSave an event as a draft (agent keys), or make it on LinkedIn now with action create and share it at once (admin keys)Scopelinkedin:write· agent role or higherNeeds an API key - GET
/linkedin/events/{id}One LinkedIn event with its share post. Poll it after sharing to see the post go outScopelinkedin:read· viewer role or higherNeeds an API key - PATCH
/linkedin/events/{id}Change a draft event, put it on LinkedIn with action create, or change one on LinkedIn (admin keys, once shared and before it starts)Scopelinkedin:write· agent role or higherNeeds an API key - DELETE
/linkedin/events/{id}Delete a draft event (agent keys), or a shared one by deleting its post on LinkedIn (admin keys)Scopelinkedin:write· agent role or higherNeeds an API key - POST
/linkedin/events/{id}/shareShare an event as a LinkedIn post, which makes it visible. Agent keys save a draft; admin keys post now or schedule itScopelinkedin:write· agent role or higherNeeds an API key - POST
/linkedin/events/syncBring in the connected member’s own events from LinkedIn, so events made outside Fliok show up tooScopelinkedin:write· agent role or higherNeeds an API key - GET
/linkedin/insightsYour company page’s followers, page views and post numbers per day for 7, 30 or 90 days. Needs a picked page and LinkedIn’s page featuresScopelinkedin:read· viewer role or higherNeeds an API key - GET
/linkedin/commentsYour company page’s recent posts with comment counts, or one post’s comments as threads with ?post=. Needs LinkedIn’s page featuresScopelinkedin:read· viewer role or higherNeeds an API key - POST
/linkedin/commentsComment, reply, like or unlike as your company page (agent keys and up). Every call is one comment; Fliok never comments by itselfScopelinkedin:write· agent role or higherNeeds an API key - DELETE
/linkedin/commentsDelete a comment your company page wrote, with ?post= and ?comment= (admin keys)Scopelinkedin:write· admin role or higherNeeds an API key - GET
/linkedin/liveYour LinkedIn Lives from the separate Live app: the pages and up to 50 Lives with their status. Never a stream address. 404 when Live is offScopelinkedin:read· viewer role or higherNeeds an API key - POST
/linkedin/mediaGive Fliok a photo, MP4 video or PDF/PPTX/DOCX by public https:// link. It is checked like a dashboard upload; you get a mediaId for posts and eventsScopelinkedin:write· agent role or higherNeeds an API key
Request bodies
What these endpoints take, field by field. A body that doesn’t match answers 400 naming the field.
POST /linkedin/posts
JSON body. A draft may be unfinished; scheduling and publishing check every LinkedIn rule first (422 invalid_post lists what is wrong). Optional `Idempotency-Key`.
| Field | Type | What it is |
|---|---|---|
kindrequired | string | text, image, multi_image (2–20 photos), video, document, article (a link) or poll. |
text | string | The post’s words, up to 3,000 characters. |
media | string[] | mediaIds from POST /linkedin/media, in order: one photo, 2–20 photos, one video or one document. |
title | string | null | A document’s title (needed) or a video’s (optional). |
article | object | null | For kind article: { url, title, description?, thumbnailKey? } — thumbnailKey is a photo’s mediaId. |
poll | object | null | For kind poll: { question (up to 140), options (2–4, up to 30 characters each), durationDays (1, 3, 7 or 14) }. |
visibility | string | PUBLIC (default) or CONNECTIONS. A company page’s posts are always PUBLIC. |
action | string | draft (default, agent keys), schedule or publish (admin keys). |
postAs | string | member (default, the connected person) or page (your company page, when it can post). |
scheduledAt | string | With action schedule: ISO 8601 with a zone, 2 minutes to 75 days ahead. |
Returns 201 { post }. After publish, poll GET /linkedin/posts/{id}: status publishing turns into published (with permalink) or failed (with errorMessage).
PATCH /linkedin/posts/{id}
JSON body; send only what changes. A post LinkedIn is posting or has posted can’t be changed (409). Agent keys edit drafts; anything that schedules, publishes, cancels or changes a scheduled post needs an admin key.
| Field | Type | What it is |
|---|---|---|
kind | string | text, image, multi_image (2–20 photos), video, document, article (a link) or poll. |
text | string | The post’s words, up to 3,000 characters. |
media | string[] | mediaIds from POST /linkedin/media, in order: one photo, 2–20 photos, one video or one document. |
title | string | null | A document’s title (needed) or a video’s (optional). |
article | object | null | For kind article: { url, title, description?, thumbnailKey? } — thumbnailKey is a photo’s mediaId. |
poll | object | null | For kind poll: { question (up to 140), options (2–4, up to 30 characters each), durationDays (1, 3, 7 or 14) }. |
visibility | string | PUBLIC (default) or CONNECTIONS. A company page’s posts are always PUBLIC. |
postAs | string | member (default, the connected person) or page (your company page, when it can post). |
scheduledAt | string | With action schedule: ISO 8601 with a zone, 2 minutes to 75 days ahead. |
action | string | draft (unschedule), schedule, publish (now) or cancel (a scheduled post). |
Returns 200 { post }.
POST /linkedin/media
JSON body. Fliok downloads the file, follows up to three redirects (each checked), and checks its first bytes against its type. Optional `Idempotency-Key`.
| Field | Type | What it is |
|---|---|---|
urlrequired | string | A public https:// link to the file. |
type | string | image (default: JPG, PNG or GIF, up to 10 MB), video (MP4, up to 100 MB) or document (PDF, PPTX or DOCX, up to 100 MB). |
Returns 201 { media: { mediaId, mime, size, kind } }. 413 file_too_large, 415 unsupported_media_type, 400 url_not_allowed for a private address.
POST /linkedin/events
JSON body. A draft is kept in Fliok (agent keys). action create makes it on LinkedIn now (admin keys); an event is only visible once it is shared as a post. Optional `Idempotency-Key`.
| Field | Type | What it is |
|---|---|---|
typerequired | string | online or in_person. |
namerequired | string | Up to 75 characters. |
description | string | Up to 5,000 characters. |
startsAtrequired | string | Local time in timeZone, like "2026-12-01T15:30". At least 10 minutes ahead, within a year. |
endsAtrequired | string | Local time in timeZone. An event lasts at most 14 days. |
timeZonerequired | string | An IANA zone, like "Asia/Kolkata". |
url | string | Online events: the https:// link people join at. |
address | object | null | In-person events: { line1, city, geographicArea, postalCode, country }. |
venueDetails | string | In-person events: how to find the room, up to 1,000 characters. |
imageKey | string | null | A JPG or PNG photo’s mediaId from POST /linkedin/media, shown as the event’s cover. |
action | string | draft (default) or create. |
share | object | null | With create: { text, visibility } to share it as a post at once. |
Returns 201 { event }.
PATCH /linkedin/events/{id}
JSON body; send only what changes. LinkedIn takes changes to an event only after it is shared and before it starts (`changeable` on the event).
| Field | Type | What it is |
|---|---|---|
type | string | online or in_person. |
name | string | Up to 75 characters. |
description | string | Up to 5,000 characters. |
startsAt | string | Local time in timeZone, like "2026-12-01T15:30". At least 10 minutes ahead, within a year. |
endsAt | string | Local time in timeZone. An event lasts at most 14 days. |
timeZone | string | An IANA zone, like "Asia/Kolkata". |
url | string | Online events: the https:// link people join at. |
address | object | null | In-person events: { line1, city, geographicArea, postalCode, country }. |
venueDetails | string | In-person events: how to find the room, up to 1,000 characters. |
imageKey | string | null | A JPG or PNG photo’s mediaId from POST /linkedin/media, shown as the event’s cover. |
action | string | create: put a draft on LinkedIn (admin keys). |
share | object | null | With create: { text, visibility } to share it at once. |
Returns 200 { event }.
POST /linkedin/events/{id}/share
JSON body. The share goes through the posts pipeline, so it shows in GET /linkedin/posts too. Optional `Idempotency-Key`.
| Field | Type | What it is |
|---|---|---|
text | string | The post’s words. |
visibility | string | PUBLIC (default) or CONNECTIONS. |
action | string | publish (default) or schedule (admin keys), or draft (agent keys). |
scheduledAt | string | With schedule: ISO 8601 with a zone. |
Returns 200 { event } with share { postId, status, scheduledAt, permalink, errorMessage }.
POST /linkedin/comments
JSON body. Everything is done as your company page. Optional `Idempotency-Key`, so a retried comment isn’t posted twice.
| Field | Type | What it is |
|---|---|---|
actionrequired | string | comment, reply, like or unlike. |
postUrnrequired | string | The page post, like "urn:li:share:7…" (from GET /linkedin/comments). |
commentUrn | string | reply: the comment answered (needed). like / unlike: a comment instead of the post. |
text | string | comment and reply: 1–1,250 characters. |
Returns 200 { done: true }.
Examples
Post a photo on LinkedIn
curl -X POST "https://fliok.com/api/v1/linkedin/media" \
-H "Authorization: Bearer wa_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://cdn.example.com/diwali-offer.jpg", "type": "image" }'
curl -X POST "https://fliok.com/api/v1/linkedin/posts" \
-H "Authorization: Bearer wa_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: diwali-post-1" \
-d '{
"kind": "image",
"text": "Our Diwali hampers are here. Order on WhatsApp.",
"media": ["linkedin-posts/8b0c…/2f4e9a1c-7d3b-4e5f-a6c8-1b2d3e4f5a6b.jpg"],
"action": "publish"
}'// 201 Created — the file
{ "media": { "mediaId": "linkedin-posts/8b0c…/2f4e9a1c-7d3b-4e5f-a6c8-1b2d3e4f5a6b.jpg", "mime": "image/jpeg", "size": 482113, "kind": "image" } }
// 201 Created — the post (poll GET /linkedin/posts/{id} until published or failed)
{
"post": {
"id": "c7a1e2d4-5b6f-4a8e-9c0d-1e2f3a4b5c6d",
"kind": "image",
"text": "Our Diwali hampers are here. Order on WhatsApp.",
"media": [{ "mediaId": "linkedin-posts/8b0c…/2f4e9a1c-….jpg", "mime": "image/jpeg", "size": 482113, "kind": "image" }],
"article": null,
"poll": null,
"visibility": "PUBLIC",
"status": "publishing",
"scheduledAt": "2026-10-29T09:30:00.000Z",
"publishedAt": null,
"postUrn": null,
"permalink": null,
"errorMessage": null,
"attempts": 0,
"outcomeUnknown": false,
"otherAccount": false,
"asPage": false,
"authorName": "Asha Rao",
"createdById": null,
"createdAt": "2026-10-29T09:30:00.000Z",
"updatedAt": "2026-10-29T09:30:00.000Z"
}
}Schedule a post, then cancel it
curl -X POST "https://fliok.com/api/v1/linkedin/posts" \
-H "Authorization: Bearer wa_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "kind": "text", "text": "We are hiring support agents in Kolkata.", "action": "schedule", "scheduledAt": "2026-11-03T10:00:00+05:30" }'
curl -X PATCH "https://fliok.com/api/v1/linkedin/posts/c7a1e2d4-5b6f-4a8e-9c0d-1e2f3a4b5c6d" \
-H "Authorization: Bearer wa_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "action": "cancel" }'// 201 Created
{ "post": { "id": "c7a1e2d4-…", "kind": "text", "status": "scheduled", "scheduledAt": "2026-11-03T04:30:00.000Z", … } }
// 200 OK
{ "post": { "id": "c7a1e2d4-…", "status": "cancelled", … } }
// 403 — an agent key asked to schedule
{ "error": "forbidden", "message": "Only admins can publish or schedule LinkedIn posts. Save it as a draft for an admin." }Make an online event and share it
curl -X POST "https://fliok.com/api/v1/linkedin/events" \
-H "Authorization: Bearer wa_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "online",
"name": "WhatsApp selling masterclass",
"description": "45 minutes on catalogs, broadcasts and replies.",
"startsAt": "2026-11-20T16:00",
"endsAt": "2026-11-20T16:45",
"timeZone": "Asia/Kolkata",
"url": "https://meet.example.com/masterclass",
"action": "create",
"share": { "text": "Join us live on 20 November.", "visibility": "PUBLIC" }
}'// 201 Created
{
"event": {
"id": "4d2b9c1a-8e7f-4a6b-9c5d-3e2f1a0b9c8d",
"eventUrn": "urn:li:event:7391200000000000000",
"name": "WhatsApp selling masterclass",
"type": "online",
"startsAt": "2026-11-20T10:30:00.000Z",
"endsAt": "2026-11-20T11:15:00.000Z",
"timeZone": "Asia/Kolkata",
"url": "https://meet.example.com/masterclass",
"description": "45 minutes on catalogs, broadcasts and replies.",
"address": null,
"venueDetails": "",
"imageKey": null,
"status": "created",
"shared": false,
"share": { "postId": "9a8b7c6d-…", "status": "publishing", "scheduledAt": "2026-10-29T09:40:00.000Z", "permalink": null, "errorMessage": null },
"pageUrl": "https://www.linkedin.com/events/7391200000000000000/",
"changeable": false,
"liveVideo": false,
"otherAccount": false,
"lastError": null,
"createdAt": "2026-10-29T09:40:00.000Z"
}
}
// 404 — LinkedIn hasn't approved events for Fliok yet
{ "error": "not_found", "message": "This page doesn't exist." }Read page comments and reply as the page
curl "https://fliok.com/api/v1/linkedin/comments?post=urn:li:share:7390000000000000001" \
-H "Authorization: Bearer wa_YOUR_API_KEY"
curl -X POST "https://fliok.com/api/v1/linkedin/comments" \
-H "Authorization: Bearer wa_YOUR_AGENT_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reply-7390-1" \
-d '{ "action": "reply", "postUrn": "urn:li:share:7390000000000000001", "commentUrn": "urn:li:comment:(urn:li:share:7390000000000000001,7390000000000000077)", "text": "Thanks, Tanvi! DM us for the price list." }'// 200 OK — the reply was posted as your company page
{ "done": true }
// 402 — the workspace has no LinkedIn add-on
{ "error": "linkedin_addon_required", "message": "Add LinkedIn to your plan. Ask the workspace owner — only they can add LinkedIn.", "offer": "add_addon", "askOwner": true }Rate limits
The buckets these endpoints use. Burst is how many requests you can make back-to-back from a full bucket; sustained is how fast it refills.
| Bucket | Endpoints | Burst | Sustained |
|---|---|---|---|
| Reads | /messages · /conversations · /contacts · /templates · /phone-numbers · GET /webhooks · Instagram, LinkedIn, ads and catalog reads · GET /payment-requests/{id} | 600 | 60 / sec |
| LinkedIn posts | POST /linkedin/posts · PATCH and DELETE /linkedin/posts/{id} · POST /linkedin/posts/{id}/retry | 60 | 1 / sec |
| LinkedIn media | POST /linkedin/media (a video or document also draws from a large-upload bucket: 4, then 1 / 30 sec) | 30 | 1 / 2 sec |
| LinkedIn events | POST /linkedin/events · PATCH and DELETE /linkedin/events/{id} · POST /linkedin/events/{id}/share | 30 | 1 / sec |
| LinkedIn comments | POST and DELETE /linkedin/comments | 20 | 20 / min |
Every limit, the RateLimit-* headers and what to do on a 429: Rate limits.