> ## Documentation Index
> Fetch the complete documentation index at: https://www.outx.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn Like API - Like Posts Programmatically

> Programmatically like LinkedIn posts using the OutX LinkedIn Automation API. Send a like on any post via its activity URN.

The Like Post endpoint creates an async task to like a LinkedIn post. You provide the post's activity URN and the API handles the rest, performing the like action through your team's oldest admin member's LinkedIn account.

## Endpoint

```
POST https://api.outx.ai/linkedin-agent/like-post
```

## Request Body

<ParamField body="social_urn" type="string" required>
  The LinkedIn activity URN of the post to like (e.g., `"urn:li:activity:7123456789012345678"`)
</ParamField>

<Tip>
  **Don't have a social URN?** Use [Fetch Posts](/docs/linkedin-api/fetch-profiles-posts) to retrieve posts from a profile, each post in the response includes its activity URN. If you only have a profile slug, first use [Fetch Profile](/docs/linkedin-api/fetch-profile) to get the profile URN, then fetch their posts.
</Tip>

<Warning>
  The like action is performed using your team's **oldest admin member's LinkedIn account**. Make sure this team member is aware that likes will be made from their account via the API.
</Warning>

## Response

The endpoint returns immediately with a task ID:

<ResponseField name="success" type="boolean">
  Whether the task was created successfully
</ResponseField>

<ResponseField name="api_agent_task_id" type="string">
  UUID to poll for results via [Get Task Status](/docs/linkedin-api/get-task-status)
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable confirmation
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "api_agent_task_id": "550e8400-e29b-41d4-a716-446655440000",
    "message": "Like post task created successfully"
  }
  ```
</ResponseExample>

## Polling for Results

Poll the [Get Task Status](/docs/linkedin-api/get-task-status) endpoint to confirm the like was executed:

```
GET https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=550e8400-e29b-41d4-a716-446655440000
```

### Completed Response

```json theme={null}
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "task_input": {
      "task_type": "agent_like_post",
      "social_urn": "urn:li:activity:7123456789012345678"
    },
    "task_output": {
      "liked": true
    }
  }
}
```

## Code Examples

<RequestExample>
  ```bash cURL theme={null}
  # Like a post
  curl -X POST \
    "https://api.outx.ai/linkedin-agent/like-post" \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{"social_urn": "urn:li:activity:7123456789012345678"}'

  # Check the result
  curl -X GET \
    "https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=TASK_ID" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  async function likePost(socialUrn) {
    // Create the like task
    const response = await fetch(
      "https://api.outx.ai/linkedin-agent/like-post",
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "x-api-key": "YOUR_API_KEY",
        },
        body: JSON.stringify({ social_urn: socialUrn }),
      }
    );

    const { api_agent_task_id } = await response.json();

    // Poll for completion
    while (true) {
      const statusRes = await fetch(
        `https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=${api_agent_task_id}`,
        { headers: { "x-api-key": "YOUR_API_KEY" } }
      );

      const result = await statusRes.json();
      if (result.data.status === "completed") {
        return result.data.task_output;
      }

      await new Promise((r) => setTimeout(r, 5000));
    }
  }

  const result = await likePost("urn:li:activity:7123456789012345678");
  console.log(result); // { liked: true }
  ```

  ```python Python theme={null}
  import requests
  import time

  def like_post(social_urn):
      headers = {
          "Content-Type": "application/json",
          "x-api-key": "YOUR_API_KEY",
      }

      # Create the like task
      response = requests.post(
          "https://api.outx.ai/linkedin-agent/like-post",
          headers=headers,
          json={"social_urn": social_urn},
      )
      task_id = response.json()["api_agent_task_id"]

      # Poll for completion
      while True:
          result = requests.get(
              "https://api.outx.ai/linkedin-agent/get-task-status",
              headers={"x-api-key": "YOUR_API_KEY"},
              params={"api_agent_task_id": task_id},
          ).json()

          if result["data"]["status"] == "completed":
              return result["data"]["task_output"]

          time.sleep(5)

  result = like_post("urn:li:activity:7123456789012345678")
  print(result)  # {"liked": True}
  ```
</RequestExample>

## Error Responses

| Status | Error                                 | Description                                                                                        |
| ------ | ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `400`  | `Missing or invalid 'social_urn'`     | The `social_urn` field is missing or not a string                                                  |
| `401`  | `Missing API Key` / `Invalid API Key` | API key is missing or invalid                                                                      |
| `403`  | `Plugin installation required...`     | No team member has an active Chrome extension. See [Authentication](/docs/api-reference/authentication) |
| `404`  | `No admin user found in the team`     | Your team has no admin members                                                                     |

## FAQ

<AccordionGroup>
  <Accordion title="Whose LinkedIn account performs the like?">
    The like is performed using your team's **oldest admin member's** LinkedIn account (sorted by when they joined the team). This is the team member whose Chrome extension session executes the action.
  </Accordion>

  <Accordion title="Where do I find the activity URN for a post?">
    Activity URNs look like `urn:li:activity:7123456789012345678`. You can find them in LinkedIn post URLs (the number after `/activity/`), or from the output of the [Fetch Posts](/docs/linkedin-api/fetch-profiles-posts) endpoint.
  </Accordion>

  <Accordion title="What about rate limits and LinkedIn safety?">
    **OutX does not rate-limit these requests for you.** OutX is a proxy, every like you trigger is executed immediately on LinkedIn through a real browser session. If you send 50 like requests in rapid succession, all 50 will attempt to execute, and LinkedIn may flag the account for unusual activity. Space out likes by at least 30–60 seconds and distribute them throughout the day. See [Rate Limits](/docs/api-reference/rate-limits) for safe usage guidelines.
  </Accordion>

  <Accordion title="Can I unlike a post?">
    The API currently supports liking posts only. Unlike functionality is on our [roadmap](/docs/linkedin-api/coming-soon). If you need this feature, contact [support@outx.ai](mailto:support@outx.ai).
  </Accordion>

  <Accordion title="Can I like a post as a company page?">
    The LinkedIn API's like endpoint currently performs likes as the admin user's personal account. For company page engagement, see the [Intelligence API](/docs/api-reference/introduction) which supports company actor types.
  </Accordion>
</AccordionGroup>

## Related

* [Comment on Post](/docs/linkedin-api/comment-post) - Comment on posts alongside liking them
* [Fetch Posts](/docs/linkedin-api/fetch-profiles-posts) - Fetch posts to get activity URNs
* [Get Task Status](/docs/linkedin-api/get-task-status) - Poll for task results

***

## Learn More

* [How to Automate LinkedIn Likes Safely](https://www.outx.ai/blog/linkedin-auto-liker)
* [LinkedIn Automation Safety Guide](https://www.outx.ai/blog/linkedin-automation-safety-guide-best-practices-2026)
* [Automate LinkedIn Likes & Comments](https://www.outx.ai/blog/automate-linkedin-likes-comments)
