Graphrt

LinkedIn

LinkedIn member and organization posts, images, comments and reactions via the official LinkedIn REST API

Beta v0.2.0 Node.js 15 actions ToS risk high
Use in Graphrt Desktop

About

A Graphrt plugin for the official LinkedIn REST API (https://api.linkedin.com/rest). It publishes and manages posts as a member or an organization, uploads images, and reads and writes comments and reactions. Every operation is a workflow node. Agent tools are limited by the agent policy.

What it can do

  • Profile: get_userinfo (OpenID Connect userinfo plus the member's person_urn)
  • Posts: create (text, image or article link), read, list an organization's posts, edit text, delete
  • Images: upload_image downloads an image from an https URL and uploads it to LinkedIn, returning an image_urn for create_post
  • Comments: list (on a post, or replies on a comment), create, reply, edit, delete
  • Reactions: add (LIKE, PRAISE, EMPATHY, INTEREST, APPRECIATION, ENTERTAINMENT), remove, list
  • api_request: any other REST endpoint, restricted to api.linkedin.com (see the limits under Usage)
  • Clear error kinds, tokens never appear in errors.

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Get LinkedIn member linkedin-api.get_userinfo
  • Create LinkedIn post linkedin-api.create_post
  • Get LinkedIn post linkedin-api.get_post
  • List organization posts linkedin-api.list_organization_posts
  • Update LinkedIn post linkedin-api.update_post
  • Delete LinkedIn post linkedin-api.delete_post
  • Upload LinkedIn image linkedin-api.upload_image
  • List LinkedIn comments linkedin-api.list_comments
  • Comment on LinkedIn linkedin-api.create_comment
  • Edit LinkedIn comment linkedin-api.update_comment
Show all 15 actions
  • Delete LinkedIn comment linkedin-api.delete_comment
  • React on LinkedIn linkedin-api.add_reaction
  • Remove LinkedIn reaction linkedin-api.remove_reaction
  • List LinkedIn reactions linkedin-api.list_reactions
  • LinkedIn REST API request linkedin-api.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • LINKEDIN_ACCESS_TOKEN Required
    OAuth 2.0 access token
  • LINKEDIN_AUTHOR_URN Optional
    Default author/actor for posts, comments, reactions and image uploads: urn:li:person:<sub> (from get_userinfo) or urn:li:organization:<id>
  • LINKEDIN_TOOL_ALLOW_POST Optional
    1 lets agent tools create and edit posts and comments (see Agent policy, LinkedIn's terms forbid automated posting)
  • LINKEDIN_TOOL_ALLOW_ENGAGE Optional
    1 lets agent tools add and remove reactions
  • LINKEDIN_VERSION Optional
    API version header Linkedin-Version, YYYYMM, default 202611. LinkedIn retires versions after about a year, an inactive one fails with invalid_input
  • LINKEDIN_API_TOOL_TOKEN_SOURCE

How to use it

In Graphrt Desktop

  1. Open Plugins and search for LinkedIn.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install linkedin-api --yes
workflow.yaml
- id: image
  type: linkedin-api.upload_image
  image_url: "https://example.com/banner.png"
- id: post
  type: linkedin-api.create_post
  text: "We're hiring (remote)!"
  image_urn: "{{#image.data.image_urn#}}"
  image_alt_text: "Hiring banner"
- id: like
  type: linkedin-api.add_reaction
  target_urn: "{{#post.data.id#}}"
  reaction_type: PRAISE
Plugins in the docs