# Start a search

Starts a signal search and answers **202** with the search. Poll GET /searches/{search_id}, or pass `?wait=1` to `25` to wait that many seconds. Finished in time, the call answers **200**. A raw search that succeeded within `wait` also inlines its rows in `results`.

Starts a signal search and answers **202** with the search. Poll GET /searches/{search_id}, or pass `?wait=1` to `25` to wait that many seconds. Finished in time, the call answers **200**. A raw search that succeeded within `wait` also inlines its rows in `results`.

Mode `raw`, the default of every type, returns the rows of the source and charges per row: a funding company is 1 credit, a technology company is 20, a person from engagement, listening, an event or a new role is 5. No AI judges a raw row. For the LinkedIn signals a row is a person as LinkedIn shows them next to a post (name, headline, what they did, the post), and you decide who fits: see [Recipes](/docs/guides/recipes). Mode `screened` has our AI check people against a buyer profile and charges 20 per exact lead and 5 per lead just outside. A search that delivers nothing is free.

Fields that belong to mode screened (`buyer_profile`, `max_leads`, `just_outside`, `signal.about`, `signal.drop_intents`) are `400` with code `param_not_allowed_in_raw` in mode raw; without `mode`, the message says to send `"mode": "screened"`. An unknown technology is `400` with code `unknown_technology` and `suggestions`. In mode screened, an event name stops at `requires_action` so you choose the event. Mode raw never looks the event up: send its exact name with the year, its hashtags or its organizer page.

## Authentication

Send `Authorization: Bearer gtk_…`. Create the key under **Connect assistant → API keys**. A missing, invalid or revoked key is **401**, including while this API is closed. A valid key while the API is closed for your organization answers **404**, the same body as an unknown path. Every response includes `FounderMCP-Api-Version` and `FounderMCP-Request-Id`.

### Query parameters

- **`wait`** `integer` — Seconds to wait before answering, 0 to 25. Defaults to 0, which answers 202 at once.

### Headers

- **`Idempotency-Key`** `string` · **required** — Required on this call. The same key and the same body replay the first response for 24 hours (`Idempotent-Replayed: true`). The same key with a different body is `409` `idempotency_conflict`.

### Body parameters

- **`signal`** `object` · **required** — Required. `type` is `linkedin_engagement` (needs `company.linkedin_url`), `social_listening` (needs `query`), `funding_raised` (needs `countries`), `new_in_role` (needs `titles`), `events` (needs `event.event_id` or `event.name`; `event_posts` is the old name) or `tech_adoption` (needs `technologies`, raw only).
- **`mode`** `string` — Left out uses the type default: `raw` for every type. `raw` returns the rows of the source, with no AI judging them. Send `screened` to have our AI check people against `buyer_profile` (not for tech adoption). One of: `raw`, `screened`.
- **`buyer_profile`** `object` — Buyer profile, mode screened only. `roles` (departments: `ceo`, `sales`, `marketing`, `finance`, `operations`, `hr`, `it`, `talent_acquisition`, `engineering`, `product`, `customer_success`, `data`, `procurement`, `legal`), `titles`, `levels` (`c_level`, `vp`, `director`, `manager`), `countries` (ISO alpha-2, or `EUROPE`), `allow_recruiters`, `allow_vendors`. `sectors` and `company_sizes` only on `new_in_role`. Empty means anyone.
- **`exclude_companies`** `object[]` — Up to 20 LinkedIn company pages whose rows are never delivered. Tech adoption uses `signal.exclude_domains` instead.
- **`max_leads`** `integer` — Mode screened. Caps at 10 for engagement, listening and events, and 25 for funding and new-in-role. A higher number is clamped. Defaults to 25, then clamped.
- **`just_outside`** `string` — Mode screened. `auto` (default) and `always` fill up to 10 rows with near-misses. `never` returns exact leads only. One of: `auto`, `never`, `always`.
- **`limit`** `integer` — Mode raw. How many rows. Capped at the type maximum from GET /signals.
- **`cursor`** `string | null` — Mode raw. `result.next_cursor` of an earlier raw search with the same signal. One chain delivers at most 500 rows, kept 30 days.
- **`webhook_endpoint_id`** `string | null` — A webhook endpoint id (`whe_…`) that receives this search’s events.
- **`metadata`** `object` — Up to 10 string values. Keys 1–40 characters, values up to 200.
- **`max_credits`** `integer | null` — Stop before the next row would pass this. Below one row the call is `402` `max_credits_exceeded` and nothing runs.

## Response

- **`id`** `string` · **required** — Search id, `srch_…`.
- **`object`** `string` · **required** — Always `search`. One of: `search`.
- **`status`** `string` · **required** — Where the search is. One of: `queued`, `running`, `requires_action`, `succeeded`, `failed`, `cancelled`, `expired`.
- **`mode`** `string` · **required** — `raw` or `screened`. One of: `raw`, `screened`.
- **`signal_type`** `string` · **required** — The signal you asked for. One of: `linkedin_engagement`, `social_listening`, `funding_raised`, `new_in_role`, `events`, `tech_adoption`.
- **`progress`** `object | null` — `stage` and `message` while it runs.
- **`result`** `object | null` — Set when `status` is `succeeded`. Screened: `exact`, `just_outside`, `total_estimate`, `max_leads_applied`. Raw: `rows`, `has_more`, `next_cursor`.
- **`credits`** `object` · **required** — `charged`, `reserved` (worst case while open, 0 when finished) and `max_credits`.
- **`required_action`** `object | null` — Set on `requires_action`: `type` `choose_event`, `candidates` (up to 5) and `expires_at` (24 hours).
- **`error`** `object | null` — Set when `status` is `failed`: `type`, `message`, `retryable`.
- **`request`** `object` · **required** — The body as validated, with defaults filled in.

