> ## 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.

# Like a Post

> Create a task to like a LinkedIn post as a user or company

Automate likes on LinkedIn posts through OutX. Engage as an individual user or on behalf of a company page, making it easy to scale engagement and stay visible without manual effort.

## Request Body

<ParamField body="post_id" type="string" required>
  The unique identifier of the post to like. This is the `id` field from the Posts API response.
</ParamField>

<ParamField body="user_email" type="string" required>
  Email address of the user who will like the post.

  * For **user** actor type: The user's email
  * For **company** actor type: The admin user's email who manages the company page
</ParamField>

<ParamField body="actor_type" type="string" default="user">
  Who is performing the like action. Options:

  * `user` - Like as an individual user
  * `company` - Like on behalf of a company page
</ParamField>

<ParamField body="company_title" type="string">
  **Required when `actor_type` is `company`**

  The exact company name/title as it appears on LinkedIn. This is used to identify which company page should like the post.
</ParamField>

<RequestExample>
  ```bash Like as User theme={null}
  curl -X POST \
    "https://api.outx.ai/api-like" \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{
      "post_id": "123e4567-e89b-12d3-a456-426614174000",
      "user_email": "john.doe@example.com",
      "actor_type": "user"
    }'
  ```

  ```bash Like as Company theme={null}
  curl -X POST \
    "https://api.outx.ai/api-like" \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{
      "post_id": "123e4567-e89b-12d3-a456-426614174000",
      "user_email": "admin@company.com",
      "actor_type": "company",
      "company_title": "Acme Corporation"
    }'
  ```

  ```javascript JavaScript theme={null}
  // Like as a user
  const likeAsUser = async (postId, userEmail) => {
    const response = await fetch(
      'https://api.outx.ai/api-like',
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-api-key': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          post_id: postId,
          user_email: userEmail,
          actor_type: 'user'
        })
      }
    );
    
    return await response.json();
  };

  // Like as a company
  const likeAsCompany = async (postId, adminEmail, companyTitle) => {
    const response = await fetch(
      'https://api.outx.ai/api-like',
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-api-key': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          post_id: postId,
          user_email: adminEmail,
          actor_type: 'company',
          company_title: companyTitle
        })
      }
    );
    
    return await response.json();
  };

  // Usage
  const result = await likeAsUser('post-123', 'john@example.com');
  console.log(result.message);
  ```

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

  def like_as_user(post_id, user_email, api_key):
      """Like a post as a user"""
      url = 'https://api.outx.ai/api-like'
      headers = {
          'Content-Type': 'application/json',
          'x-api-key': api_key
      }
      payload = {
          'post_id': post_id,
          'user_email': user_email,
          'actor_type': 'user'
      }
      
      response = requests.post(url, headers=headers, json=payload)
      return response.json()

  def like_as_company(post_id, admin_email, company_title, api_key):
      """Like a post as a company"""
      url = 'https://api.outx.ai/api-like'
      headers = {
          'Content-Type': 'application/json',
          'x-api-key': api_key
      }
      payload = {
          'post_id': post_id,
          'user_email': admin_email,
          'actor_type': 'company',
          'company_title': company_title
      }
      
      response = requests.post(url, headers=headers, json=payload)
      return response.json()

  # Usage
  result = like_as_user('post-123', 'john@example.com', 'YOUR_API_KEY')
  print(result['message'])
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Like task created successfully",
    "task_id": "456e7890-e12b-34d5-a678-912345678901"
  }
  ```
</ResponseExample>

## Response Fields

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

<ResponseField name="message" type="string">
  Human-readable message about the operation
</ResponseField>

<ResponseField name="task_id" type="string">
  Unique identifier for the created task. Use this to track the task status.
</ResponseField>

## How It Works

<Steps>
  <Step title="Task Creation">
    When you call the Like API, a task is created and queued for processing
  </Step>

  <Step title="Validation">
    The system validates:

    * Post exists and belongs to your team's watchlists
    * User email is valid and associated with your team
    * Company title matches (if liking as company)
    * You haven't exceeded plan limits
  </Step>

  <Step title="Asynchronous Processing">
    The like is processed asynchronously by OutX's automation system
  </Step>

  <Step title="Execution">
    The like is performed on LinkedIn on behalf of the specified user or company
  </Step>
</Steps>

## Actor Types Explained

### User Actor Type

When `actor_type` is `user`:

* The like appears as coming from the individual user
* `user_email` should be the email of the user who will like the post
* The user must be part of your OutX team
* No `company_title` is needed

**Use case:** Personal engagement, building individual presence

### Company Actor Type

When `actor_type` is `company`:

* The like appears as coming from your company page
* `user_email` should be the admin user's email who manages the company page
* `company_title` must exactly match the company name on LinkedIn
* The admin user must have permission to manage the company page

**Use case:** Brand engagement, company visibility, B2B marketing

## Error Responses

| Status Code | Error Message                                            | Description                                                |
| ----------- | -------------------------------------------------------- | ---------------------------------------------------------- |
| 400         | Missing required parameter: post\_id                     | `post_id` is required                                      |
| 400         | Missing required parameter: user\_email                  | `user_email` is required                                   |
| 400         | Invalid actor\_type                                      | Must be 'user' or 'company'                                |
| 400         | company\_title is required when actor\_type is 'company' | Missing company title                                      |
| 400         | Post does not support like functionality                 | Post is missing required data                              |
| 401         | Unauthorized                                             | Invalid or missing API key                                 |
| 403         | Access denied                                            | Post doesn't belong to your team's watchlists              |
| 404         | Post not found                                           | Invalid post ID                                            |
| 404         | User not found                                           | Invalid user email                                         |
| 404         | Company not found                                        | Company title doesn't match any company for the admin user |
| 402         | Plan limit reached                                       | You've exceeded your plan's like limit                     |

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="How long does it take for a like to appear on LinkedIn?">
    Likes are processed asynchronously. Once you submit a like request, a task is created and queued. The like typically appears on LinkedIn within a few minutes, depending on when the Chrome extension processes the task. The extension must be active in a team member's browser for the task to be executed.
  </Accordion>

  <Accordion title="Can I like posts from a company page?">
    Yes. Set `actor_type` to `"company"` and provide the `company_title` field with the exact company name as it appears on LinkedIn. The `user_email` should be the email of an admin user who has permission to manage that company page.
  </Accordion>
</AccordionGroup>
