# People Search API Reference

> Platform documentation snapshot. Access, charging and provider requirements remain operation-specific; examples do not execute requests.

### What it does

Search a database of hundreds of millions of B2B professionals using more than 25 firmographic, demographic and role-based filters. Results come back masked so you can review fit before spending credits, then unlock only the people you actually want, which returns verified work email, personal email and phone numbers.

### Use cases

- Build a net-new outbound list of VPs of Sales at 51-500 employee SaaS companies in California and New York, then unlock only the ones with a verified work email.
- Feed a sequencer (Lemlist, Smartlead, Apollo, Outreach) nightly with fresh contacts matching your ICP filters, deduped against your CRM.
- Find every decision maker inside a target account list by passing company domains plus seniority and department filters.
- Price out a campaign before committing budget by counting masked results, then unlocking in controlled batches.

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `page` | integer | Page number (0-indexed, default: 0) |
| `pageSize` | integer | Results per page (default: 20, max: 100) |
| `jobTitles` | string[] | {value,included}[] | Filter by job title. Accepts a plain string, an array of strings (e.g. ["CEO","Founder"]), or the advanced shape [{ value: "CEO", included: true }] where included=false excludes matching titles. Singular alias `jobTitle` also accepted. |
| `seniorityLevels` | string[] | {value,included}[] | Filter by seniority. Options: "Owner", "Partner", "C-Team" (aliases: "C-Level", "C-Suite", "CXO" auto-map to "C-Team"), "VP", "Director", "Manager", "Senior", "Entry", "Training". Accepts a string, a string[], or {value,included}[]. Singular alias `seniority` accepted. |
| `departments` | string[] | {value,included}[] | Filter by department. Common options: "Engineering", "Sales", "Marketing", "Finance", "HR", "Operations", "Legal", "IT", "Product", "Design", "Support", "Executive". Accepts a string, a string[], or {value,included}[]. Singular alias `department` accepted. |
| `skills` | string[] | {value,included}[] | Filter by professional skills (e.g. ["Python", "Machine Learning"]). |
| `interests` | string[] | {value,included}[] | Filter by interests. |
| `companyNames` | string[] | {value,included}[] | Filter by current company name. Singular alias `companyName` accepted. |
| `urls` | string[] | {value,included}[] | Filter by company website/domain. Aliases: `domain`, `domains`, `companyDomain`, `companyDomains`. |
| `industries` | string[] | {value,included}[] | Filter by industry. Examples: "Information Technology and Services", "Financial Services", "Health Care", "Manufacturing", "Retail", "Construction", "Real Estate", "Education", "Marketing and Advertising". Accepts a string, string[], or {value,included}[]. Singular alias `industry` accepted. |
| `sicCodes` | string[] | {value,included}[] | Filter by SIC code. Alias: `sic`. |
| `naicsCodes` | string[] | {value,included}[] | Filter by NAICS code (e.g. ["5112", "5415"]). Alias: `naics`. |
| `gender` | string[] | {value,included}[] | Filter by gender. Options: "Male", "Female". |
| `age` | string[] | {value,included}[] | Filter by age range. Options: "18-24", "25-34", "35-44", "45-54", "55-64", "65+". |
| `companyRevenues` | string[] | {value,included}[] | Filter by company revenue range. Options: "$0-$1M", "$1M-$10M", "$10M-$50M", "$50M-$100M", "$100M-$500M", "$500M-$1B", "$1B+". Alias: `revenue`, `revenues`. |
| `employeeSizes` | string[] | {value,included}[] | Filter by company employee size. Options: "1-10", "11-50", "51-200", "201-500", "501-1000", "1001-5000", "5001-10000", "10000+". Alias: `employees`, `employeeRange`. |
| `states` | string[] | {value,included}[] | Filter by US state (2-letter codes, e.g. ["CA", "NY", "TX"]). Singular alias `state` accepted. |
| `cities` | string[] | {value,included}[] | Filter by city name (e.g. ["San Francisco", "New York"]). Singular alias `city` accepted. |
| `schools` | string[] | {value,included}[] | Filter by education institution name. |
| `firstName` | string[] | {value,included}[] | Filter by first name. |
| `lastName` | string[] | {value,included}[] | Filter by last name. |
| `hasDirectDialOnly` | boolean|null | Set true to only return contacts with direct dial numbers |
| `hasPersonalEmailOnly` | boolean|null | Set true to only return contacts with personal email |
| `hasPhone` | boolean|null | Set true to only return contacts with a phone number |
| `hasPhoneCell` | boolean|null | Set true to only return contacts with a cell phone |
| `hasWorkEmail` | boolean|null | Set true to only return contacts with work email |
| `after` | string|null | Pagination cursor for next page of results |

