---
title: "Start a search"
method: POST
path: "/v1/finder/searches"
tags: ["RecruitAffiliates.ai"]
---

# Start a search

`POST /v1/finder/searches`

## Request

- Base URL: `https://api.affiliaterail.com`
- URL: `https://api.affiliaterail.com/v1/finder/searches`
- Auth: HTTP bearer

Spends one search credit and starts the search in the background. Poll `GET /searches/{id}`, then read what it found with `GET /prospects`. If the search can't start, the credit comes back straight away and the search answers `failed` with `credit_refunded: true`.

Send an `Idempotency-Key`: a retry with the same key answers the first search and never spends twice.

A test key answers a `queued` search that is stored nowhere and never runs. It spends nothing.

**Scope:** `finder:write`

## Request body

- FinderSearchCreate
  - `brand_id` string: Which brand. Defaults to the organization's oldest.
  - `type` 'topic' | 'competitor' | 'lookalike', required: `topic`: who writes about a subject. `competitor`: who promotes a competitor. `lookalike`: YouTube channels like one you name.
  - `seed` string, required: The topic (3 to 80 characters), the competitor's domain or YouTube handle, or a YouTube channel, handle or video link
  - `country` string: ISO 3166-1 alpha-2. Required for `topic`.

## Response `201`

The search

- FinderSearch
  - `id` string, required: Prefixed id (`fsc_…`)
  - `object` 'finder_search', required
  - `brand_id` string, required: Prefixed id (`fbr_…`)
  - `type` 'topic' | 'competitor' | 'lookalike' | 'clone', required
  - `seed` string, required: What was searched: the topic, the competitor's domain or handle, the YouTube channel, or for `clone` the creators it started from
  - `country` string, nullable, required: Topic and clone searches only
  - `label` string, required: What the app calls it in Recent searches
  - `state` 'queued' | 'running' | 'done' | 'failed' | 'stopped_at_ceiling', required
  - `found` integer, required
  - `error` string, nullable, required
  - `credit_refunded` boolean, required: True when the search failed and its credit came back
  - `created_at` string, date-time, required: ISO-8601, UTC
  - `finished_at` string, date-time, nullable, required: ISO-8601, UTC
  - `livemode` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Missing or unknown API key
- `402`: The organization's Recruit Affiliates plan does not include the API
- `403`: Key lacks the required scope
- `404`: No such object in your organization
- `409`: In conflict with the object's state, or the same idempotent request is still running
- `422`: The request was understood and refused
- `429`: Rate limited, by key or by organization: see Retry-After and X-RateLimit-Scope
- `501`: Not available to a test key (`sandbox_no_send`)

---

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