---
title: "Search posts"
method: POST
path: "/v1/actions/search_posts"
tags: ["Search"]
---

# Search posts

`POST /v1/actions/search_posts`

## Request

- Base URL: `https://api.heyreagent.com`
- URL: `https://api.heyreagent.com/v1/actions/search_posts`
- Auth: HTTP bearer

Search posts by words, date and who wrote or is mentioned in them, by name.

Company and industry filters are NAMES here; the action looks the ids up itself and takes the top match. search_linkedin_posts takes the ids.

When author.isCompany is true, author.profileUrl is a company link, which actions asking for a profile link do not take.

nextCursor names the account that ran the search: it is refused by any other action, and by this one once that account is gone.

Docs: https://heyreagent.com/docs/actions/search_posts

## Request body

- object
  - `keywords` string: Words to search for in posts, e.g. "cold email deliverability". LinkedIn search operators work ("exact phrase", AND, OR, NOT).
  - `sortBy` 'relevance' | 'date': "relevance" (LinkedIn's default) or "date" (newest first).
  - `datePosted` 'past_day' | 'past_week' | 'past_month': Only posts from the past day, week or month.
  - `contentType` 'videos' | 'images' | 'live_videos' | 'collaborative_articles' | 'documents' | 'jobs': Only posts with this kind of content.
  - `authorKeywords` string: Words in the AUTHOR's headline / title, e.g. "founder" or "head of sales".
  - `authorIndustries` string[]: Industry names the author works in, e.g. ["Software Development"].
  - `authorCompanies` string[]: Company names — posts written by PEOPLE who work at these companies.
  - `fromCompanies` string[]: Company names — posts published by these COMPANY PAGES themselves.
  - `mentioningCompanies` string[]: Company names — posts that @mention these companies (e.g. a competitor).
  - `postedBy` 'me' | 'first_connections' | 'people_you_follow': Only posts by you ("me"), by your 1st-degree connections, or by people you follow. Runs on your own LinkedIn sender, so one must be connected.
  - `limit` number: Max posts to return (1–50, default 10).
  - `cursor` string: nextCursor from the previous call, to get the next page. Keep every other argument the same.
  - `connectionId` string: Which of your LinkedIn senders to search through (its id from list_linkedin_accounts). Omit to use your first live sender, or the shared account when you have none.

## Response `200`

It worked. Inside result: returned, hasMore, nextCursor, applied, posts, note.

- Worked
  - `ok` true, required
  - `result` object, required: What was asked for. A field that does not apply is left out, or is null.

## Other responses

- `default`: It did not work. The message says why, in plain English.

---

[API](https://skmtc.dev/heyreagent/apis/heyreagent-api.md) · [All operations](https://skmtc.dev/heyreagent/apis/heyreagent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/heyreagent/apis/heyreagent-api/revisions/917360c5f841?raw)