## Credits

Charged per delivered row or lead, at the price in GET /signals. An exact screened lead is 20 credits. A lead just outside is 5. A funding company is 1. A technology company is 20. Nothing delivered, a failure, a cancel and an expiry are free. Errors and empty lookups are free. A call that spent credits puts that number in `credits_used`, in `X-Credits-Used` and in `X-Credits-Charged`. When the wallet can be read, the response also sends `X-Credits-Remaining`.

## Errors

- **400** `invalid_request` — The body is not valid JSON, a field is unknown or has the wrong type, or a value is not allowed.
- **401** `authentication_error` — The Authorization header is missing, or the key is unknown or revoked.
- **403** `permission_error` — API access is not part of your plan, or your account is suspended.
- **404** `not_found` — The endpoint does not exist.
- **429** `rate_limit_error` — More than 60 requests per minute, or more than 3 at the same time, on one key. Wait for the Retry-After header.
- **429** `daily_limit_reached` — The request could take your organization over its daily credit limit. The limit resets at midnight (Europe/Brussels).
- **402** `insufficient_credits` — The credit balance is lower than this request could cost. Nothing was charged. Add credits, or send a smaller request. The error includes code, fix and a link to the credits docs.
- **502** `upstream_error` — The data source did not answer. Retry later.
- **503** `service_unavailable` — The API is temporarily unavailable. Retry later.
- **500** `internal_error` — Something went wrong on our side.
- **402** `max_credits_exceeded` — max_credits is lower than the credits of the first row, so nothing could be returned. Nothing was charged; raise max_credits or ask for fewer rows.
- **409** `idempotency_conflict` — The Idempotency-Key was already used with another request body.
- **409** `idempotency_in_progress` — The first request with this Idempotency-Key is still being processed. Wait for the Retry-After header.
- **422** `unresolvable_input` — A company, person or event in the request does not exist or cannot be found.

## Example

### cURL

```bash
curl -X POST "https://foundermcp.dev/api/v1/searches?wait=25" \
  -H "Authorization: Bearer $FOUNDERMCP_API_KEY" \
  -H "Idempotency-Key: idem-1" \
  -H "Content-Type: application/json" \
  -d '{
    "signal": {
      "type": "linkedin_engagement",
      "company": {
        "linkedin_url": "https://www.linkedin.com/company/acme-analytics"
      },
      "leads_from": "reactors"
    },
    "limit": 25,
    "max_credits": 125
  }'
```

### JavaScript

```javascript
const response = await fetch('https://foundermcp.dev/api/v1/searches?wait=25', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FOUNDERMCP_API_KEY}`,
    'Idempotency-Key': 'idem-1',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "signal": {
      "type": "linkedin_engagement",
      "company": {
        "linkedin_url": "https://www.linkedin.com/company/acme-analytics"
      },
      "leads_from": "reactors"
    },
    "limit": 25,
    "max_credits": 125
  })
});
const body = await response.json();
```

### Python

```python
import json
import os
import urllib.request

payload = {
  "signal": {
    "type": "linkedin_engagement",
    "company": {
      "linkedin_url": "https://www.linkedin.com/company/acme-analytics"
    },
    "leads_from": "reactors"
  },
  "limit": 25,
  "max_credits": 125
}

request = urllib.request.Request(
    "https://foundermcp.dev/api/v1/searches?wait=25",
    headers={
    "Authorization": f"Bearer {os.environ['FOUNDERMCP_API_KEY']}",
    "Idempotency-Key": "idem-1",
    "Content-Type": "application/json"
    },
    data=json.dumps(payload).encode(),
    method="POST",
)
with urllib.request.urlopen(request) as response:
    body = json.load(response)
```

### Example response

```json
{
  "id": "srch_01J9Z6P8C8V0K3W6T2N8R5M1XA",
  "object": "search",
  "status": "succeeded",
  "mode": "raw",
  "signal_type": "linkedin_engagement",
  "funnel": {
    "posts": 10,
    "people": 23
  },
  "result": {
    "rows": 18,
    "has_more": false,
    "next_cursor": null,
    "total_estimate": 18,
    "truncated_by": null
  },
  "credits": {
    "charged": 90,
    "reserved": 0,
    "max_credits": 125
  },
  "sources": [
    "linkedin"
  ],
  "required_action": null,
  "error": null,
  "notes": [
    "Left out, and not charged: 5 people who work at Acme Analytics (by their headline).",
    "Raw rows are not checked against a buyer profile and no AI judged them: decide yourself who fits, from each headline and post. Send mode screened to have FounderMCP check people against a buyer_profile instead."
  ]
}
```
