Developers
Public Social API (v1)
Draft LinkedIn posts, attach images, then schedule or publish them from an external system. Generate an API key with Social media permissions from Marketing → API access inside your Ukigai organization, then follow the flow below.
All examples below use https://app.ukigai.com. Replace it with your own
Ukigai URL.
Scope
v1 covers LinkedIn posts end to end: finding the profiles and Company Pages you can post to, writing a draft, attaching images or a video, scheduling it or publishing it right away, and reading engagement once it's live. It also covers reposting with commentary: sharing a post (for example your Company Page's) from a personal profile, with your own comment on top. The original can already be published or still be scheduled. Posts, Company Page posts and reposts can all @mention people, and scheduled posts keep their mentions until they go out.
What it doesn't do:
- Connect LinkedIn accounts. Someone has to connect a LinkedIn profile or Company Page once in Marketing → Social networks. LinkedIn's OAuth consent can't be done through an API key.
- AI post generation and the image bank. These are only in the app for now.
- Unpublishing. Deleting a post that's already live removes it from Ukigai but leaves it on LinkedIn.
- Reposting posts made outside Ukigai. You can only repost posts that were published through Ukigai.
Authentication
This is the same two-step exchange as every Ukigai public API. Use a key generated from Marketing → API access inside your organization with at least one Social media permission ticked.
curl -X POST https://app.ukigai.com/api/public/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "uak_your_marketing_api_key_here"}'
{
"access_token": "uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"token_type": "Bearer",
"expires_in": 3600,
"request_id": "b3f2..."
}
Send the access token as Authorization: Bearer ... on every other call.
It lasts an hour. When it expires, exchange the API key again.
A key has three social scopes. Each is granted separately when the key is created:
social:read: everyGET(targets, posts, insights). It's included automatically with either of the other two.social:write: create, edit and delete drafts, and attach or remove media.social:publish: schedule, unschedule and publish now. This is kept separate fromsocial:writeon purpose, so a key that only drafts posts can't put anything on LinkedIn.
The same key can also carry the marketing:* email scopes (see the
Marketing API docs). Every response, success or
error, includes a request_id in the body and in the X-Request-Id header.
Errors are { error, code, request_id }. Rate limits work the same as in
the CRM API.
Whose LinkedIn accounts a key can use
In Ukigai, a LinkedIn connection belongs to the person who connected it. An API key has no user of its own, so a key acts as the person who created it:
-
It sees and posts only to LinkedIn connections that person set up.
-
If that person can manage company posts (the Manage company posts permission), the key can also use every Company Page connected in the organization.
-
On every request, Ukigai checks that person's current permissions:
- Social Networks view or manage is needed to read.
- manage is needed to write and to schedule.
- publish is needed for publish-now.
If they lose a permission or leave the organization, the key stops working for those actions. Calls then return
403 KEY_OWNER_FORBIDDEN, or403 KEY_OWNER_MISSINGif their user was deleted. Create a new key as someone who still has access.
So have the person whose LinkedIn accounts should be used create the key. Usually that's whoever connected the Company Page.
Posts the key can't see return 404, never 403, so a key can't find out
about posts on other people's connections.
The order you'll use this in
- Find a target.
GET /social/targetslists the profiles and Company Pages you can post to. Keep theid. - Create a draft. Post the text against that
target_id. - Attach media (optional). Upload up to 9 images or 1 video.
- Schedule it or publish it now.
- Poll the post to watch
status, then readlinkedin_post_urland, later, its insights.
Targets
GET /api/public/v1/social/targets
Requires scope social:read.
curl https://app.ukigai.com/api/public/v1/social/targets \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"data": [
{
"id": "6f1c0e2a-...",
"network": "linkedin",
"type": "organization",
"display_name": "Acme Inc.",
"vanity_name": "acme",
"is_default": true,
"connection_scope": "org",
"connection_expires_at": "2027-01-04T10:00:00Z",
"connection_error": null
}
],
"request_id": "..."
}
typeisorganizationfor a Company Page andpersonfor a personal profile.connection_expires_atis when the LinkedIn authorization runs out. After that, posts fail until someone reconnects the account in the app.connection_errorholds the last error LinkedIn returned for the connection. If it isn'tnull, check the connection in the app before you schedule.
Posts
A post has these fields:
| Field | Type | Notes |
|---|---|---|
id | uuid | |
target_id / target | uuid / object | Where it posts (id, type, display_name, vanity_name) |
body | string | The post text, up to 3,000 characters |
mentions | array | People mentioned in body: { name, urn }. See "Mentioning people" below |
language | string | null | Optional language tag, e.g. "en" |
status | string | draft, scheduled, publishing, published, failed, cancelled |
scheduled_for | timestamp | null | When a scheduled post goes out |
published_at | timestamp | null | |
linkedin_post_url | string | null | Link to the live post once it's published |
linkedin_share_urn | string | null | LinkedIn's id for the post |
publish_attempt_count | integer | |
last_error | string | null | Why the last publish attempt failed |
source | string | manual, ai_assisted or ai_generated (API-created posts are manual) |
reshare_of | object | null | Set on a repost. See "Reposting with commentary" below |
media | array | { id, position, kind, mime_type, size_bytes, alt_text } |
created_at / updated_at | timestamp |
How status changes:
- A new post starts as
draft, and a draft never publishes on its own. schedulemoves it toscheduled.unschedulemoves it back todraft.- At the scheduled time, or when you call
publish, it goes topublishingand then topublishedorfailed. - A
failedpost keeps its text and media, so you can schedule or publish it again. cancelledposts come from the app. The API treats them like drafts.
POST /api/public/v1/social/posts
Requires scope social:write. Creates a draft.
curl -X POST https://app.ukigai.com/api/public/v1/social/posts \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"target_id": "6f1c0e2a-...",
"body": "We just shipped multi-signer contracts. Here is what changed...",
"language": "en"
}'
| Field | Type | Required |
|---|---|---|
target_id | uuid from GET /social/targets | yes |
body | string, max 3,000 chars | no (an empty draft is fine; it needs text or media before it can be scheduled) |
mentions | array of { name, urn } | no. Each one must appear in body as @name. See "Mentioning people" below |
language | string | no |
reshare_of_post_id | uuid from GET /social/reshare-sources | no. Makes the draft a repost of that post, and body becomes your comment. See below |
Returns 201 with the post.
GET /api/public/v1/social/posts
Requires scope social:read. Lists your posts, oldest first. Optional
filters: status and target_id. It uses cursor pagination: limit
defaults to 25 and can go up to 100, and you pass next_cursor back as
cursor to get the next page.
curl "https://app.ukigai.com/api/public/v1/social/posts?status=scheduled&limit=50" \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
GET /api/public/v1/social/posts/:id
Requires scope social:read. Returns one post, with its media.
PATCH /api/public/v1/social/posts/:id
Requires scope social:write. Edits the text. Send any of body,
mentions and language. Only the fields you send change, and
"language": null clears the language.
mentions replaces the whole list ([] or null removes every mention).
If you send only body, the post keeps the mentions whose @name is still
in the new text and drops the others.
curl -X PATCH https://app.ukigai.com/api/public/v1/social/posts/POST_ID \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "body": "Updated copy for the launch post" }'
You can edit a post until it starts publishing. That includes a
scheduled post, which keeps its time. On a publishing or published
post it returns 409 POST_LOCKED. To change when a post goes out, use
schedule. PATCH doesn't change timing.
DELETE /api/public/v1/social/posts/:id
Requires scope social:write. Removes the post from Ukigai. If it was
already published, the post stays live on LinkedIn. Returns
409 POST_PUBLISHING while a publish is in progress.
Mentioning people
A post can @mention people on LinkedIn: on a personal profile, on a Company Page, and in a repost's comment. On LinkedIn the mention shows as the person's name, linked to their profile, and they get a notification.
Write the mention in body as @ followed by the name, and list each
person once in mentions:
curl -X POST https://app.ukigai.com/api/public/v1/social/posts \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"target_id": "6f1c0e2a-...",
"body": "Welcome to the team, @Jane Doe! Thanks @Jane Doe and @Luis for the onboarding.",
"mentions": [
{ "name": "Jane Doe", "urn": "urn:li:person:AbC123xYz" },
{ "name": "Luis", "urn": "urn:li:person:Q9_rT-77" }
]
}'
nameis the text after@, andurnis the person's LinkedInurn:li:person:…id. Every@namein the body becomes that mention, so@Jane Doetwice is two mentions of the same person.@nameonly counts when it is a whole word:@Janedoesn't match inside@Janetorana@jane.com. When two names overlap, the longer one wins.- Use the name as it appears on LinkedIn. LinkedIn links a mention only when the name matches the person's first name, last name or full name exactly, including capitals. Otherwise it shows as plain text.
- Ukigai stores
bodyas you sent it, plusmentions. When the post is published, it sends each mention to LinkedIn in LinkedIn's little text format (@[Jane Doe](urn:li:person:AbC123xYz)). Don't write that format inbodyyourself. The text around mentions is sent unchanged, and a post without mentions is sent exactly as before. - Only people can be mentioned. Company Pages (
urn:li:organization:…) aren't supported. - A post can mention up to 25 people. Two different people can't share a
namein one post, because the body couldn't tell them apart.
Where person URNs come from
LinkedIn gives each person a different id for each LinkedIn app, so a URN only links if it is valid for Ukigai's LinkedIn app. A URN copied from another tool may not work.
GET /social/mention-profileslists the people your organization has already set up for mentions, each with aurnyou can use directly.- In the app, typing
@in the post editor offers the same people. To add someone new, paste their LinkedIn profile URL. Ukigai asks LinkedIn for their id through a connected Company Page. LinkedIn only allows this lookup for apps it has approved for that permission. When it refuses, the editor says so and lets you enter a URN you have verified yourself.
GET /api/public/v1/social/mention-profiles
Requires scope social:read. Optional q filters by name or vanity name.
{
"data": [
{
"id": null,
"name": "Jane Doe",
"urn": "urn:li:person:AbC123xYz",
"vanity_name": "jane-doe",
"profile_url": "https://www.linkedin.com/in/jane-doe",
"verification": "connected_member"
}
],
"request_id": "..."
}
verification says where the URN came from:
| Value | Meaning |
|---|---|
connected_member | The person connected their own LinkedIn profile to Ukigai, so LinkedIn gave the URN directly. id is null |
linkedin_lookup | Ukigai resolved it from their profile URL through LinkedIn |
manual_urn | Someone entered the URN in the app. Ukigai only checked its format |
Reposting with commentary
A repost shares an existing LinkedIn post natively, like LinkedIn's Repost with your thoughts. Your comment appears above the original post, and the original keeps its own likes and comments. It isn't a new post that contains a link.
The usual case is an employee reposting the Company Page's post from their personal profile:
- Find the post to repost.
GET /social/reshare-sourceslists posts that are already published. - Create the repost.
POST /social/postswith thetarget_idof the profile to repost from,reshare_of_post_id, and your comment asbody. - Schedule it or publish it now, the same as any other post.
GET /api/public/v1/social/reshare-sources
Requires scope social:read. Lists published posts you can repost, newest
first:
- every published post from a Company Page connected in the organization, whoever connected it, and
- the published posts on the key creator's own connections.
Reposts themselves aren't listed, because you repost the original.
Optional q filters on the post text. limit defaults to 25 and can go up
to 100. This list has no pagination, so use q to find older posts.
Add include_scheduled=true to also list originals that are still
scheduled. These come first, soonest first, with status: "scheduled"
(or "publishing") and linkedin_share_urn: null. Only scheduled posts on
connections the key can already see are included, because they aren't public
on LinkedIn yet:
- the key creator's own connections, and
- every Company Page, if the key creator has the Manage company posts permission.
Each item also has status and scheduled_for.
curl "https://app.ukigai.com/api/public/v1/social/reshare-sources?q=launch" \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"data": [
{
"id": "0b6d9a1e-...",
"body": "We just shipped multi-signer contracts...",
"status": "published",
"published_at": "2026-11-05T14:00:00Z",
"scheduled_for": "2026-11-05T14:00:00Z",
"linkedin_share_urn": "urn:li:share:7261234567890123456",
"linkedin_post_url": "https://www.linkedin.com/feed/update/urn:li:share:7261234567890123456",
"target": { "id": "6f1c0e2a-...", "type": "organization", "display_name": "Acme Inc." }
}
],
"request_id": "..."
}
Creating and scheduling a repost
curl -X POST https://app.ukigai.com/api/public/v1/social/posts \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"target_id": "PERSONAL_PROFILE_TARGET_ID",
"reshare_of_post_id": "0b6d9a1e-...",
"body": "Proud of what the team shipped this week. Contracts with several signers are now one link."
}'
Then call POST /social/posts/:id/schedule or /publish as usual. A
repost's reshare_of describes the original:
"reshare_of": {
"post_id": "0b6d9a1e-...",
"linkedin_share_urn": "urn:li:share:7261234567890123456",
"linkedin_post_url": "https://www.linkedin.com/feed/update/urn:li:share:7261234567890123456",
"body": "We just shipped multi-signer contracts...",
"published_at": "2026-11-05T14:00:00Z",
"target_display_name": "Acme Inc.",
"state": "linked",
"original_status": "published",
"original_scheduled_for": "2026-11-05T14:00:00Z",
"blocked_reason": null
}
state is one of:
linked: the original is on LinkedIn and the repost can go out.waiting_for_original: the original is still scheduled. Itslinkedin_share_urnandlinkedin_post_urlarenulluntil it publishes.blocked: the repost won't publish.blocked_reasonsays why (see below).
Rules for reposts:
- The original must be published or scheduled (including one that
is publishing right now). Drafts, failed and cancelled posts return
409 RESHARE_SOURCE_NOT_PUBLISHED. - You repost the original, not another repost (
400 RESHARE_OF_RESHARE). - A repost needs a comment before you can schedule or publish it
(
400 EMPTY_COMMENTARY). The comment can be up to 3,000 characters. - A repost can't have its own images or video, because LinkedIn shows the
original post's (
400 RESHARE_NO_MEDIA). - The original can't be changed after you create the draft. To repost a
different post, delete the draft and create a new one. You can still edit
the comment with
PATCH. - If the original is deleted from Ukigai after it was published, the
repost still publishes, because it points at the post on LinkedIn.
reshare_of.post_idandbodybecomenull.
Reposting a post that is still scheduled
You can create and schedule a repost before its original is published, for example to have employees' reposts go out an hour after the Company Page post:
GET /social/reshare-sources?include_scheduled=trueand pick the scheduled original.POST /social/postswithreshare_of_post_id, as above.POST /social/posts/:id/schedulewith ascheduled_forlater than the original'sscheduled_for. An equal or earlier time returns400 RESHARE_SCHEDULED_BEFORE_ORIGINAL, with the original's time indetails.original_scheduled_for.
POST /social/posts/:id/publish (publish now) returns
409 RESHARE_ORIGINAL_NOT_PUBLISHED until the original is live. Schedule
the repost instead.
A repost is only ever published as a repost of the original, never as a standalone post. At its scheduled time:
- Original published: the repost goes out on top of it.
- Original still scheduled or publishing, for example because it was
rescheduled later or LinkedIn is retrying it: the repost waits. It stays
scheduled, itsscheduled_formoves to shortly after the original's time, andreshare_of.stateiswaiting_for_original. Waiting doesn't use up publish attempts. - Original deleted, failed, cancelled or moved back to draft: the repost
is blocked. Its
statusbecomesfailed,last_errorexplains why, andreshare_of.stateisblockedwith ablocked_reason. - Still waiting 24 hours after the repost was due: it's blocked with
original_wait_expired.
blocked_reason | Meaning |
|---|---|
original_deleted | The original was deleted before it was published |
original_failed | The original failed to publish on LinkedIn |
original_cancelled | The original was cancelled |
original_unscheduled | The original was moved back to draft |
original_wait_expired | The original still wasn't published 24 hours after the repost was due |
reshare_of.state already shows blocked once the original can no longer
publish, before the repost's scheduled time arrives. To try again, schedule
the repost once more. Scheduling clears the block, and the same rules apply,
so it needs an original that is published or still scheduled earlier than
the repost. Scheduling against an original that can't publish any more
returns 409 RESHARE_ORIGINAL_UNAVAILABLE with details.reason.
Media
LinkedIn accepts up to 9 images or 1 video per post, not both. Media can be changed until the post starts publishing.
POST /api/public/v1/social/posts/:id/media
Requires scope social:write. Send it as multipart/form-data with these
fields:
file(required)alt_text(optional, recommended for images)
curl -X POST https://app.ukigai.com/api/public/v1/social/posts/POST_ID/media \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "file=@launch.png" \
-F "alt_text=Screenshot of the new contract signing screen"
| Kind | Types | Max size |
|---|---|---|
| Image | JPEG, PNG, GIF | 5 MB |
| Video | MP4, MOV | see note |
Upload limit: each request can be at most 4.5 MB, so larger files (most videos) can't be uploaded through the API yet. Upload big videos in the app.
Returns 201 with the media item. Media is processed for LinkedIn when the
post publishes, not when you upload it.
DELETE /api/public/v1/social/posts/:id/media/:mediaId
Requires scope social:write. Removes one media item from the post.
Scheduling & publishing
These calls put content on LinkedIn. They aren't previews.
POST /api/public/v1/social/posts/:id/schedule
Requires scope social:publish. Body:
{ "scheduled_for": "2026-12-01T14:00:00Z" }. The time must be in the
future.
curl -X POST https://app.ukigai.com/api/public/v1/social/posts/POST_ID/schedule \
-H "Authorization: Bearer uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "scheduled_for": "2026-12-01T14:00:00Z" }'
- Works on
draft,failedandcancelledposts. - On an already
scheduledpost it reschedules: call it again with a new time. - The post needs text or media, or you get
400 EMPTY_POST. - The publisher runs every 5 minutes, so a post goes out up to about
5 minutes after
scheduled_for. - Returns the updated post.
POST /api/public/v1/social/posts/:id/unschedule
Requires scope social:publish. Takes a scheduled post back to draft
and clears scheduled_for. On any other status it returns
409 POST_NOT_SCHEDULED, including when publishing has already started.
POST /api/public/v1/social/posts/:id/publish
Requires scope social:publish. The key's creator also needs the Social
Networks publish permission. This publishes to LinkedIn immediately,
ignoring any schedule, and the response waits for LinkedIn's answer:
200with the post, nowpublished, includinglinkedin_post_url.202withcode: "MEDIA_PROCESSING": LinkedIn is still processing a video. The post is queued and will publish automatically within a few minutes. PollGET /posts/:id.502 PUBLISH_FAILED: LinkedIn rejected the post.details.postshows the post, nowfailed, withlast_error. Fix the problem and publish or schedule again.
Insights
GET /api/public/v1/social/posts/:id/insights
Requires scope social:read. Ukigai takes snapshots of LinkedIn engagement
every hour after a post is published. This returns up to 200 snapshots,
oldest first. An unpublished post returns an empty list.
{
"data": [
{
"captured_at": "2026-12-01T15:15:00Z",
"impressions": 1240,
"unique_impressions": 980,
"clicks": 37,
"likes": 52,
"comments": 6,
"shares": 4,
"engagement_rate": 0.079
}
],
"request_id": "..."
}
Errors
The format is the same as the other Ukigai APIs: { error, code, request_id }.
Common codes:
| Code | Status | Meaning |
|---|---|---|
INSUFFICIENT_SCOPE | 403 | The key lacks the scope, e.g. a social:write-only key calling schedule |
KEY_OWNER_FORBIDDEN | 403 | The key's creator no longer has the Social Networks permission this action needs |
KEY_OWNER_MISSING | 403 | The key's creator was deleted. Create a new key |
MODULE_DISABLED | 403 | Marketing isn't enabled for your organization |
TARGET_NOT_FOUND / TARGET_NOT_ALLOWED | 404 / 403 | Unknown target_id, or a connection this key can't use |
POST_NOT_FOUND | 404 | No such post, or one on a connection this key can't use |
POST_LOCKED | 409 | Editing, scheduling or changing media on a publishing or published post |
POST_PUBLISHING / POST_ALREADY_PUBLISHED | 409 | Publish or delete while a publish is in progress or done |
POST_NOT_SCHEDULED | 409 | unschedule on a post that isn't scheduled |
POST_STATUS_CHANGED | 409 | The publisher picked the post up mid-request. Fetch it and retry |
EMPTY_POST | 400 | Scheduling or publishing a post with no text and no media |
EMPTY_COMMENTARY | 400 | Scheduling or publishing a repost without a comment |
RESHARE_SOURCE_NOT_FOUND | 404 | Unknown reshare_of_post_id, or a post you can't repost |
RESHARE_SOURCE_NOT_PUBLISHED / RESHARE_OF_RESHARE | 409 / 400 | The original is neither published nor scheduled, or is itself a repost |
RESHARE_SCHEDULED_BEFORE_ORIGINAL | 400 | Scheduling a repost at or before its original's scheduled time |
RESHARE_ORIGINAL_NOT_PUBLISHED | 409 | Publishing a repost now while its original is still scheduled |
RESHARE_ORIGINAL_UNAVAILABLE | 409 | Scheduling or publishing a repost whose original was deleted, failed, cancelled or moved back to draft. See details.reason |
RESHARE_NO_MEDIA | 400 | Adding images or a video to a repost |
BODY_TOO_LONG | 400 | body over 3,000 characters |
INVALID_MENTIONS / INVALID_MENTION_NAME / INVALID_MENTION_URN | 400 | mentions isn't an array of { name, urn }, a name is empty, multi-line, over 100 characters or starts with @, or a urn isn't urn:li:person:… |
MENTION_NOT_IN_BODY | 400 | A mention's @name doesn't appear in body |
MENTION_NAME_CONFLICT / TOO_MANY_MENTIONS | 400 | Two people share one name, or more than 25 mentions |
INVALID_SCHEDULED_FOR | 400 | Missing, unparseable or past scheduled_for |
MEDIA_LIMIT | 400 | More than 9 images, or images mixed with a video |
UNSUPPORTED_MEDIA_TYPE / FILE_TOO_LARGE | 400 / 413 | See the media table |
PUBLISH_FAILED | 502 | LinkedIn rejected the post. See last_error |
RATE_LIMITED | 429 | Includes a Retry-After header |