### Response Schema

_Complete documented fields for this section, with nested notation preserved. Endpoint-specific envelopes, availability and additional fields are described under each endpoint below._

| Field | Notes |
|-------|-------|
| pid | |
| first_name | |
| last_name | |
| job_title | |
| seniority | |
| department | |
| company_name | |
| company_domain | |
| company_industry | |
| company_employee_range | |
| company_revenue_range | |
| city | |
| state | |
| country | |
| linkedin_url | |
| linkedin_headline | |
| email (masked) | |
| phone (masked) | |
| skills | |
| interests | |
| education | |
| schools | |
| gender | |
| age | |
| job_start_date | |

**Illustrative Example Response (synthetic, not a complete endpoint schema):**

```json
{
  "data": [
    {
      "pid": "abc123",
      "first_name": "string",
      "last_name": "string",
      "job_title": "string",
      "seniority": "string",
      "department": "string",
      "company_name": "string",
      "company_domain": "string",
      "company_industry": "string",
      "company_employee_range": "string",
      "company_revenue_range": "string",
      "city": "string",
      "state": "CA",
      "country": 0,
      "linkedin_url": "https://example.com",
      "linkedin_headline": "string",
      "email": "***",
      "phone": "***",
      "skills": "string",
      "interests": "string",
      "education": "string",
      "schools": "string",
      "gender": "string",
      "age": "string",
      "job_start_date": "2025-06-01T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "has_more": false
  },
  "credits_used": 1
}
```

### POST /contacts/search — Search Prospects (simple)

Search the prospect database. All filters accept either a plain string, an array of strings, or the advanced `{ value, included }[]` shape — the API normalizes them upstream. Returns masked results — use Unlock to reveal full contact details.

**Example Request Body:**

```json
{
  "page": 0,
  "pageSize": 20,
  "jobTitles": [
    "VP of Sales",
    "Chief Revenue Officer"
  ],
  "seniorityLevels": [
    "VP",
    "C-Team"
  ],
  "departments": [
    "Sales"
  ],
  "industries": [
    "Information Technology and Services"
  ],
  "states": [
    "CA",
    "NY"
  ],
  "employeeSizes": [
    "51-200",
    "201-500"
  ],
  "hasWorkEmail": true
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/contacts/search",
  "method": "POST",
  "body": {
    "page": 0,
    "pageSize": 20,
    "jobTitles": [
      "VP of Sales",
      "Chief Revenue Officer"
    ],
    "seniorityLevels": [
      "VP",
      "C-Team"
    ],
    "departments": [
      "Sales"
    ],
    "industries": [
      "Information Technology and Services"
    ],
    "states": [
      "CA",
      "NY"
    ],
    "employeeSizes": [
      "51-200",
      "201-500"
    ],
    "hasWorkEmail": true
  }
}'
```

### POST /contacts/search — Search Prospects (advanced include/exclude)

Use the `{ value, included }[]` shape when you need to exclude specific values (set `included: false`). Mix-and-match with plain strings/arrays as needed.

**Example Request Body:**

```json
{
  "page": 0,
  "pageSize": 20,
  "jobTitles": [
    {
      "value": "CEO",
      "included": true
    },
    {
      "value": "Founder",
      "included": true
    },
    {
      "value": "Interim",
      "included": false
    }
  ],
  "industries": [
    {
      "value": "Information Technology and Services",
      "included": true
    }
  ],
  "states": [
    {
      "value": "CA",
      "included": true
    }
  ]
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/contacts/search",
  "method": "POST",
  "body": {
    "page": 0,
    "pageSize": 20,
    "jobTitles": [
      {
        "value": "CEO",
        "included": true
      },
      {
        "value": "Founder",
        "included": true
      },
      {
        "value": "Interim",
        "included": false
      }
    ],
    "industries": [
      {
        "value": "Information Technology and Services",
        "included": true
      }
    ],
    "states": [
      {
        "value": "CA",
        "included": true
      }
    ]
  }
}'
```

### POST /contacts/unlock — Unlock Prospects

Unlock full contact details (email, phone, etc.) by providing prospect PIDs. Each unlock uses 1 data credit.

Email Finder fallback (free): If an unlocked contact has no work email (or only a personal email like gmail/yahoo), we automatically run Email Finder against `firstName + lastName + companyDomain` and merge the result into the response under `email`, `work_email`, `email_source: "email_finder"`, and `email_finder` (status, confidence, smtp_result, catch_all). No extra credits — included with the unlock.

**Example Request Body:**

```json
{
  "pids": [
    "10000000331"
  ]
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/contacts/unlock",
  "method": "POST",
  "body": {
    "pids": [
      "10000000331"
    ]
  }
}'
```

