Ukigai

Access by invitation

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: every GET (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 from social:write on 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, or 403 KEY_OWNER_MISSING if 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

  1. Find a target. GET /social/targets lists the profiles and Company Pages you can post to. Keep the id.
  2. Create a draft. Post the text against that target_id.
  3. Attach media (optional). Upload up to 9 images or 1 video.
  4. Schedule it or publish it now.
  5. Poll the post to watch status, then read linkedin_post_url and, 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": "..."
}
  • type is organization for a Company Page and person for a personal profile.
  • connection_expires_at is when the LinkedIn authorization runs out. After that, posts fail until someone reconnects the account in the app.
  • connection_error holds the last error LinkedIn returned for the connection. If it isn't null, check the connection in the app before you schedule.

Posts

A post has these fields:

FieldTypeNotes
iduuid
target_id / targetuuid / objectWhere it posts (id, type, display_name, vanity_name)
bodystringThe post text, up to 3,000 characters
mentionsarrayPeople mentioned in body: { name, urn }. See "Mentioning people" below
languagestring | nullOptional language tag, e.g. "en"
statusstringdraft, scheduled, publishing, published, failed, cancelled
scheduled_fortimestamp | nullWhen a scheduled post goes out
published_attimestamp | null
linkedin_post_urlstring | nullLink to the live post once it's published
linkedin_share_urnstring | nullLinkedIn's id for the post
publish_attempt_countinteger
last_errorstring | nullWhy the last publish attempt failed
sourcestringmanual, ai_assisted or ai_generated (API-created posts are manual)
reshare_ofobject | nullSet on a repost. See "Reposting with commentary" below
mediaarray{ id, position, kind, mime_type, size_bytes, alt_text }
created_at / updated_attimestamp

How status changes:

  • A new post starts as draft, and a draft never publishes on its own.
  • schedule moves it to scheduled. unschedule moves it back to draft.
  • At the scheduled time, or when you call publish, it goes to publishing and then to published or failed.
  • A failed post keeps its text and media, so you can schedule or publish it again.
  • cancelled posts 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"
  }'
FieldTypeRequired
target_iduuid from GET /social/targetsyes
bodystring, max 3,000 charsno (an empty draft is fine; it needs text or media before it can be scheduled)
mentionsarray of { name, urn }no. Each one must appear in body as @name. See "Mentioning people" below
languagestringno
reshare_of_post_iduuid from GET /social/reshare-sourcesno. 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" }
    ]
  }'
  • name is the text after @, and urn is the person's LinkedIn urn:li:person:… id. Every @name in the body becomes that mention, so @Jane Doe twice is two mentions of the same person.
  • @name only counts when it is a whole word: @Jane doesn't match inside @Janet or ana@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 body as you sent it, plus mentions. 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 in body yourself. 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 name in 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-profiles lists the people your organization has already set up for mentions, each with a urn you 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:

ValueMeaning
connected_memberThe person connected their own LinkedIn profile to Ukigai, so LinkedIn gave the URN directly. id is null
linkedin_lookupUkigai resolved it from their profile URL through LinkedIn
manual_urnSomeone 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:

  1. Find the post to repost. GET /social/reshare-sources lists posts that are already published.
  2. Create the repost. POST /social/posts with the target_id of the profile to repost from, reshare_of_post_id, and your comment as body.
  3. 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. Its linkedin_share_urn and linkedin_post_url are null until it publishes.
  • blocked: the repost won't publish. blocked_reason says 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_id and body become null.

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:

  1. GET /social/reshare-sources?include_scheduled=true and pick the scheduled original.
  2. POST /social/posts with reshare_of_post_id, as above.
  3. POST /social/posts/:id/schedule with a scheduled_for later than the original's scheduled_for. An equal or earlier time returns 400 RESHARE_SCHEDULED_BEFORE_ORIGINAL, with the original's time in details.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, its scheduled_for moves to shortly after the original's time, and reshare_of.state is waiting_for_original. Waiting doesn't use up publish attempts.
  • Original deleted, failed, cancelled or moved back to draft: the repost is blocked. Its status becomes failed, last_error explains why, and reshare_of.state is blocked with a blocked_reason.
  • Still waiting 24 hours after the repost was due: it's blocked with original_wait_expired.
blocked_reasonMeaning
original_deletedThe original was deleted before it was published
original_failedThe original failed to publish on LinkedIn
original_cancelledThe original was cancelled
original_unscheduledThe original was moved back to draft
original_wait_expiredThe 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"
KindTypesMax size
ImageJPEG, PNG, GIF5 MB
VideoMP4, MOVsee 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, failed and cancelled posts.
  • On an already scheduled post 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:

  • 200 with the post, now published, including linkedin_post_url.
  • 202 with code: "MEDIA_PROCESSING": LinkedIn is still processing a video. The post is queued and will publish automatically within a few minutes. Poll GET /posts/:id.
  • 502 PUBLISH_FAILED: LinkedIn rejected the post. details.post shows the post, now failed, with last_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:

CodeStatusMeaning
INSUFFICIENT_SCOPE403The key lacks the scope, e.g. a social:write-only key calling schedule
KEY_OWNER_FORBIDDEN403The key's creator no longer has the Social Networks permission this action needs
KEY_OWNER_MISSING403The key's creator was deleted. Create a new key
MODULE_DISABLED403Marketing isn't enabled for your organization
TARGET_NOT_FOUND / TARGET_NOT_ALLOWED404 / 403Unknown target_id, or a connection this key can't use
POST_NOT_FOUND404No such post, or one on a connection this key can't use
POST_LOCKED409Editing, scheduling or changing media on a publishing or published post
POST_PUBLISHING / POST_ALREADY_PUBLISHED409Publish or delete while a publish is in progress or done
POST_NOT_SCHEDULED409unschedule on a post that isn't scheduled
POST_STATUS_CHANGED409The publisher picked the post up mid-request. Fetch it and retry
EMPTY_POST400Scheduling or publishing a post with no text and no media
EMPTY_COMMENTARY400Scheduling or publishing a repost without a comment
RESHARE_SOURCE_NOT_FOUND404Unknown reshare_of_post_id, or a post you can't repost
RESHARE_SOURCE_NOT_PUBLISHED / RESHARE_OF_RESHARE409 / 400The original is neither published nor scheduled, or is itself a repost
RESHARE_SCHEDULED_BEFORE_ORIGINAL400Scheduling a repost at or before its original's scheduled time
RESHARE_ORIGINAL_NOT_PUBLISHED409Publishing a repost now while its original is still scheduled
RESHARE_ORIGINAL_UNAVAILABLE409Scheduling or publishing a repost whose original was deleted, failed, cancelled or moved back to draft. See details.reason
RESHARE_NO_MEDIA400Adding images or a video to a repost
BODY_TOO_LONG400body over 3,000 characters
INVALID_MENTIONS / INVALID_MENTION_NAME / INVALID_MENTION_URN400mentions 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_BODY400A mention's @name doesn't appear in body
MENTION_NAME_CONFLICT / TOO_MANY_MENTIONS400Two people share one name, or more than 25 mentions
INVALID_SCHEDULED_FOR400Missing, unparseable or past scheduled_for
MEDIA_LIMIT400More than 9 images, or images mixed with a video
UNSUPPORTED_MEDIA_TYPE / FILE_TOO_LARGE400 / 413See the media table
PUBLISH_FAILED502LinkedIn rejected the post. See last_error
RATE_LIMITED429Includes a Retry-After header