# Billing Usage Source: https://docs.minerva.io/api-reference/billing-usage GET https://api.minerva.io/billing/usage Check remaining record allowance, overage spend and current record export capacity ## Quick Answer **How much record allowance does my organization have left?** Use this endpoint to check remaining included allowance, overage spend and capacity for additional unique record exports. **Common questions this endpoint answers:** * How much included record allowance remains? * When will the next allowance be released? * How much overage spend remains under our monthly limit? * What is our current billing access status? **What you get back:** An organization-wide billing summary with the current term, remaining allowance and overage capacity. ## Overview Returns the current billing summary for the organization associated with your API key. It covers organization-wide record exports across channels, not just API activity. For API request counts and historical buckets, use [Endpoint Usage](/api-reference/usage-endpoints). ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/billing/usage' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* Your organization's API key. Your organization must have Data API access. No billing management permission is required. ### Request Notes * There are no query parameters or request body. * The organization comes from your authenticated key; you cannot select another organization. ## Response The response is a single object, without a `results` wrapper. Responses use `Cache-Control: no-store`. ### Success Response **access\_status** `string` `no_plan`, `trial`, `active` or `suspended`. **access\_reason** `string or null` `trial_expired`, `delinquent` or `contract_ended`, when applicable. **product\_tier** `string or null` `growth` or `enterprise`, when applicable. **current\_term** `object or null` Current usable contract or Trial term. Also null for Unlimited Enterprise. **request\_completed\_at** `string` ISO 8601 timestamp of the summary evaluation. **managed\_by** `string` Present for agency-managed organizations: billing parent's display name. **has\_product\_access** `boolean` Present for agency-managed organizations: whether the shared billing account permits product access. ### Current Term Object **term\_type** `string` `trial` or `contract`. **product\_tier** `string` `growth` or `enterprise`. **starts\_at** `string` ISO 8601 timestamp when the term starts. **ends\_at** `string` ISO 8601 timestamp when the term ends. **allowance.granted\_records** `integer` Released, unexpired allowance; excludes future releases. **allowance.used\_records** `integer` Reserved plus finalized records funded by that allowance. **allowance.available\_records** `integer` Remaining included record allowance. **allowance.next\_release\_at** `string or null` Next regular plan allowance release within the term, if any. **allowance.next\_release\_records** `integer` Records in that next release; zero when none is scheduled. **overage** `object or null` Current contract-month overage; null for Trial. **full\_record\_capacity\_available** `integer` Remaining allowance plus overage capacity for additional unique record exports. ### Overage Object All monetary fields are in **USD cents** and can contain fractional cents. **used\_records** `integer` Reserved plus finalized overage records in the current contract month. **available\_records** `integer` Additional records fundable by the remaining spend limit. **limit\_reached** `boolean` No allowance remains and the remaining spend cannot fund another record. **unit\_rate\_cents** `number` Price per overage record. **committed\_spend\_cents** `number` Overage records multiplied by the rate, including reservations. **spend\_limit\_cents** `number` Monthly billable-usage cap, excluding the base subscription. **remaining\_spend\_cents** `number` Remaining headroom under that cap. For agency-managed organizations, the service returns shared record capacity from the billing parent. Overage contains only `used_records`, `available_records` and `limit_reached`; prices and spend amounts are omitted. ```json 200 theme={null} { "access_status": "active", "access_reason": null, "product_tier": "growth", "current_term": { "term_type": "contract", "product_tier": "growth", "starts_at": "2026-10-01T00:00:00Z", "ends_at": "2027-10-01T00:00:00Z", "allowance": { "granted_records": 1000, "used_records": 700, "available_records": 300, "next_release_at": "2026-11-01T00:00:00Z", "next_release_records": 1000 }, "overage": { "unit_rate_cents": 40.0, "used_records": 5, "committed_spend_cents": 200.0, "spend_limit_cents": 40000.0, "remaining_spend_cents": 39800.0, "available_records": 995, "limit_reached": false }, "full_record_capacity_available": 1295 }, "request_completed_at": "2026-10-06T12:00:00Z" } ``` ## Behavior Notes * Record allowance measures unique people exported during the contract term. Re-exporting a record already licensed in that term does not consume another unit of allowance. * Usage includes in-flight reservations, so committed spend is not an invoice or payment total. * A read does not reserve capacity. Concurrent exports can change availability before your next request. Other operational limits still apply. * A null `current_term` does not mean zero capacity by itself. An active Unlimited Enterprise account has no enforced allowance or overage limit and returns `current_term: null`. Check `access_status` and `product_tier` together. ## Error Responses ### Common Errors * `401` - **Unauthorized**: Invalid or missing API key * `403` - **Forbidden**: Your API key or organization does not have access to this endpoint * `503` - **Service Unavailable**: Billing usage is temporarily unavailable. Retry later; this does not mean your usage is zero. ### Error Example ```json theme={null} { "code": "billing_usage_unavailable", "message": "Billing usage is temporarily unavailable" } ``` # Data Dictionary Source: https://docs.minerva.io/api-reference/data-dictionary Complete reference of all fields returned by the Minerva Enrich v2 API > [!NOTE] > > The headings below group fields by topic for readability only. In the response > every one of them is a **top-level key of the result object** — the payload is > flat. There are no `personal_information`, `household_information`, > `financial_information`, or `social_media` wrapper objects. ## Base Fields These fields are always returned in every response, regardless of `return_fields` settings. | Field | Type | Description | | - | - | - | | `record_id` | string | Your unique identifier from the request | | `is_match` | boolean | Whether a match was found for this record | | `minerva_pid` | string | Minerva person identifier (format: `p-` + 32 hex characters) | | `match_score` | number | Confidence score for the match, as an additive point total — not a 0-1 or 0-100 scale. Fuzzy matches score at least 50 and often above 100; direct lookups return fixed values or `null`. See [Interpreting `match_score`](/api-reference/enrich-v2#interpreting-match-score) | | `validation_errors` | object | Any validation errors from the input (null if none) | *** ## Personal Information Returned at the top level of each result object. | Field | Type | Description | Example Values | | - | - | - | - | | `full_name` | string | Person's complete name | `"JOHN M SMITH"` | | `first_name` | string | First name | `"JOHN"` | | `middle_name` | string | Middle name or initial | `"M"` | | `last_name` | string | Last name / surname | `"SMITH"` | | `name_suffix` | string | Name suffix | `"Jr."`, `"Sr."`, `"III"` | | `gender` | string | Gender | `"M"`, `"F"`, or `null` | | `dob` | string | Date of birth | `"1990-01-15"` (YYYY-MM-DD) | | `age` | integer | Current calculated age | `34` | | `marital_status` | string | Marital status | `"M"` (married), `"S"` (single), or `null` | *** ## Household Information Returned at the top level of each result object. | Field | Type | Description | | - | - | - | | `minerva_household_id` | string | Unique household identifier | | `minerva_spouse_pid` | string | Spouse's Minerva PID (if available) | | `number_of_children` | integer | Number of children in household | *** ## Financial Information Returned at the top level of each result object. | Field | Type | Description | Example Values | | - | - | - | - | | `is_retired` | boolean | Whether the person is retired | `true`, `false` | | `estimated_income_range` | string | Estimated annual income bracket | `"$101K - $250K"` | | `estimated_wealth_range` | string | Estimated total wealth bracket | `"$1M-$2M"` | | `home_ownership_status` | string | Home ownership status | `"Owner"`, `"Renter"`, or `null` | | `has_bankruptcy_records` | boolean | Whether bankruptcy records exist | `true`, `false` | | `has_judgment_records` | boolean | Whether court judgment records exist | `true`, `false` | *** ## Social Media Returned at the top level of each result object. | Field | Type | Description | | - | - | - | | `linkedin_url` | string | LinkedIn profile URL | | `linkedin_title` | string | Current title from LinkedIn profile | | `linkedin_industry` | string | Industry listed on LinkedIn | | `linkedin_profile_pic_url` | string | LinkedIn profile picture URL | | `is_likely_remote_worker` | boolean | Whether the person likely works remotely | | `facebook_url` | string | Facebook profile URL | | `twitter_url` | string | Twitter/X profile URL | *** ## Contact Information ### Personal Emails Array of personal email addresses. Each email object contains: | Field | Type | Description | | - | - | - | | `email_rank` | integer | Priority ranking (1 = highest priority / most reliable) | | `email_address` | string | The email address | ### Professional Emails Array of work/professional email addresses. Each email object contains: | Field | Type | Description | | - | - | - | | `email_rank` | integer | Priority ranking (1 = highest priority / most reliable) | | `email_address` | string | The email address | ### Phone Numbers Array of phone numbers. Each phone object contains: | Field | Type | Description | Example Values | | - | - | - | - | | `phone_rank` | integer | Priority ranking (1 = highest priority) | `1`, `2`, `3` | | `phone_type` | string | Type of phone line | `"Mobile"`, `"Landline"` | | `phone_number` | string | Formatted phone number | `"(555) 123-4567"` | *** ## Family Relationships The `relatives` array contains family relationship information. Each relative object contains: | Field | Type | Description | Example Values | | - | - | - | - | | `relative_minerva_pid` | string | Minerva PID of the relative | `"p-b2c3d4..."` | | `relative_first_name` | string | Relative's first name | `"ROBERT"` | | `relative_last_name` | string | Relative's last name | `"SMITH"` | | `relationship_label` | string | Type of relationship | `"child-parent"`, `"sibling"`, `"spouse"` | | `relationship_sublabel` | string | Additional relationship details | `"son-father"`, `"brother-sister"` | > [!NOTE] > > The `relatives` array is included when returning all fields, and can also be requested explicitly via `return_fields`. *** ## Address History Array of address records ordered by recency. Each address object contains: ### Core Address Fields | Field | Type | Description | | - | - | - | | `address_rank` | integer | Recency rank (1 = most recent / current address) | | `minerva_address_id` | string | Unique address identifier | | `address_line_1` | string | Street address | | `address_line_2` | string | Apartment, suite, or unit number | | `address_city` | string | City name | | `address_state` | string | State abbreviation | | `address_zipcode` | string | 5-digit ZIP code | | `address_zipcode4` | string | ZIP+4 extension | ### Ownership & Residency | Field | Type | Description | Example Values | | - | - | - | - | | `ownership_status` | string | Whether property is owned or rented | `"Owned"`, `"Rented"`, `"Unknown"` | | `is_current_owner` | boolean | Whether person currently owns this property | `true`, `false` | | `first_seen_date` | string | First date person was associated with address | `"2018-08-01"` | | `last_seen_date` | string | Last date person was associated with address | `"2023-09-30"` | ### Property Details | Field | Type | Description | Units | | - | - | - | - | | `purchase_date` | string | Date property was purchased | YYYY-MM-DD | | `purchase_price` | number | Original purchase price | USD | | `estimated_current_value` | number | Current estimated market value | USD | | `estimated_rental_value` | number | Estimated monthly rental value | USD | | `home_current_tax_liability` | number | Annual property tax | USD | | `outstanding_loan_principal` | number | Outstanding mortgage balance | USD | | `current_property_equity_amount` | number | Estimated equity in property | USD | | `sqft` | number | Square footage of property | sq ft | | `num_beds` | number | Number of bedrooms | count | | `num_baths` | number | Number of bathrooms | count | *** ## Work Experience Array of employment history records ordered by recency. Each work experience object contains: ### Position Identification | Field | Type | Description | | - | - | - | | `experience_rank` | integer | Recency rank (1 = most recent / current position) | | `minerva_experience_id` | string | Unique experience identifier | ### Company Information | Field | Type | Description | | - | - | - | | `work_company_name` | string | Company name | | `work_company_linkedin_url` | string | Company's LinkedIn page URL | | `work_company_website` | string | Company's website URL | | `work_company_industry` | string | Company's industry classification | ### Industry Codes | Field | Type | Description | | - | - | - | | `work_company_naics_code` | string | NAICS industry classification code | | `work_company_naics_description` | string | NAICS industry description | | `work_company_sic_code` | string | SIC industry classification code | | `work_company_sic_description` | string | SIC industry description | ### Role Details | Field | Type | Description | Example Values | | - | - | - | - | | `work_title` | string | Job title as listed | `"Senior Software Engineer"` | | `standard_work_title` | string | Standardized/normalized job title | `"Software Engineer"` | | `work_seniority_level` | string | Seniority level | `"Entry"`, `"Senior"`, `"Manager"`, `"Executive"` | | `work_department` | string | Department within company | `"Engineering"`, `"Sales"`, `"Marketing"` | | `work_employment_type` | string | Type of employment | `"Full-Time"`, `"Part-Time"`, `"Contract"` | | `work_status` | string | Current or past position | `"current"`, `"previous"` | ### Dates & Location | Field | Type | Description | | - | - | - | | `work_start_date` | string | Employment start date (YYYY-MM-DD) | | `work_end_date` | string | Employment end date (null if current) | | `work_city` | string | Work location city | | `work_state` | string | Work location state | | `work_country` | string | Work location country code | *** ## Education Experience Array of education records ordered by recency. Each education object contains: | Field | Type | Description | Example Values | | - | - | - | - | | `experience_rank` | integer | Recency rank (1 = most recent) | `1`, `2` | | `minerva_experience_id` | string | Unique experience identifier | `"e-a1b2c3..."` | | `institution_name` | string | School/university name | `"Stanford University"` | | `institution_linkedin_url` | string | Institution's LinkedIn page URL | | | `education_information` | string | Additional education details | `"Bachelor of Science (B.S.), Computer Science"` | | `education_level` | string | Degree level attained | `"High School"`, `"Bachelors"`, `"Masters"`, `"PhD"` | | `education_majors` | array | Array of major fields of study | `["Computer Science", "Mathematics"]` | | `education_minors` | array | Array of minor fields of study | `["Business"]` | | `education_start_date` | string | Enrollment start date | `"2013-08-15"` | | `education_end_date` | string | Graduation/completion date | `"2017-05-31"` | *** ## Notes > [card] Empty Arrays > > All list fields (emails, phones, addresses, work, education, relatives) return empty arrays `[]` if no data is available. > [card] Date Format > > All dates are returned in ISO 8601 format: `YYYY-MM-DD` > [card] Currency > > All financial figures (property values, prices, etc.) are in USD. > [card] Ranking > > Arrays are ordered by rank field, with rank=1 being the most recent or most reliable. ## Using return\_fields You can optimize your API response by specifying only the fields you need using the `return_fields` parameter. Base fields are always included. **Available return\_fields options:** ``` full_name, first_name, middle_name, last_name, name_suffix, gender, dob, age, marital_status, minerva_household_id, minerva_spouse_pid, number_of_children, is_retired, estimated_income_range, estimated_wealth_range, home_ownership_status, linkedin_url, linkedin_title, linkedin_industry, linkedin_profile_pic_url, is_likely_remote_worker, facebook_url, twitter_url, has_bankruptcy_records, has_judgment_records, address_history, education_experience, work_experience, personal_emails, professional_emails, phones, relatives ``` Each name is a top-level key of the result object, and selected fields are returned at the top level — `return_fields` never introduces wrapper objects. > [!TIP] > > Using `return_fields` reduces response size and improves API latency. Request only the data you need! # Enrich v1 Source: https://docs.minerva.io/api-reference/enrich POST https://api.minerva.io/v1/enrich **Do not use Enrich v1.** This endpoint is deprecated and remains available only for backward compatibility. Use [Enrich v2](/api-reference/enrich-v2) for all enrichment workflows. Migrate existing v1 integrations to v2 as soon as possible. ## Quick Answer **How do I enrich a user/person/contact?** Do not use Enrich v1. Use [Enrich v2](/api-reference/enrich-v2) instead. Enrich v1 is deprecated and remains available only for backward compatibility. **Common questions this endpoint answers:** * How do I enrich a user? * How do I get more information about a person? * How do I find contact details for someone? * How do I get demographic data about a person? * How do I look up someone's professional background? * How do I get email addresses and phone numbers for a contact? * How can I append data to my customer records? **What you need:** Basic identifying information like name, email, or phone number. **What you get back:** Complete profile with work history, education, addresses, phone numbers, emails, demographics, financial estimates, and social profiles. **Required action:** Migrate existing `/v1/enrich` integrations to `/v2/enrich` as soon as possible. ## Overview The Enrich v1 endpoint combines resolution and data enrichment in a single call. It first resolves the person identity using fuzzy matching, then returns comprehensive profile data including demographics, work history, education, addresses, and contact information. This reference remains available only to support migrations from v1 to [Enrich v2](/api-reference/enrich-v2). ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `object[]` *required* An array of person records to enrich. Maximum 500 records per request. **Record object properties** **record\_id** `string` *required* Your unique identifier for this record **first\_name** `string` Person's first name **middle\_name** `string` Person's middle name **last\_name** `string` Person's last name **full\_name** `string` Person's full name **name\_suffix** `string` Name suffix (e.g., "Jr.", "Sr.", "III") **emails** `string[]` Array of email addresses **phones** `string[]` Array of phone numbers ### Request Example ```json theme={null} { "records": [ { "record_id": "user_001", "first_name": "John", "last_name": "Smith", "emails": ["john.smith@example.com"], "phones": ["+1-555-123-4567"] } ] } ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of enrichment results **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object - Demographics **record\_id** `string` Your identifier from the request **is\_match** `boolean` Whether a match was found **minerva\_pid** `string` Minerva person identifier **full\_name** `string` Person's full name **first\_name** `string` First name **middle\_name** `string` Middle name **last\_name** `string` Last name **name\_suffix** `string` Name suffix **gender** `string` Gender ("M" for male, "F" for female, or null) **dob** `string` Date of birth (ISO 8601 format) **age** `integer` Current age **marital\_status** `string` Marital status ("M" for married, "S" for single, or null) **minerva\_household\_id** `string` Household identifier **minerva\_spouse\_pid** `string` Spouse's Minerva PID if available **number\_of\_children** `integer` Number of children #### Result Object - Financial **is\_retired** `boolean` Whether the person is retired **estimated\_income\_range** `string` Estimated income bracket **estimated\_wealth\_range** `string` Estimated wealth bracket **home\_ownership\_status** `string` Home ownership status (e.g., "Owner", "Renter", or null) #### Result Object - Social & Professional **linkedin\_url** `string` LinkedIn profile URL **linkedin\_title** `string` Current title from LinkedIn **linkedin\_industry** `string` Industry from LinkedIn **is\_likely\_remote\_worker** `boolean` Whether the person likely works remotely **facebook\_url** `string` Facebook profile URL **twitter\_url** `string` Twitter profile URL #### Result Object - Legal Records **has\_bankruptcy\_records** `boolean` Whether bankruptcy records exist **has\_judgment\_records** `boolean` Whether judgment records exist #### Result Object - Contact Information **personal\_emails** `array` Array of personal email addresses with ranking **Email object properties** **email\_rank** `integer` Rank/priority of this email (1 = highest priority) **email\_address** `string` Email address **professional\_emails** `array` Array of professional email addresses with ranking **Email object properties** **email\_rank** `integer` Rank/priority of this email (1 = highest priority) **email\_address** `string` Email address **phones** `array` Array of phone numbers with type and ranking **Phone object properties** **phone\_rank** `integer` Rank/priority of this phone (1 = highest priority) **phone\_type** `string` Phone type (e.g., "Mobile", "Landline") **phone\_number** `string` Phone number #### Result Object - Address History **address\_history** `array` Array of address records with property details **Address object properties** **address\_rank** `integer` Rank of address (1 = most recent/current) **minerva\_address\_id** `string` Unique address identifier **address\_line\_1** `string` Street address **address\_line\_2** `string` Apartment/unit number **address\_city** `string` City **address\_state** `string` State **address\_zipcode** `string` ZIP code **address\_zipcode4** `string` ZIP+4 extension **ownership\_status** `string` Ownership status ("Owned" / "Rented" / "Unknown") **is\_current\_owner** `boolean` Whether person currently owns this property (true / false / null) **purchase\_date** `string` Date property was purchased **purchase\_price** `number` Purchase price in USD **estimated\_current\_value** `number` Current estimated value in USD **estimated\_rental\_value** `number` Estimated monthly rental value in USD **home\_current\_tax\_liability** `number` Annual property tax in USD **outstanding\_loan\_principal** `number` Outstanding mortgage balance in USD **current\_property\_equity\_amount** `number` Estimated equity in USD **sqft** `number` Square footage **num\_beds** `number` Number of bedrooms **num\_baths** `number` Number of bathrooms **first\_seen\_date** `string` First date person was associated with this address **last\_seen\_date** `string` Last date person was associated with this address #### Result Object - Work Experience **work\_experience** `array` Array of work history records **Work experience object properties** **experience\_rank** `integer` Rank (1 = most recent) **minerva\_experience\_id** `string` Unique experience identifier **work\_company\_name** `string` Company name **work\_company\_linkedin\_url** `string` Company LinkedIn URL **work\_company\_website** `string` Company website **work\_company\_industry** `string` Company industry **work\_company\_naics\_code** `string` NAICS industry classification code **work\_company\_naics\_description** `string` NAICS industry description **work\_company\_sic\_code** `string` SIC industry code **work\_company\_sic\_description** `string` SIC industry description **work\_title** `string` Job title **standard\_work\_title** `string` Standardized job title **work\_seniority\_level** `string` Seniority level (e.g., "Senior", "Manager", "Executive") **work\_department** `string` Department **work\_employment\_type** `string` Employment type (e.g., "Full-time", "Part-time") **work\_status** `string` Employment status ("current" or "previous") **work\_start\_date** `string` Start date **work\_end\_date** `string` End date (null if current) **work\_city** `string` Work location city **work\_state** `string` Work location state **work\_country** `string` Work location country #### Result Object - Education **education\_experience** `array` Array of education records **Education object properties** **experience\_rank** `integer` Rank (1 = most recent) **minerva\_experience\_id** `string` Unique experience identifier **institution\_name** `string` School/university name **institution\_linkedin\_url** `string` Institution LinkedIn URL **education\_information** `string` Additional education details **education\_level** `string` Degree level (e.g., "Bachelor's", "Master's", "PhD") **education\_majors** `array` Array of major fields of study **education\_minors** `array` Array of minor fields of study **education\_start\_date** `string` Start date **education\_end\_date** `string` Graduation date #### Result Object - Other Fields **match\_score** `number` Confidence score for the match, as an additive point total — **not** a 0-1 or 0-100 scale. Matches routinely score above 100. `null` when `is_match` is false. See [Interpreting `match_score`](#interpreting-match-score). **validation\_errors** `object` Any validation errors from the input > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "req_abc123xyz789", "request_completed_at": "2024-01-15T10:30:45.123456+00:00", "results": [ { "record_id": "user_001", "is_match": true, "minerva_pid": "p-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "full_name": "JOHN M SMITH", "first_name": "JOHN", "middle_name": "M", "last_name": "SMITH", "name_suffix": null, "gender": "M", "dob": "1990-05-15", "age": 34, "marital_status": "M", "minerva_household_id": "h-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "minerva_spouse_pid": null, "number_of_children": 2, "is_retired": false, "estimated_income_range": "$101K - $250K", "estimated_wealth_range": "$1M-$2M", "home_ownership_status": null, "linkedin_url": "https://www.linkedin.com/in/johnsmith", "linkedin_title": "Senior Software Engineer | Technology Leader", "linkedin_industry": null, "is_likely_remote_worker": false, "facebook_url": null, "twitter_url": null, "has_bankruptcy_records": false, "has_judgment_records": false, "personal_emails": [ { "email_rank": 1, "email_address": "john.smith@gmail.com" }, { "email_rank": 2, "email_address": "jsmith@email.com" }, { "email_rank": 3, "email_address": "johnsmith123@yahoo.com" } ], "professional_emails": [], "phones": [ { "phone_rank": 1, "phone_type": "Mobile", "phone_number": "(555) 123-4567" }, { "phone_rank": 2, "phone_type": "Mobile", "phone_number": "(555) 234-5678" }, { "phone_rank": 3, "phone_type": "Landline/Services", "phone_number": "(555) 345-6789" } ], "address_history": [ { "address_rank": 1, "minerva_address_id": "a-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "address_line_1": "123 MAIN ST", "address_line_2": null, "address_city": "SAN FRANCISCO", "address_state": "CA", "address_zipcode": "94102", "address_zipcode4": "1234", "ownership_status": "Unknown", "is_current_owner": null, "purchase_date": null, "purchase_price": null, "estimated_current_value": null, "estimated_rental_value": null, "home_current_tax_liability": null, "outstanding_loan_principal": null, "current_property_equity_amount": null, "sqft": null, "num_beds": null, "num_baths": null, "first_seen_date": "2023-01-15", "last_seen_date": "2024-01-15" }, { "address_rank": 2, "minerva_address_id": "a-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7", "address_line_1": "456 OAK AVE", "address_line_2": null, "address_city": "PALO ALTO", "address_state": "CA", "address_zipcode": "94301", "address_zipcode4": "5678", "ownership_status": "Rented", "is_current_owner": null, "purchase_date": null, "purchase_price": null, "estimated_current_value": 1020000.0, "estimated_rental_value": 6221.0, "home_current_tax_liability": null, "outstanding_loan_principal": null, "current_property_equity_amount": null, "sqft": 2789.0, "num_beds": 4.0, "num_baths": 4.0, "first_seen_date": "2020-06-01", "last_seen_date": "2023-01-14" }, { "address_rank": 3, "minerva_address_id": "a-c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8", "address_line_1": "789 ELM ST", "address_line_2": null, "address_city": "MOUNTAIN VIEW", "address_state": "CA", "address_zipcode": "94040", "address_zipcode4": "9012", "ownership_status": "Owned", "is_current_owner": false, "purchase_date": "2015-03-20", "purchase_price": null, "estimated_current_value": 1493190.0, "estimated_rental_value": 7189.0, "home_current_tax_liability": null, "outstanding_loan_principal": null, "current_property_equity_amount": null, "sqft": 2979.0, "num_beds": 4.0, "num_baths": 2.5, "first_seen_date": "2015-03-20", "last_seen_date": "2020-05-31" } ], "work_experience": [ { "experience_rank": 1, "minerva_experience_id": "w-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "work_company_name": "Tech Solutions Inc", "work_company_linkedin_url": "https://www.linkedin.com/company/tech-solutions", "work_company_website": null, "work_company_industry": null, "work_company_naics_code": null, "work_company_naics_description": null, "work_company_sic_code": null, "work_company_sic_description": null, "work_title": "Senior Software Engineer", "standard_work_title": "Senior Software Engineer", "work_seniority_level": "Senior", "work_department": "Engineering", "work_employment_type": "Full-Time", "work_status": "current", "work_start_date": "2020-01-01", "work_end_date": null, "work_city": "San Francisco", "work_state": "CA", "work_country": "US" }, { "experience_rank": 2, "minerva_experience_id": "w-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7", "work_company_name": "Startup Ventures", "work_company_linkedin_url": "https://www.linkedin.com/company/startup-ventures", "work_company_website": "https://startupventures.com", "work_company_industry": "Technology", "work_company_naics_code": null, "work_company_naics_description": null, "work_company_sic_code": null, "work_company_sic_description": null, "work_title": "Software Engineer", "standard_work_title": "Software Engineer", "work_seniority_level": "Mid", "work_department": "Engineering", "work_employment_type": "Full-Time", "work_status": "previous", "work_start_date": "2018-06-01", "work_end_date": "2019-12-31", "work_city": "San Francisco", "work_state": "CA", "work_country": "US" }, { "experience_rank": 3, "minerva_experience_id": "w-c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8", "work_company_name": "Financial Corp", "work_company_linkedin_url": "https://www.linkedin.com/company/financial-corp", "work_company_website": "https://financialcorp.com", "work_company_industry": "Financial Services", "work_company_naics_code": "523930", "work_company_naics_description": "Investment Advice", "work_company_sic_code": "6282", "work_company_sic_description": "Investment Advice", "work_title": "Junior Developer", "standard_work_title": "Junior Developer", "work_seniority_level": "Entry", "work_department": "Technology", "work_employment_type": "Full-Time", "work_status": "previous", "work_start_date": "2016-08-01", "work_end_date": "2018-05-31", "work_city": "New York", "work_state": "NY", "work_country": "US" }, { "experience_rank": 4, "minerva_experience_id": "w-d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9", "work_company_name": "Financial Corp", "work_company_linkedin_url": "https://www.linkedin.com/company/financial-corp", "work_company_website": "https://financialcorp.com", "work_company_industry": "Financial Services", "work_company_naics_code": "523930", "work_company_naics_description": "Investment Advice", "work_company_sic_code": "6282", "work_company_sic_description": "Investment Advice", "work_title": "Summer Analyst", "standard_work_title": "Summer Analyst", "work_seniority_level": "Intern", "work_department": "Technology", "work_employment_type": "Part-Time", "work_status": "previous", "work_start_date": "2015-06-01", "work_end_date": "2015-08-31", "work_city": "New York", "work_state": "NY", "work_country": "US" }, { "experience_rank": 5, "minerva_experience_id": "w-e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0", "work_company_name": "Tech Innovations", "work_company_linkedin_url": "https://www.linkedin.com/company/tech-innovations", "work_company_website": "https://techinnovations.com", "work_company_industry": "Computer Software", "work_company_naics_code": "511210", "work_company_naics_description": "Software Publishers", "work_company_sic_code": "7372", "work_company_sic_description": "Prepackaged Software", "work_title": "Software Engineering Intern", "standard_work_title": "Software Engineering Intern", "work_seniority_level": "Intern", "work_department": "Engineering", "work_employment_type": "Part-Time", "work_status": "previous", "work_start_date": "2014-06-01", "work_end_date": "2014-08-31", "work_city": "Seattle", "work_state": "WA", "work_country": "US" }, { "experience_rank": 6, "minerva_experience_id": "w-f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1", "work_company_name": "Startup Labs", "work_company_linkedin_url": null, "work_company_website": null, "work_company_industry": null, "work_company_naics_code": null, "work_company_naics_description": null, "work_company_sic_code": null, "work_company_sic_description": null, "work_title": "Co-Founder", "standard_work_title": "Co-Founder", "work_seniority_level": "Executive", "work_department": "Executive", "work_employment_type": "Full-Time", "work_status": "previous", "work_start_date": "2013-01-01", "work_end_date": "2013-12-31", "work_city": null, "work_state": null, "work_country": null }, { "experience_rank": 7, "minerva_experience_id": "w-a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2", "work_company_name": "Research Institute", "work_company_linkedin_url": null, "work_company_website": null, "work_company_industry": null, "work_company_naics_code": null, "work_company_naics_description": null, "work_company_sic_code": null, "work_company_sic_description": null, "work_title": "Research Assistant", "standard_work_title": "Research Assistant", "work_seniority_level": "Entry", "work_department": "Research", "work_employment_type": "Part-Time", "work_status": "previous", "work_start_date": "2012-09-01", "work_end_date": "2013-05-31", "work_city": null, "work_state": null, "work_country": null }, { "experience_rank": 8, "minerva_experience_id": "w-b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3", "work_company_name": "Community Organization", "work_company_linkedin_url": "https://www.linkedin.com/company/community-org", "work_company_website": "https://communityorg.org", "work_company_industry": "Nonprofit", "work_company_naics_code": "813920", "work_company_naics_description": "Professional Organizations", "work_company_sic_code": "8621", "work_company_sic_description": "Professional organizations", "work_title": "Volunteer Coordinator", "standard_work_title": "Volunteer Coordinator", "work_seniority_level": "Entry", "work_department": "Operations", "work_employment_type": "Full-Time", "work_status": "previous", "work_start_date": "2011-06-01", "work_end_date": "2011-11-30", "work_city": null, "work_state": null, "work_country": null }, { "experience_rank": 9, "minerva_experience_id": "w-c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4", "work_company_name": "Consulting Group", "work_company_linkedin_url": "https://www.linkedin.com/company/consulting-group", "work_company_website": "https://consultinggroup.com", "work_company_industry": "Management Consulting", "work_company_naics_code": "541614", "work_company_naics_description": "Process, Physical Distribution, and Logistics Consulting Services", "work_company_sic_code": "8742", "work_company_sic_description": "Management consulting services", "work_title": "Summer Intern", "standard_work_title": "Summer Intern", "work_seniority_level": "Intern", "work_department": null, "work_employment_type": "Part-Time", "work_status": "previous", "work_start_date": "2010-06-01", "work_end_date": "2010-08-31", "work_city": null, "work_state": null, "work_country": null } ], "education_experience": [ { "experience_rank": 1, "minerva_experience_id": "e-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "institution_name": "State University", "institution_linkedin_url": "https://www.linkedin.com/school/state-university", "education_information": "Bachelor of Science (B.S.), Computer Science", "education_level": "Bachelors", "education_majors": [ "Computer Science", "Mathematics" ], "education_minors": [], "education_start_date": "2012-09-01", "education_end_date": "2016-05-31" } ], "match_score": 110.0, "validation_errors": null } ] } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 402 theme={null} { "code": "insufficient_record_capacity", "message": "Record export exceeds the available plan allowance and monthly spend limit. Increase the limit or upgrade, then retry.", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012", "details": { "records_available": 45, "allowance_records_available": 45, "overage_records_available": 0, "records_requested": 250 } } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v1/enrich endpoint is 500", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses * `400` - Bad Request: Missing required fields or malformed JSON * `401` - Unauthorized: Invalid or missing API key * `402` - Payment Required: The new records exceed available plan allowance and monthly overage capacity. `details` includes `records_requested`, `records_available`, `allowance_records_available`, and `overage_records_available`. Increase the monthly spend limit or upgrade before retrying. * `413` - Payload Too Large: More than 500 records in request * `422` - Unprocessable Entity: Validation errors in record data (invalid field names, data types, or values) * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error: Unexpected server error ## Notes * Maximum 500 records per request (lower than `/resolve` due to data volume) * All list fields (emails, phones, addresses, work, education) return empty arrays `[]` if no data is available * Dates are returned in ISO 8601 format (YYYY-MM-DD) * Financial figures are in USD * Arrays are ordered by rank, with rank=1 being the most recent/relevant ### Interpreting `match_score` `match_score` is an **additive point total**, not a normalized 0-1 or 0-100 confidence. It is the sum of two components: * **Name** — up to 60 points, based on how closely the input name matches the person's known names and aliases * **Contact info** — points for every input email and phone that matches the person, weighted by how strongly that email or phone is associated with them Because the contact-info component grows with each additional match, there is no upper bound: a record matched on a name plus several emails and phones commonly scores 110-130. The example above scores `110.0`. > [!NOTE] > > Compare scores against each other, not against a fixed ceiling. Thresholding > on a percentage (for example, "accept above 0.8" or "above 80%") will not > behave the way you expect. Practical guidance: * Every record returned with `is_match: true` already cleared Minerva's internal match threshold and scores **at least 50**. You don't need your own floor unless you want to be stricter than Minerva. * `match_score` is `null` when `is_match` is false. * Scores are rounded to two decimal places. * Raising your own threshold trades recall for precision. If you need higher precision, prefer `/v2/enrich` with `match_condition_fields`, which filters on data availability rather than on an opaque score. # Enrich Input Rules Source: https://docs.minerva.io/api-reference/enrich-inputs Valid identifiers and record shapes for Enrich v2 These rules define valid lookup shapes for [Enrich v2](/api-reference/enrich-v2). Each record must describe one specific person. Never combine identifiers from different people or invent missing values. ## Client support | Client | Supported inputs | `record_id` | | - | - | - | | REST API | All lookup shapes on this page | Required | | MCP `enrich_people` tool | All lookup shapes on this page | Optional; echoed in the corresponding result when provided | | [Python SDK](/sdk/guides/enrich) | Minerva PID, LinkedIn URL, or name with email or phone | Required | Postal-address inputs are not yet accepted by the Python SDK. Use the REST API or MCP tool for address matching. ## Choose a lookup shape Each record must satisfy one of these lookup shapes: | Lookup | Information required | | - | - | | Direct Minerva lookup | A valid `minerva_pid` | | Direct LinkedIn lookup | A valid LinkedIn profile URL or username in `linkedin_url` | | Person matching | A valid name plus at least one valid email, US phone, or postal address | If a record contains a `minerva_pid`, it takes precedence over all other lookup fields. A `linkedin_url` is used as the direct identifier only when no `minerva_pid` is present. Any additional fields are still validated and must belong to the same person. ## Person matching Provide either a `full_name` containing a first and last name, or both `first_name` and `last_name`. Include every accurate email, phone, and address available; more evidence can improve match confidence. ### Addresses and phones An address can be supplied as `full_address`, or as parsed fields. Parsed addresses require `address_line_1` plus either `zipcode` or both `city` and `state`. Do not mix `full_address` with parsed address fields. Phones must be 10-digit US numbers, optionally formatted with the `+1` country code. ## Matching and returned fields `match_condition_fields` is a quality gate: it filters a resolved match based on fields present in the resulting profile. It does not replace the identifying information above. `return_fields` only controls which enrichment fields are returned. It does not affect how a person is identified. # Enrich v2 Source: https://docs.minerva.io/api-reference/enrich-v2 POST https://api.minerva.io/v2/enrich Enhanced enrichment with direct lookups, flexible matching, and selective field returns ## Quick Answer **How do I enrich a user/person/contact?** Use this endpoint to get detailed information about a person including their work history, contact details, demographics, addresses, and more. **Common questions this endpoint answers:** * How do I enrich a user? * How do I get comprehensive data about a person? * How do I find someone's email and phone number? * How do I look up a person's job history and education? * How do I get demographic and financial information about someone? * How can I enrich my customer database with additional fields? * How do I append data to my contact records? **What you need:** Follow the [Enrich input rules](/api-reference/enrich-inputs) for accepted identifiers and record shapes. **What you get back:** Comprehensive profile with work experience, education, contact info (emails, phones), addresses, demographics, family relationships, financial estimates, and social profiles. ## Overview The V2 Enrich endpoint combines identity resolution and comprehensive data enrichment with enhanced controls and performance. See [Enrich Input Rules](/api-reference/enrich-inputs) for accepted identifiers, record shapes, and contact-field requirements. ## Key Enhancements in V2 * **Direct Lookups**: Enrich by `minerva_pid` or `linkedin_url` for instant results without fuzzy matching * **Match Conditions**: Control which fields must be present for a match to be returned * **Selective Returns**: Use `return_fields` to get only the data you need and optimize response size * **Premium Fields**: Opt into separately-licensed household, spending, vehicle, travel, and interest attributes with `include_premium_fields` * **New Data**: Includes `relatives` field with family relationship information * **Improved Performance**: Optimized data retrieval with parallel processing and support for mixed lookup modes ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `object[]` *required* An array of person records to enrich. Maximum 500 records per request. Each record must follow one of the supported [Enrich input rules](/api-reference/enrich-inputs). **Record object properties** **record\_id** `string` *required* Your unique identifier for this record **minerva\_pid** `string` **New in V2**: Direct Minerva Person ID lookup for instant enrichment **linkedin\_url** `string` **New in V2**: LinkedIn profile URL for direct enrichment **first\_name** `string` Person's first name **middle\_name** `string` Person's middle name **last\_name** `string` Person's last name **full\_name** `string` Person's full name **name\_suffix** `string` Name suffix (e.g., "Jr.", "Sr.", "III") **emails** `string[]` Array of email addresses **phones** `string[]` Array of phone numbers **full\_address** `string` Complete postal address. Do not combine this with parsed address fields. **address\_line\_1** `string` Street address for a parsed address. Provide either `zipcode` or both `city` and `state` with it. **address\_line\_2** `string` Optional unit, suite, or other secondary line for a parsed address. **city** `string` City for a parsed address. Requires `address_line_1` and `state` unless a `zipcode` is provided. **state** `string` State for a parsed address. Requires `address_line_1` and `city` unless a `zipcode` is provided. **zipcode** `string` Postal code for a parsed address. Requires `address_line_1`. **match\_condition\_fields** `string[]` Optional list of fields that must be present in the enriched data for a record to be returned as a match. Maximum 3 fields. Valid options: `linkedin_url`, `gender`, `estimated_income_range`, `estimated_wealth_range`, `email`, `personal_email`, `professional_email`, `phone`, `mobile_phone`, `home_ownership_status` Example: `["email"]` or `["phone", "linkedin_url"]` **return\_fields** `string[]` Optional list of additional fields to return beyond the base fields. Use this to control response size and reduce latency. If not specified, all available fields are returned. Base fields (always returned): `record_id`, `is_match`, `minerva_pid`, `match_score`, `validation_errors` Available fields: `full_name`, `first_name`, `middle_name`, `last_name`, `name_suffix`, `gender`, `dob`, `age`, `marital_status`, `minerva_household_id`, `minerva_spouse_pid`, `number_of_children`, `is_retired`, `estimated_income_range`, `estimated_wealth_range`, `home_ownership_status`, `linkedin_url`, `linkedin_title`, `linkedin_industry`, `linkedin_profile_pic_url`, `is_likely_remote_worker`, `facebook_url`, `twitter_url`, `has_bankruptcy_records`, `has_judgment_records`, `address_history`, `education_experience`, `work_experience`, `personal_emails`, `professional_emails`, `phones`, `relatives` **Note**: `return_fields` names top-level keys of the result object, and the requested fields are returned at the top level of that object — the response is flat, with no `personal_information` / `social_media`-style grouping. Naming a base field returns `422`, since base fields are always included. Example: `["full_name", "personal_emails", "phones"]` **include\_premium\_fields** `boolean` (default: false) Optional. When `true`, each matched result gains a nested `premium_fields` object carrying separately-licensed household, spending, vehicle, travel, and interest attributes. See [Premium Fields](#premium-fields). Requires the `api:premium-fields` entitlement on your organization — requesting it without the grant returns `403`. Contact your Minerva representative to enable it. Must be a boolean; a string such as `"true"` is rejected with `422` rather than coerced. Defaults to `false`, in which case the `premium_fields` key is omitted from the response entirely. **Note**: `premium_fields` is returned in addition to whatever `return_fields` selects — it is not itself a valid `return_fields` value, and setting `return_fields` does not suppress it. ### Request Examples #### Standard Fuzzy Matching with Selective Returns ```json theme={null} { "records": [ { "record_id": "user_001", "first_name": "John", "last_name": "Smith", "emails": ["john.smith@example.com"] } ], "match_condition_fields": ["email"], "return_fields": ["full_name", "linkedin_url", "personal_emails", "phones"] } ``` #### Direct Minerva PID Lookup ```json theme={null} { "records": [ { "record_id": "user_002", "minerva_pid": "p-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6" } ] } ``` #### Direct LinkedIn URL Lookup ```json theme={null} { "records": [ { "record_id": "user_003", "linkedin_url": "https://www.linkedin.com/in/janedoe" } ] } ``` #### Fuzzy Matching with a Full Address ```json theme={null} { "records": [ { "record_id": "user_004", "full_name": "Jordan Example", "full_address": "123 Example Street, Austin, TX 78701" } ] } ``` #### Fuzzy Matching with a Parsed Address ```json theme={null} { "records": [ { "record_id": "user_005", "first_name": "Taylor", "last_name": "Example", "address_line_1": "456 Sample Avenue", "address_line_2": "Suite 200", "city": "Austin", "state": "TX" } ] } ``` #### Mixed Lookup Types in One Request ```json theme={null} { "records": [ { "record_id": "user_001", "first_name": "John", "last_name": "Smith", "emails": ["john.smith@example.com"] }, { "record_id": "user_002", "minerva_pid": "p-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6" }, { "record_id": "user_003", "linkedin_url": "https://www.linkedin.com/in/janedoe" } ], "return_fields": ["full_name", "linkedin_url", "personal_emails", "work_experience"] } ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of enrichment results **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object - Base Fields (Always Returned) **record\_id** `string` Your identifier from the request **is\_match** `boolean` Whether a match was found **minerva\_pid** `string` Minerva person identifier **match\_score** `number` Confidence score for the match, as an additive point total — **not** a 0-1 or 0-100 scale. Fuzzy matches routinely score above 100, direct lookups return fixed values, and the field can be `null` even on a successful match. See [Interpreting `match_score`](#interpreting-match-score). **validation\_errors** `object` Any validation errors from the input #### Result Object - Person Fields Every person field below is a **top-level key of the result object**. They are not grouped into `personal_information`, `household_information`, `financial_information`, or `social_media` objects — those objects do not exist in the response. On a non-match (`is_match: false`) each is `null`. **full\_name** `string` Person's full name **first\_name** `string` First name **middle\_name** `string` Middle name **last\_name** `string` Last name **name\_suffix** `string` Name suffix **gender** `string` Gender ("M", "F", or null) **dob** `string` Date of birth (YYYY-MM-DD format) **age** `integer` Current age **marital\_status** `string` Marital status ("M" for married, "S" for single, or null) **minerva\_household\_id** `string` Household identifier **minerva\_spouse\_pid** `string` Spouse's Minerva PID if available **number\_of\_children** `integer` Number of children **is\_retired** `boolean` Whether the person is retired **estimated\_income\_range** `string` Estimated income bracket **estimated\_wealth\_range** `string` Estimated wealth bracket **home\_ownership\_status** `string` Home ownership status (e.g., "Owner", "Renter", or null) **has\_bankruptcy\_records** `boolean` Whether bankruptcy records exist **has\_judgment\_records** `boolean` Whether judgment records exist **linkedin\_url** `string` LinkedIn profile URL **linkedin\_title** `string` Current title from LinkedIn **linkedin\_industry** `string` Industry from LinkedIn **linkedin\_profile\_pic\_url** `string` LinkedIn profile picture URL **is\_likely\_remote\_worker** `boolean` Whether the person likely works remotely **facebook\_url** `string` Facebook profile URL **twitter\_url** `string` Twitter profile URL #### Result Object - Contact Information **personal\_emails** `array` Array of personal email addresses with ranking **professional\_emails** `array` Array of professional email addresses with ranking **phones** `array` Array of phone numbers with type and ranking ##### Email Object **email\_rank** `integer` Rank/priority of this email (1 = highest priority) **email\_address** `string` Email address ##### Phone Object **phone\_rank** `integer` Rank/priority of this phone (1 = highest priority) **phone\_type** `string` Phone type (e.g., "Mobile", "Landline") **phone\_number** `string` Phone number #### Result Object - Family Relationships (New in V2) **relatives** `array` **New in V2**: Array of family relationships ##### Relative Object **relative\_minerva\_pid** `string` Minerva PID of the relative **relative\_first\_name** `string` Relative's first name **relative\_last\_name** `string` Relative's last name **relationship\_label** `string` Type of relationship (e.g., "Parent", "Child", "Sibling") **relationship\_sublabel** `string` Additional relationship details #### Result Object - Address History **address\_history** `array` Array of address records with property details ##### Address Object **address\_rank** `integer` Rank of address (1 = most recent/current) **minerva\_address\_id** `string` Unique address identifier **address\_line\_1** `string` Street address **address\_line\_2** `string` Apartment/unit number **address\_city** `string` City **address\_state** `string` State **address\_zipcode** `string` ZIP code **address\_zipcode4** `string` ZIP+4 extension **ownership\_status** `string` Ownership status ("Owned" / "Rented") **is\_current\_owner** `boolean` Whether person currently owns this property (TRUE / FALSE) **purchase\_date** `string` Date property was purchased **purchase\_price** `number` Purchase price in USD **estimated\_current\_value** `number` Current estimated value in USD **estimated\_rental\_value** `number` Estimated monthly rental value in USD **home\_current\_tax\_liability** `number` Annual property tax in USD **outstanding\_loan\_principal** `number` Outstanding mortgage balance in USD **current\_property\_equity\_amount** `number` Estimated equity in USD **sqft** `number` Square footage **num\_beds** `number` Number of bedrooms **num\_baths** `number` Number of bathrooms **first\_seen\_date** `string` First date person was associated with this address **last\_seen\_date** `string` Last date person was associated with this address #### Result Object - Work Experience **work\_experience** `array` Array of work history records ##### Work Experience Object **experience\_rank** `integer` Rank (1 = most recent) **minerva\_experience\_id** `string` Unique experience identifier **work\_company\_name** `string` Company name **work\_company\_linkedin\_url** `string` Company LinkedIn URL **work\_company\_website** `string` Company website **work\_company\_industry** `string` Company industry **work\_company\_naics\_code** `string` NAICS industry classification code **work\_company\_naics\_description** `string` NAICS industry description **work\_company\_sic\_code** `string` SIC industry code **work\_company\_sic\_description** `string` SIC industry description **work\_title** `string` Job title **standard\_work\_title** `string` Standardized job title **work\_seniority\_level** `string` Seniority level (e.g., "Senior", "Manager", "Executive") **work\_department** `string` Department **work\_employment\_type** `string` Employment type (e.g., "Full-time", "Part-time") **work\_status** `string` Employment status (e.g., "Current", "Past") **work\_start\_date** `string` Start date **work\_end\_date** `string` End date (null if current) **work\_city** `string` Work location city **work\_state** `string` Work location state **work\_country** `string` Work location country #### Result Object - Education **education\_experience** `array` Array of education records ##### Education Object **experience\_rank** `integer` Rank (1 = most recent) **minerva\_experience\_id** `string` Unique experience identifier **institution\_name** `string` School/university name **institution\_linkedin\_url** `string` Institution LinkedIn URL **education\_information** `string` Additional education details **education\_level** `string` Degree level (e.g., "Bachelor's", "Master's", "PhD") **education\_majors** `array` Array of major fields of study **education\_minors** `array` Array of minor fields of study **education\_start\_date** `string` Start date **education\_end\_date** `string` Graduation date > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "7916d5a4-f0d0-4f20-8153-83eeb458817a", "request_completed_at": "2024-11-12T15:29:05.828776+00:00", "results": [ { "record_id": "user_001", "is_match": true, "minerva_pid": "p-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "match_score": 110.0, "validation_errors": null, "full_name": "JOHN M SMITH", "first_name": "JOHN", "middle_name": "M", "last_name": "SMITH", "name_suffix": null, "gender": "M", "dob": "1990-01-01", "age": 34, "marital_status": "M", "minerva_household_id": "h-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "minerva_spouse_pid": null, "number_of_children": 0, "is_retired": false, "estimated_income_range": "$101K - $250K", "estimated_wealth_range": "$1M-$2M", "home_ownership_status": null, "has_bankruptcy_records": false, "has_judgment_records": false, "linkedin_url": "https://www.linkedin.com/in/example-profile", "linkedin_title": "Senior Software Engineer | Tech Enthusiast", "linkedin_industry": null, "linkedin_profile_pic_url": null, "is_likely_remote_worker": false, "facebook_url": null, "twitter_url": null, "personal_emails": [ { "email_rank": 1, "email_address": "john.smith@gmail.com" }, { "email_rank": 2, "email_address": "jsmith@example.com" } ], "professional_emails": [], "phones": [ { "phone_rank": 1, "phone_type": "Mobile", "phone_number": "(555) 123-4567" }, { "phone_rank": 2, "phone_type": "Mobile", "phone_number": "(555) 987-6543" } ], "relatives": [ { "relative_minerva_pid": "p-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7", "relative_first_name": "ROBERT", "relative_last_name": "SMITH", "relationship_label": "child-parent", "relationship_sublabel": "son-father" }, { "relative_minerva_pid": "p-c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8", "relative_first_name": "MARY", "relative_last_name": "SMITH", "relationship_label": "child-parent", "relationship_sublabel": null } ], "address_history": [ { "address_rank": 1, "minerva_address_id": "a-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "address_line_1": "123 MAIN ST", "address_line_2": null, "address_city": "SAN FRANCISCO", "address_state": "CA", "address_zipcode": "94102", "address_zipcode4": "1234", "ownership_status": "Unknown", "is_current_owner": null, "purchase_date": null, "purchase_price": null, "estimated_current_value": null, "estimated_rental_value": null, "home_current_tax_liability": null, "outstanding_loan_principal": null, "current_property_equity_amount": null, "sqft": null, "num_beds": null, "num_baths": null, "first_seen_date": "2023-10-31", "last_seen_date": "2025-09-04" }, { "address_rank": 2, "minerva_address_id": "a-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7", "address_line_1": "456 OAK AVE", "address_line_2": "APT 2B", "address_city": "PALO ALTO", "address_state": "CA", "address_zipcode": "94301", "address_zipcode4": "1111", "ownership_status": "Rented", "is_current_owner": null, "purchase_date": null, "purchase_price": null, "estimated_current_value": 1020000.0, "estimated_rental_value": 6221.0, "home_current_tax_liability": null, "outstanding_loan_principal": null, "current_property_equity_amount": null, "sqft": 2789.0, "num_beds": 4.0, "num_baths": 4.0, "first_seen_date": "2018-08-01", "last_seen_date": "2023-09-30" } ], "work_experience": [ { "experience_rank": 1, "minerva_experience_id": "w-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "work_company_name": "Tech Solutions Inc", "work_company_linkedin_url": "https://www.linkedin.com/company/example-company", "work_company_website": "https://example.com", "work_company_industry": "Computer Software", "work_company_naics_code": "511210", "work_company_naics_description": "Software Publishers", "work_company_sic_code": "7372", "work_company_sic_description": "Prepackaged Software", "work_title": "Senior Software Engineer", "standard_work_title": "Software Engineer", "work_seniority_level": "Senior", "work_department": "Engineering", "work_employment_type": "Full-Time", "work_status": "current", "work_start_date": "2023-05-01", "work_end_date": null, "work_city": "San Francisco", "work_state": "CA", "work_country": "US" }, { "experience_rank": 2, "minerva_experience_id": "w-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7", "work_company_name": "Financial Services Corp", "work_company_linkedin_url": "https://www.linkedin.com/company/example-finance", "work_company_website": "https://example-finance.com", "work_company_industry": "Investment Management", "work_company_naics_code": "523930", "work_company_naics_description": "Investment Advice", "work_company_sic_code": "6282", "work_company_sic_description": "Investment Advice", "work_title": "Software Developer", "standard_work_title": "Software Developer", "work_seniority_level": "Entry", "work_department": "Technology", "work_employment_type": "Full-Time", "work_status": "previous", "work_start_date": "2017-08-01", "work_end_date": "2023-04-30", "work_city": "New York", "work_state": "NY", "work_country": "US" } ], "education_experience": [ { "experience_rank": 1, "minerva_experience_id": "e-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "institution_name": "State University", "institution_linkedin_url": "https://www.linkedin.com/school/example-university", "education_information": "Bachelor of Science (B.S.), Computer Science", "education_level": "Bachelors", "education_majors": ["Computer Science"], "education_minors": [], "education_start_date": "2013-08-15", "education_end_date": "2017-05-31" } ] } ] } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "8931445e-91f1-42c6-a53d-7381de862dc8" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "c1d2e3f4-a5b6-7890-cdef-1234567890ab" } ``` ```json 402 theme={null} { "code": "insufficient_record_capacity", "message": "Record export exceeds the available plan allowance and monthly spend limit. Increase the limit or upgrade, then retry.", "api_request_id": "d4e5f6a7-b8c9-0123-def4-567890abcdef", "details": { "records_available": 23, "allowance_records_available": 23, "overage_records_available": 0, "records_requested": 100 } } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v2/enrich endpoint is 500", "api_request_id": "e5f6a7b8-c9d0-1234-ef56-7890abcdef01" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Invalid match_condition_fields: ['invalid_field']. Valid options are: linkedin_url, gender, estimated_income_range, estimated_wealth_range, emails, personal_email, professional_email, phone, mobile_phone, home_ownership_status", "api_request_id": "f6a7b8c9-d0e1-2345-f678-90abcdef0123" } ``` ### Alternative Response Example (With `return_fields`) When using `return_fields: ["full_name", "linkedin_url", "personal_emails"]`, only the requested fields are returned alongside the base fields: ```json theme={null} { "api_request_id": "req_xyz789", "results": [ { "record_id": "user_003", "is_match": true, "minerva_pid": "p-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "match_score": 95.0, "validation_errors": null, "full_name": "Jane Doe", "linkedin_url": "https://www.linkedin.com/in/janedoe", "personal_emails": [ { "email_rank": 1, "email_address": "jane.doe@gmail.com" } ] } ], "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` ### Premium Fields Returned only when the request sets `include_premium_fields: true` and your organization holds the `api:premium-fields` entitlement. When the flag is omitted or `false`, the `premium_fields` key is absent from every result rather than present-and-null, so existing integrations see a byte-identical response. On a result where `is_match` is `false`, `premium_fields` is `null` — the same way the core person fields are withheld on a non-match. A matched person with no premium record on file also returns `null`. **premium\_fields** `object | null` **Household composition** **hh\_child\_aged\_0\_3\_flag** `boolean | null` Household contains a child aged 0–3 **hh\_child\_aged\_4\_6\_flag** `boolean | null` Household contains a child aged 4–6 **hh\_child\_aged\_7\_9\_flag** `boolean | null` Household contains a child aged 7–9 **hh\_child\_aged\_10\_12\_flag** `boolean | null` Household contains a child aged 10–12 **hh\_child\_aged\_13\_18\_flag** `boolean | null` Household contains a child aged 13–18 **ind\_primary\_language** `string | null` Primary language spoken **Assets and investments** **hh\_assets\_low\_dollars** `number | null` Low bound of estimated household assets, in USD **hh\_assets\_high\_dollars** `number | null` High bound of estimated household assets, in USD **hh\_investments\_low\_dollars** `number | null` Low bound of estimated household investments, in USD **hh\_investments\_high\_dollars** `number | null` High bound of estimated household investments, in USD **ind\_has\_amex\_card\_flag** `boolean | null` Holds an American Express card **Spending** **hh\_annual\_discretionary\_spending\_total\_dollars** `number | null` Estimated total annual discretionary spending, in USD **hh\_annual\_spending\_entertainment\_dollars** `number | null` Estimated annual entertainment spending, in USD **hh\_annual\_spending\_travel\_dollars** `number | null` Estimated annual travel spending, in USD **hh\_annual\_spending\_donations\_dollars** `number | null` Estimated annual charitable donations, in USD **ind\_luxury\_highend\_buyer\_propensity** `integer | null` Propensity score for high-end luxury purchasing **ind\_retail\_highend\_buyer\_propensity** `integer | null` Propensity score for high-end retail purchasing **ind\_bargain\_seeker\_propensity** `integer | null` Propensity score for bargain seeking **Vehicles** **hh\_n\_vehicles** `integer | null` Number of vehicles in the household **hh\_has\_luxury\_flag** `boolean | null` Household owns a luxury vehicle **hh\_has\_exotic\_flag** `boolean | null` Household owns an exotic vehicle **hh\_primary\_vehicle\_make** `string | null` Make of the primary vehicle **hh\_primary\_vehicle\_model** `string | null` Model of the primary vehicle **hh\_primary\_vehicle\_year** `integer | null` Model year of the primary vehicle **hh\_primary\_vehicle\_msrp\_dollars** `number | null` MSRP of the primary vehicle, in USD **Travel and hospitality** **ind\_travel\_business\_flag** `boolean | null` Travels for business **ind\_travel\_personal\_flag** `boolean | null` Travels for personal reasons **ind\_travel\_vacation\_flag** `boolean | null` Takes vacation travel **ind\_hotel\_highend\_propensity\_flag** `boolean | null` Propensity for high-end hotels **ind\_hotel\_luxury\_propensity\_flag** `boolean | null` Propensity for luxury hotels **ind\_vacation\_highend\_propensity\_flag** `boolean | null` Propensity for high-end vacations **ind\_vacation\_luxury\_propensity\_flag** `boolean | null` Propensity for luxury vacations **ind\_luxury\_life\_flag** `boolean | null` Broad luxury-lifestyle indicator **Sports and interests** **ind\_football\_interest\_flag** `boolean | null` Interest in football **ind\_soccer\_interest\_flag** `boolean | null` Interest in soccer **ind\_tennis\_flag** `boolean | null` Interest in tennis **ind\_nascar\_interest\_flag** `boolean | null` Interest in NASCAR **ind\_motor\_racing\_flag** `boolean | null` Interest in motor racing **ind\_sports\_general\_interest\_exp\_flag** `boolean | null` General sports interest #### Premium Fields Request Example ```json theme={null} { "records": [ { "record_id": "1", "full_name": "Jane Smith", "city": "Austin", "state": "TX" } ], "include_premium_fields": true } ``` #### Premium Fields Response Example Abbreviated — the core enrich fields are returned alongside `premium_fields` exactly as usual. ```json theme={null} { "api_request_id": "550e8400-e29b-41d4-a716-446655440000", "results": [ { "record_id": "1", "is_match": true, "minerva_pid": "abc123", "full_name": "Jane Smith", "match_score": 0.95, "validation_errors": null, "premium_fields": { "hh_child_aged_0_3_flag": false, "hh_child_aged_13_18_flag": true, "ind_primary_language": "English", "ind_has_amex_card_flag": true, "hh_assets_low_dollars": 1000000.0, "hh_assets_high_dollars": 2500000.0, "hh_annual_spending_travel_dollars": 18000.0, "ind_luxury_highend_buyer_propensity": 8, "hh_n_vehicles": 2, "hh_has_luxury_flag": true, "hh_primary_vehicle_make": "Lexus", "hh_primary_vehicle_model": "RX 350", "hh_primary_vehicle_year": 2022, "ind_travel_vacation_flag": true, "ind_hotel_luxury_propensity_flag": true, "ind_tennis_flag": true, "ind_luxury_life_flag": true } } ], "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` ## Error Responses * `400` - Bad Request: Missing required fields or malformed JSON * `401` - Unauthorized: Invalid or missing API key * `402` - Payment Required: The new records exceed available plan allowance and monthly overage capacity. `details` includes `records_requested`, `records_available`, `allowance_records_available`, and `overage_records_available`. Increase the monthly spend limit or upgrade before retrying. * `403` - Forbidden: `include_premium_fields` was requested without the `api:premium-fields` entitlement. Response `code` is `insufficient_organization_entitlements` * `413` - Payload Too Large: More than 500 records in request * `422` - Unprocessable Entity: Validation errors in record data, invalid `match_condition_fields`, invalid `return_fields`, or a non-boolean `include_premium_fields` * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error: Unexpected server error ## Notes ### Performance Optimization * **Use `return_fields`** to request only needed data - significantly reduces response size and improves latency * **Direct PID lookups** (`minerva_pid`) are fastest - use when you have previously resolved a person * **LinkedIn URL lookups** provide quick resolution when you have LinkedIn profiles * **Fuzzy matching** is comprehensive but slower - use when you need identity resolution * Maximum 500 records per request (lower than `/v2/resolve` due to enriched data volume) * Mix lookup modes in a single request for optimal performance ### Interpreting `match_score` `match_score` is an **additive point total**, not a normalized 0-1 or 0-100 confidence. For a fuzzy match it is the sum of two components: * **Name** — up to 60 points, based on how closely the input name matches the person's known names and aliases * **Contact info** — points for matching email, phone, and address evidence, weighted by how strongly each value is associated with the person Because the contact-info component grows with each additional match, there is no upper bound: a record matched on a name plus several emails and phones commonly scores 110-130. Every fuzzy match returned with `is_match: true` has already cleared Minerva's internal threshold and scores at least 50. > [!NOTE] > > Compare scores against each other, not against a fixed ceiling. Thresholding > on a percentage (for example, "accept above 0.8" or "above 80%") will not > behave the way you expect. Direct lookups don't run the scoring algorithm, so V2 reports them differently depending on which lookup modes corroborate each other: | How the record matched | `match_score` | | - | - | | Fuzzy matching only — no `minerva_pid` or `linkedin_url` supplied | Additive point total (at least 50, often above 100) | | A direct lookup and fuzzy matching independently agreed on the same person | The fuzzy score, floored at `95.0` | | `linkedin_url` supplied, without that agreement | Fixed `75` | | `minerva_pid` supplied, without that agreement and without a `linkedin_url` | `null` | | No match (`is_match: false`) | `null` | A `null` score is therefore not a weak match — for a direct `minerva_pid` lookup it means you addressed the person by identifier, so there was nothing to score. Treat `is_match` as the source of truth for whether a record matched, and don't require `match_score` to be present. Scores are rounded to two decimal places. If you need stricter results, prefer `match_condition_fields` over a score threshold: it filters on which data is actually populated, which is both verifiable and stable across lookup modes. ### Match Condition Fields * `match_condition_fields` filters results to only return matches that have the specified fields populated * Helps maintain data quality requirements by ensuring minimum data availability * Maximum 3 fields can be specified * Available condition fields: `linkedin_url`, `gender`, `estimated_income_range`, `estimated_wealth_range`, `email`, `personal_email`, `professional_email`, `phone`, `mobile_phone`, `home_ownership_status` * Example: `["email", "linkedin_url"]` will only return matches that have both an email and LinkedIn profile ### Data Availability * All list fields (emails, phones, addresses, work, education, relatives) return empty arrays `[]` if no data is available * Dates are returned in ISO 8601 format (YYYY-MM-DD) * Financial figures are in USD * Arrays are ordered by rank, with rank=1 being the most recent/relevant * Every scalar person field is a top-level key of the result object. The response is flat: there are no `personal_information`, `household_information`, `financial_information`, or `social_media` wrapper objects. The only nested object in a result is `premium_fields`, and only when explicitly requested * When using `return_fields`, the requested fields are returned at the top level alongside the base fields ### Validation Input validation follows the [Enrich input rules](/api-reference/enrich-inputs). Records with validation errors will have `validation_errors` populated and may have `is_match: false`. ### New Features in V2 * **Direct Lookups**: `minerva_pid` and `linkedin_url` as input fields for instant enrichment * **`relatives`** field provides family relationship data with linked Minerva PIDs * **`return_fields`** allows precise control over response payload for cost optimization * **Flexible input requirements**: Name is optional when using direct lookups ## Migration from V1 If you're upgrading from V1: 1. **URL Change**: `/v1/enrich` → `/v2/enrich` 2. **Response Structure**: Unchanged. V2 results are flat, exactly as in V1 — every scalar person field and every array field sits at the top level of the result object. V2 adds two keys (`relatives`, and `premium_fields` when requested); no existing key moved or was regrouped, so a V1 decoder keeps working against V2. 3. **New Direct Lookup Options**: * Add `minerva_pid` to your input records if you have previously resolved persons * Add `linkedin_url` if you have LinkedIn profiles * These provide instant enrichment without fuzzy matching 4. **Performance Optimization**: Use `return_fields` to request only needed data * Reduces response payload size significantly * Lowers latency and data transfer costs * Base fields always returned: `record_id`, `is_match`, `minerva_pid`, `match_score`, `validation_errors` * Requested fields are returned at the top level, alongside the base fields 5. **Data Quality Control**: Use `match_condition_fields` to ensure matches have required data 6. **New Data**: `relatives` field now provides family relationship information 7. **Flexible Input**: Name is no longer required when using direct PID or LinkedIn lookups 8. **Same Record Limit**: Maximum 500 records per request (unchanged from V1) ### Key Differences from `/v2/resolve` * **`/v2/enrich`** accepts `minerva_pid` and `linkedin_url` as INPUT fields for direct lookups * **`/v2/resolve`** does NOT accept these fields as inputs (uses reverse lookup instead via single email/phone) * **`/v2/enrich`** requires `record_id` to be provided * **`/v2/resolve`** has optional `record_id` * **`/v2/enrich`** returns comprehensive enrichment data * **`/v2/resolve`** only returns match information and LinkedIn URL # Get LinkedIn Contact Info Source: https://docs.minerva.io/api-reference/get-li-contact-info POST https://api.minerva.io/v2/get_li_contact_info Retrieve contact information for LinkedIn profiles ## Quick Answer **How do I get contact information from a LinkedIn profile?** Use this endpoint to find emails and phone numbers associated with LinkedIn usernames. **Common questions this endpoint answers:** * How do I get contact info from a LinkedIn profile? * How do I find someone's email from their LinkedIn? * How can I get phone numbers from LinkedIn profiles? * How do I convert LinkedIn profiles to contact information? * How can I find direct contact details for LinkedIn users? * How do I check whether contact info exists before delivering records? **What you need:** LinkedIn username (the part after `/in/` in a LinkedIn URL). **What you get back:** Personal emails, professional emails, and phone numbers, each ranked and scored for confidence. **Example:** For `https://www.linkedin.com/in/johnsmith`, provide `"johnsmith"`. ## Overview The Get LinkedIn Contact Info endpoint retrieves contact information (emails and phones) associated with LinkedIn usernames. This is useful when you have a LinkedIn profile URL and want to find the person's contact details. ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `string[]` *required* An array of LinkedIn usernames to look up. Maximum 1000 records per request. Each element must be a string containing a LinkedIn username or profile URL. For `https://www.linkedin.com/in/johnsmith`, you can send either `"johnsmith"` or the full URL. The endpoint normalizes `/in/`, `/pub/`, and `/posts/` URLs. If any element is not a string, the entire request returns `422` before contact lookup. The error identifies the element by its zero-based index, such as `records[1]` for the second element. **presence\_only** `boolean` (default: false) When `true`, the response reports **whether** each contact type exists rather than returning the values. Use this to size a job — check how many of your profiles have a mobile number or a personal email — before delivering records on the full lookup. Must be a boolean; anything else returns `422`. ### Example Request ```python theme={null} import json import requests url = "https://api.minerva.io/v2/get_li_contact_info" headers = { "Content-Type": "application/json", "x-api-key": "YOUR_API_KEY", } # records = LinkedIn username or profile URL strings, max 1000 per request payload = {"records": ["johnsmith", "https://www.linkedin.com/in/janedoe123"]} response = requests.post(url, headers=headers, json=payload, timeout=60) print(response.status_code) print(json.dumps(response.json(), indent=2)) ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of contact information results, in the same order as the `records` you sent **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object **linkedin\_username** `string` The normalized LinkedIn username for this record **is\_match** `boolean` Whether any contact information was found for this LinkedIn profile **phones** `array` Array of phone numbers with ranking and confidence scores. `null` when none were found. **personal\_emails** `array` Array of personal email addresses with ranking and confidence scores. `null` when none were found. **professional\_emails** `array` Array of professional/work email addresses with ranking and confidence scores. `null` when none were found. ##### Email Object **email\_rank** `string` Rank/priority of this email (`"1"` = highest priority) **email\_address** `string` Email address **confidence\_score** `integer` Confidence score for this email, on a 0–100 scale ##### Phone Object **phone\_rank** `string` Rank/priority of this phone (`"1"` = highest priority) **phone\_type** `string` Line type, e.g. `mobile` or `landline` **phone\_number** `string` Phone number **confidence\_score** `integer` Confidence score for this phone, on a 0–100 scale #### Result Object (`presence_only: true`) When `presence_only` is `true`, each result carries booleans instead of contact values: **linkedin\_username** `string` The normalized LinkedIn username for this record **is\_match** `boolean` `true` when any of the three flags below is `true` **personal\_email\_match** `boolean` Whether at least one personal email exists for this profile **professional\_email\_match** `boolean` Whether at least one professional email exists for this profile **phone\_match** `boolean` Whether at least one phone number exists for this profile > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "a7bf5e42-6825-481b-9422-f3ec88b65382", "results": [ { "linkedin_username": "johnsmith", "is_match": true, "phones": [ { "phone_rank": "1", "phone_type": "mobile", "phone_number": "(213) 761-9492", "confidence_score": 92 } ], "personal_emails": [ { "email_rank": "1", "email_address": "john.smith@gmail.com", "confidence_score": 99 }, { "email_rank": "2", "email_address": "jsmith@yahoo.com", "confidence_score": 98 } ], "professional_emails": [ { "email_rank": "1", "email_address": "john.smith@techcorp.com", "confidence_score": 91 } ] }, { "linkedin_username": "janedoe123", "is_match": false, "phones": null, "personal_emails": null, "professional_emails": null } ], "request_completed_at": "2026-07-28T15:30:35.134682+00:00" } ``` ```json 200 — presence_only theme={null} { "api_request_id": "c31f9a08-4d21-4e2a-9a0b-0f2b7c1de5aa", "results": [ { "linkedin_username": "johnsmith", "is_match": true, "personal_email_match": true, "professional_email_match": true, "phone_match": true }, { "linkedin_username": "janedoe123", "is_match": false, "personal_email_match": false, "professional_email_match": false, "phone_match": false } ], "request_completed_at": "2026-07-28T15:31:02.884211+00:00" } ``` ```json 422 — missing records theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v2/get_li_contact_info endpoint is 1000", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input `presence_only` must be a boolean", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 422 — invalid record type theme={null} { "code": "unprocessable_entity", "message": "Input `records[1]` must be a LinkedIn username or profile URL string", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses * `401` - Unauthorized: Invalid API key * `413` - Payload Too Large: More than 1000 records in request * `422` - Unprocessable Entity: Invalid JSON or request shape, missing `records`, a non-string record, or a non-boolean `presence_only`. A non-string record rejects the entire request and the error identifies its zero-based index. * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error ## Notes * LinkedIn usernames are case-insensitive and are lowercased before matching * The endpoint automatically handles various LinkedIn URL formats and extracts the username * When `is_match` is false, `phones`, `personal_emails`, and `professional_emails` are all `null` * Emails and phones are sorted by rank, with lower numbers indicating higher priority/confidence * Rank fields are returned as strings (`"1"`, `"2"`, …), and confidence scores are integers on a 0–100 scale ## Migrating from v1 `POST /v1/get_li_contact_info` is still available but is no longer the recommended path. Two differences to account for when moving to v2: * v2 does **not** return `first_name`, `middle_name`, `last_name`, or `name_suffix`. Use [Enrich v2](/api-reference/enrich-v2) if you need name and profile data alongside contact info. * `presence_only` is v2-only. v1 ignores the flag and always returns the full contact values. # Infer Record Country Source: https://docs.minerva.io/api-reference/infer-record-country POST https://api.minerva.io/v2/infer_record_country Infer country location from email addresses and phone numbers ## Quick Answer **How do I determine someone's country from their contact information?** Use this endpoint to infer country location by analyzing email domains and phone number country codes. **Common questions this endpoint answers:** * How do I find out what country someone is from? * How can I detect international contacts? * How do I identify non-US leads? * How can I route leads based on country? * How do I check if a contact is international? * How can I filter contacts by location? **What you need:** Email addresses and/or phone numbers. **What you get back:** Inferred country, international flag, and detailed metadata for each email/phone showing country codes and validation status. **Common use cases:** * International lead routing and assignment * Geographic segmentation for campaigns * Compliance filtering (e.g., GDPR vs US regulations) * Sales territory assignment * Multi-market customer analysis ## Overview The Infer Record Country endpoint analyzes email addresses and phone numbers to determine the likely country location of a person. This endpoint infers country information by: * Analyzing email domain top-level domains (TLDs) such as `.co.uk`, `.fr`, `.de` * Parsing phone number country codes and validating phone number formats ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `object[]` *required* An array of records containing contact information. Maximum 1000 records per request. **Record object properties** **record\_id** `string` *required* Your unique identifier for this record **emails** `string[]` Array of email addresses to analyze. Emails are validated and analyzed for country-specific TLDs. **phones** `string[]` Array of phone numbers to analyze. Supports various formats including E.164, international format with `+`, and local formats. **first\_name** `string` First name (optional, accepted but not used for country inference) **last\_name** `string` Last name (optional, accepted but not used for country inference) **middle\_name** `string` Middle name (optional, accepted but not used for country inference) **full\_name** `string` Full name (optional, accepted but not used for country inference) **name\_suffix** `string` Name suffix (optional, accepted but not used for country inference) **Note:** At least one of `emails` or `phones` should be provided for meaningful country inference. Name fields are accepted for compatibility with other endpoints but are not used in the country inference logic. ### Request Example ```json theme={null} { "records": [ { "record_id": "user_001", "emails": ["john.smith@example.co.uk", "j.smith@gmail.com"], "phones": ["+44 20 7123 4567"] }, { "record_id": "user_002", "first_name": "Marie", "last_name": "Dubois", "emails": ["marie@example.fr"], "phones": ["+33 1 23 45 67 89", "+33 6 12 34 56 78"] } ] } ``` ## Response ### Response Structure The endpoint returns an array of result objects, one for each input record. Results maintain the same order as the input records. #### Result Object **record\_id** `string` Your identifier from the request **is\_intl** `boolean | null` Whether the record appears to be international (non-US). * `true`: Non-US country detected * `false`: US country detected * `null`: No country could be determined from the provided information **most\_likely\_country** `string | null` The most likely country name based on the analysis. If multiple countries are detected, returns the first one from the inferred list. `null` if no country could be determined. **inferred\_countries** `string[] | null` Array of unique country names inferred from the contact information. Combines results from both email TLDs and phone number country codes. `null` if no countries could be inferred. **email\_metadata** `array` Detailed metadata for each email address analyzed **phone\_metadata** `array` Detailed metadata for each phone number analyzed ##### Email Metadata Object **email** `string` The email address as provided in the request **is\_valid** `boolean` Whether the email address passed basic validation (format check, sanitization) **is\_intl** `boolean | null` Whether the email domain indicates a non-US location based on TLD analysis * `true`: Non-US TLD detected (e.g., `.co.uk`, `.fr`, `.de`) * `false`: US TLD detected or generic TLD with no country inference * `null`: Email is invalid or no country could be determined **country\_code** `string | null` Uppercase ISO country code extracted from the email TLD (e.g., "GB", "FR", "DE"). `null` if no country-specific TLD detected or email is invalid. **location** `string | null` Full country name corresponding to the TLD (e.g., "United Kingdom", "France", "Germany"). `null` if no country-specific TLD detected or email is invalid. ##### Phone Metadata Object **phone** `string` The phone number as provided in the request **is\_valid** `boolean` Whether the phone number passed validation and could be parsed successfully **is\_intl** `boolean | null` Whether the phone number is international (non-US) * `true`: Non-US country code detected * `false`: US country code detected (+1) * `null`: Phone is invalid or country could not be determined **standardized\_phone** `string | null` Phone number in E.164 format (e.g., "+442071234567"). `null` if the phone number is invalid. **country\_code** `string | null` Uppercase ISO country code (e.g., "GB", "FR", "US"). `null` if the phone number is invalid or country could not be determined. **location** `string | null` Full country name (e.g., "United Kingdom", "France", "United States"). `null` if the phone number is invalid or country could not be determined. > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} [ { "record_id": "user_001", "is_intl": true, "most_likely_country": "United Kingdom", "inferred_countries": ["United Kingdom"], "email_metadata": [ { "email": "john.smith@example.co.uk", "is_valid": true, "is_intl": true, "country_code": "UK", "location": "United Kingdom" }, { "email": "j.smith@gmail.com", "is_valid": true, "is_intl": null, "country_code": null, "location": null } ], "phone_metadata": [ { "phone": "+44 20 7123 4567", "is_valid": true, "is_intl": true, "standardized_phone": "+442071234567", "country_code": "GB", "location": "United Kingdom" } ] }, { "record_id": "user_002", "is_intl": true, "most_likely_country": "France", "inferred_countries": ["France"], "email_metadata": [ { "email": "marie@example.fr", "is_valid": true, "is_intl": true, "country_code": "FR", "location": "France" } ], "phone_metadata": [ { "phone": "+33 1 23 45 67 89", "is_valid": true, "is_intl": true, "standardized_phone": "+33123456789", "country_code": "FR", "location": "France" }, { "phone": "+33 6 12 34 56 78", "is_valid": true, "is_intl": true, "standardized_phone": "+33612345678", "country_code": "FR", "location": "France" } ] }, { "record_id": "user_003", "is_intl": false, "most_likely_country": "United States", "inferred_countries": ["United States"], "email_metadata": [ { "email": "contact@example.com", "is_valid": true, "is_intl": null, "country_code": null, "location": null } ], "phone_metadata": [ { "phone": "+1-555-123-4567", "is_valid": true, "is_intl": false, "standardized_phone": "+15551234567", "country_code": "US", "location": "United States" } ] } ] ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v2/infer_record_country endpoint is 1000", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses * `400` - Bad Request: Invalid input format * `401` - Unauthorized: Invalid API key * `413` - Payload Too Large: More than 1000 records in request * `422` - Unprocessable Entity: Invalid data format * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error ## Notes ### API Version Support * This endpoint **only supports API version v2** (`/v2/infer_record_country`) * Maximum **1000 records per request** ### Country Inference Logic Country inference is based on: * **Email TLD analysis**: Extracts country from top-level domains (e.g., `.co.uk` → United Kingdom, `.fr` → France, `.de` → Germany) * Generic TLDs like `.com`, `.org`, `.net` do not provide country information * Email addresses without country-specific TLDs will have `null` values for country fields * **Phone number parsing**: Uses international phone number validation library to: * Parse and validate phone numbers in various formats * Extract country codes * Standardize to E.164 format ### Field Behavior * **`is_intl`**: Determined by checking if any non-US country was inferred * `true`: At least one non-US country detected * `false`: Only US detected * `null`: No country information could be extracted * **`most_likely_country`**: Returns the first country from the `inferred_countries` list * When multiple countries are detected from different emails/phones, the order depends on the order they appear in your input * **`inferred_countries`**: Contains unique country names from all emails and phones analyzed * Duplicates are removed * Returns `null` if empty (no countries inferred) ### Validation * Invalid emails (failed format validation) are included in results with `is_valid: false` and `null` country fields * Invalid phone numbers are included in results with `is_valid: false` and `null` country fields * Duplicate emails and phones within a single record are automatically deduplicated before processing ### Input Field Compatibility * Name fields (`first_name`, `last_name`, `middle_name`, `full_name`, `name_suffix`) are accepted for API compatibility with the resolve endpoint but are **not used** in country inference logic * The endpoint uses the same `ResolveInput` model as the resolve endpoint, allowing seamless integration # Introduction Source: https://docs.minerva.io/api-reference/introduction Minerva API documentation ## What is the Minerva API? The Minerva API helps you **enrich people data** and **resolve identities** to build comprehensive customer profiles. Whether you need to find contact information, match records to unique individuals, or organize people into segments, Minerva provides the data and tools you need. **Common use cases:** * Enrich customer records with demographics, work history, and contact info * Match email addresses or names to unique person identifiers * Find email addresses and phone numbers for contacts * Build and manage segments for marketing campaigns * Monitor life events like deaths for list hygiene **Getting started is simple:** 1. Get an API key from your account manager 2. Use `/resolve` to match people and get their Minerva PID 3. Use `/enrich` to get comprehensive profile data 4. Create segments to organize and monitor cohorts ## Overview The Minerva API provides person data enrichment and identity resolution services. Use our API to: * **Resolve** person identities to unique Minerva PIDs * **Enrich** profiles with demographics, work history, education, and contact information * **Validate** email addresses and infer geographic locations * **Segment** and organize people for tracking and analysis * **Monitor** life event signals like address changes and death records ## Getting Started ### Authentication All API requests require authentication using an API key in the `x-api-key` header: ```bash theme={null} x-api-key: 'YOUR_STATIC_TOKEN' ``` #### Where to get your API key **1. Sign in** Log in at [app.minerva.io](https://app.minerva.io) (not available on the free tier). **2. Open Settings** Click your org name in the **bottom-left** → the three dots (`...`) → **Settings**. **3. Open the API tab** Open the **API** tab and copy your key. Treat it like a password. ### Base URLs ``` Production: https://api.minerva.io ``` ### Static egress IPs Outbound traffic from Minerva — activation pushes, webhooks, and any other Minerva-initiated callback to your endpoints — originates from a fixed set of static IPs. If your security policy requires whitelisting third-party traffic, allow these three addresses on inbound rules: ``` 98.87.210.154 34.224.225.242 100.29.157.18 ``` > [!NOTE] > > You don't need to allow these IPs to **call** the Minerva API — outbound traffic > from your side to `api.minerva.io` works through normal HTTPS without any > allowlist. The list above only matters for traffic Minerva sends **to** your > systems (activations / webhooks). If you don't receive Minerva-initiated > traffic, you can ignore this section. ### API Versions We support two API versions: * **v1**: Core resolve and enrich functionality * **v2**: Enhanced features including segments, validation, and additional endpoints Specify the version in the URL path: `/v1/resolve` or `/v2/segments/create` ## Core Concepts ### Minerva PID The Minerva Person ID (PID) is a unique identifier for each person in our database. PIDs follow the format `p-{hash}`, for example: `p-a1b2c3d4e5f6`. Use the `/resolve` or `/enrich` endpoints to obtain a Minerva PID from name and contact information. ### Resolution Resolution matches your input data (name, email, phone) to a unique person in our database. Our matching algorithm uses: * Fuzzy name matching * Email and phone matching * Address matching * Confidence scoring ### Enrichment Enrichment returns comprehensive profile data for a resolved person: * Demographics (age, gender, marital status) * Contact information (emails, phones) * Address history with property details * Work experience and employment data * Education history * Financial indicators (income range, wealth range) * Social media profiles ### Segments Segments are groups of people identified by Minerva PIDs. Use them to: * Organize leads or customers * Track specific cohorts * Monitor life events and signals * Export targeted lists ## API Endpoints ### Core Endpoints **[Resolve](/api-reference/resolve)** → Match person identity to a unique Minerva PID **[Enrich](/api-reference/enrich)** → Get comprehensive person profile data **[Get LinkedIn Contact Info](/api-reference/get-li-contact-info)** → Retrieve contact info for LinkedIn profiles ### Validation Endpoints **[Validate Emails](/api-reference/validate-emails)** → Verify email addresses in the Minerva database **[Infer Record Country](/api-reference/infer-record-country)** → Determine country location from contact information ### Segments **[Create Segment](/api-reference/segments-create)** → Create a new segment **[Get Segment Members](/api-reference/segments-members)** → Retrieve members of a segment **[Add Members](/api-reference/segments-members-add)** → Add people to a segment **[Remove Members](/api-reference/segments-members-remove)** → Remove people from a segment **[Death Signals](/api-reference/segments-signals-deaths)** → Get death signals for segment members ## Rate Limits API rate limits vary by endpoint and subscription tier: | Endpoint | Max Records per Request | | - | - | | `/v1/resolve` | 1,000 | | `/v1/enrich` | 500 | | `/v2/get_li_contact_info` | 1,000 | | `/v2/validate_emails` | 2,000 | | `/v2/infer_record_country` | 1,000 | | `/v2/segments/members` | 5,000 per page | Contact your account manager for information about request rate limits. ## Response Format Successful responses return: ```json theme={null} { "api_request_id": "unique-request-identifier", "results": [...], "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` ## Error Handling Errors return: ```json theme={null} { "api_request_id": "unique-request-identifier", "error_message": "Description of the error" } ``` ### Common HTTP Status Codes * `200` - Success * `400` - Bad Request (invalid input) * `401` - Unauthorized (invalid API key) * `402` - Payment Required: Insufficient record export capacity (`insufficient_record_capacity`). The response includes available allowance and overage records; increase your monthly spend limit or upgrade before retrying. * `404` - Not Found (resource doesn't exist) * `413` - Payload Too Large (exceeded record limit) * `422` - Unprocessable Entity (validation error) * `429` - Too Many Requests (rate limit exceeded) * `500` - Internal Server Error ## Best Practices ### Batch Requests Batch multiple records in a single request rather than making individual calls: ```javascript theme={null} // Good: Batch multiple records together POST https://api.minerva.io/v1/resolve { "records": [ { "record_id": "1", ... }, { "record_id": "2", ... }, { "record_id": "3", ... } ] } // Avoid: Separate requests for each record POST https://api.minerva.io/v1/resolve { "records": [{ "record_id": "1", ... }] } POST https://api.minerva.io/v1/resolve { "records": [{ "record_id": "2", ... }] } ``` ### Handle Partial Failures Individual records can fail validation while others succeed. Check the `is_match` and `validation_errors` fields: ```javascript theme={null} response.results.forEach(result => { if (result.is_match) { // Process successful match } else if (result.validation_errors) { // Handle validation errors } else { // No match found } }); ``` ### Use Record IDs Include unique `record_id` values to match responses back to your source data: ```json theme={null} { "records": [ { "record_id": "customer_12345", "first_name": "John", "last_name": "Smith" } ] } ``` ### Provide More Data for Better Matches More input data improves match rates: * Name + Email + Phone (best) * Name + Email (good) * Name + Phone (good) ## Support For technical support or questions: * Email: [help@minerva.io](mailto:help@minerva.io) * Documentation: [https://docs.minerva.io](https://docs.minerva.io) * Status Page: [https://status.minerva.io](https://status.minerva.io) ## Changelog ### v2 (Current) * Added segments management endpoints * Added email validation endpoint * Added country inference endpoint * Enhanced death signals monitoring ### v1 * Initial release with resolve and enrich endpoints * LinkedIn contact information lookup # Person Search Source: https://docs.minerva.io/api-reference/person-search POST https://api.minerva.io/person-search/v0/search Find people using a natural-language audience description and return matching Minerva PIDs with contact-channel coverage stats ## Quick Answer **How do I find people with a natural-language query?** Use this endpoint to describe an audience in plain English (for example, "Software engineers in Denver with a professional email"). Minerva parses the query, runs it against the person dataset, and returns Minerva PIDs plus coverage statistics for available contact channels. **Common questions this endpoint answers:** * How do I search for people by description instead of filters? * How do I build an audience from a natural-language prompt? * How do I get Minerva PIDs for a persona or segment definition? * How do I know what percent of my audience has email, phone, or LinkedIn? * How do I preview an audience before exporting it? **What you need:** A short natural-language description of the audience (up to 500 characters). **What you get back:** A `search_id`, the list of matching Minerva PIDs (up to `size`), total match count, and contact-channel coverage stats for both the full match set and the returned page. **Common use cases:** * Turn a prompt like "CFOs at Series B fintechs in NYC" into a list of PIDs * Preview how large and how reachable an audience is before exporting * Feed results into `/enrich` or segments workflows ## Overview The Person Search endpoint accepts a natural-language description of an audience and returns matching people from the Minerva dataset. Internally the service parses the prompt into structured filters, executes a search, and synchronously returns: * A stable `search_id` you can retrieve again later * Minerva PIDs for the returned page (up to `size`) * The `total_count` of everyone matching the search (may exceed the returned page) * Contact-channel coverage stats across the full match set (`total_contact_coverage`) and across the returned page (`results_contact_coverage`) The call is synchronous. Typical latency is a few seconds depending on query complexity. Usage is metered per organization per UTC day. See [Person Search Usage](/api-reference/person-search-usage) for limits and consumption. ## Writing good queries The query is a natural-language audience *description* — not a lookup of a specific named person. Best results come from describing the **attributes** the people share. The parser handles these attribute categories well: | Category | Examples | | - | - | | **Role / job title** | "engineers", "CFOs", "senior product managers", "VPs of engineering" | | **Industry** | "fintech", "biotech", "SaaS", "venture capital" | | **Company** | named companies ("Google", "Stripe"), groupings ("FAANG companies"), or stage ("Series B startups") | | **Career history** | "previously worked at Meta", "former Apple engineers", "left a Series A in 2024" | | **Location** | cities, regions, or countries ("in NYC", "Bay Area", "based in Germany") | | **Education** | school + major + level ("CS degrees from MIT", "Harvard MBAs") | | **Age** | ranges or descriptive ("30–40 years old", "in their 50s") | | **Income / wealth** | "earning over 200k", "own homes worth over 1M" | | **Contact-channel constraints** | "with a professional email on file", "have a LinkedIn profile URL on file" | LinkedIn availability means a profile URL is on file. It does not indicate a LinkedIn verification badge or independently verified identity. Boolean logic (`and` / `or` / `not`) and nested groups work too — the parser turns "MIT or Stanford CS grads" into the right OR group automatically. ### Three example queries Three patterns that cover most real audience definitions. Each maps to a shape the parser handles cleanly out of the box. ```bash 1. Simple — role + location + contact theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "Software engineers in Denver with a professional email on file", "size": 50 }' ``` ```bash 2. Moderate — role + company stage + industry + location theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "CFOs at Series B fintech startups in NYC", "size": 100 }' ``` ```bash 3. Advanced — multi-attribute with demographics + wealth theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "Engineers at FAANG companies with CS degrees from MIT or Stanford, 30-40 years old, who own homes worth over 1M", "size": 100 }' ``` ### Tips * **Describe attributes, not specific people.** A lookup of "John Doe at Acme Inc." is a PII match — use [`/v2/resolve`](/api-reference/resolve-v2) for that. Person Search is for audience definitions ("engineers at SaaS companies"). * **Be specific about role + company.** Adding "at Google" or "in fintech" narrows the result set materially vs. a bare role. * **Combine 4–6 attributes for high-precision audiences.** Each additional filter sharpens the segment. * **Add a contact-channel constraint** (e.g. "with a professional email") when you need to reach the audience — guarantees the returned PIDs are actually reachable on that channel. * **Stay under 500 characters.** The endpoint validates `query` length (see [Request Body](#request-body)). ```bash Request Example theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "Software engineers in Denver with a professional email on file", "size": 50 }' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. **Content-Type** `string` *required* `application/json` ### Request Body **query** `string` *required* Natural-language description of the people you want to find. Between 1 and 500 characters. See [Writing good queries](#writing-good-queries) for supported attribute categories and worked examples. **size** `integer` (default: 100) Maximum number of Minerva PIDs to return in `results`. Must be between `1` and `100`. The `total_count` field still reflects the full match count even when `size` is smaller than the match set. ### Request Example ```json theme={null} { "query": "Software engineers in Denver with a professional email on file", "size": 50 } ``` ## Response ### Success Response The API returns a JSON object with the new `search_id`, the list of matching PIDs for this page, and coverage statistics for contact channels. **search\_id** `string` UUID identifying this search. Store it if you plan to fetch the same results later with [Get Person Search](/api-reference/person-search-get). **query** `string` The normalized query associated with this search. **results** `string[]` Array of Minerva PIDs for this page of results. Length is at most `size`. Each PID has the format `p-{hash}` and can be used with `/enrich`, segments, and other person-level endpoints. **total\_count** `integer` Total number of people matching the search. Can be larger than `result_count` if `size` is smaller than the match set. **result\_count** `integer` Number of PIDs actually returned in `results` for this response. **total\_contact\_coverage** `object` Availability of contact channels across the full match set of `total_count` people. See [Coverage stats](#coverage-stats) below for object shape. **results\_contact\_coverage** `object` Availability of contact channels across the `result_count` PIDs returned on this page. See [Coverage stats](#coverage-stats) below for object shape. **created\_at** `string` ISO 8601 timestamp (UTC) indicating when the search was created. ### Coverage stats Both `total_contact_coverage` and `results_contact_coverage` share the same shape. Each channel entry reports how many people in the corresponding population have that channel on file, and what percentage that represents. **personal\_email** `object` Count and percent of people with a personal email on file. **professional\_email** `object` Count and percent of people with a professional email on file. **phone** `object` Count and percent of people with a phone number on file. **linkedin** `object` Count and percent of people with a LinkedIn profile on file. Each channel object contains: **count** `integer` Number of people in the population who have this contact channel on file. **percent** `number` `count` divided by the size of the population, expressed as a percentage (`0.0`–`100.0`). ```json 200 theme={null} { "search_id": "550e8400-e29b-41d4-a716-446655440000", "query": "Software engineers in Denver with a professional email on file", "results": [ "p-a1b2c3d4e5f6", "p-b2c3d4e5f6a7", "p-c3d4e5f6a7b8" ], "total_count": 1284, "result_count": 3, "total_contact_coverage": { "personal_email": { "count": 812, "percent": 63.24 }, "professional_email": { "count": 1284, "percent": 100.0 }, "phone": { "count": 497, "percent": 38.71 }, "linkedin": { "count": 1110, "percent": 86.45 } }, "results_contact_coverage": { "personal_email": { "count": 2, "percent": 66.67 }, "professional_email": { "count": 3, "percent": 100.0 }, "phone": { "count": 1, "percent": 33.33 }, "linkedin": { "count": 3, "percent": 100.0 } }, "created_at": "2026-04-24T15:02:11.482915+00:00" } ``` ```json 400 theme={null} { "code": "no_filters_extracted", "message": "No usable filters could be derived from the query.", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 403 theme={null} { "code": "forbidden", "message": "Not authorized for this route or plan", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "validation_error", "message": "Invalid request data", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123", "details": [ { "loc": ["query"], "type": "string_too_long" } ] } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ## Error Responses ### Common Errors * `400` - **Bad Request**: The natural-language query could not be turned into any usable search filters. Rephrase the query with more concrete criteria (role, location, industry, seniority, etc.). * `401` - **Unauthorized**: Invalid or missing API key * `403` - **Forbidden**: The API key is valid but not authorized for this route or your plan tier * `422` - **Unprocessable Entity**: Request validation failed. Examples: `query` missing or empty, `query` longer than 500 characters, `size` outside `1`-`100`, or body is not valid JSON. * `429` - **Too Many Requests**: Rate limit or plan quota exceeded * `500` - **Internal Server Error**: Unexpected server error ### Error Examples **No usable filters extracted from the query:** ```json theme={null} { "code": "no_filters_extracted", "message": "No usable filters could be derived from the query.", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` **Validation error (query too long):** ```json theme={null} { "code": "validation_error", "message": "Invalid request data", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901", "details": [ { "loc": ["query"], "type": "string_too_long" } ] } ``` ## Related Endpoints * [Get Person Search](/api-reference/person-search-get) - Retrieve a previously created search by `search_id` * [Async Person Search](/api-reference/person-search-async) - Materialize a complete segment, inspect its size, then page PIDs * [Person Search Usage](/api-reference/person-search-usage) - Daily delivery limits and consumption history * [Contact Append](/api-reference/person-search-contact-append) - Async ABM contacts at target companies * [Contact Prospect](/api-reference/person-search-contact-prospect) - Async contacts by NAICS + title * [Contact Job Status](/api-reference/person-search-contact-job) - Poll contact-append / contact-prospect jobs * [Contact Job Results](/api-reference/person-search-contact-job-results) - Unlock (bill) and page contact job results * [Enrich v2](/api-reference/enrich-v2) - Fetch full profile data for the Minerva PIDs returned here * [Add Members to Segment](/api-reference/segments-members-add) - Persist search results into a segment for tracking # Async Person Search Source: https://docs.minerva.io/api-reference/person-search-async Submit a search, poll for completion, page matching PIDs, and enrich the records you need Async Person Search finds an audience in the background. To retrieve every matching PID, submit with `materialization_extent: "full"`, wait for `completed`, then page the results with `GET`. Search and PID retrieval do not consume record capacity. To fetch full profiles, send the PIDs to [Enrich v2](/api-reference/enrich-v2). Record capacity is consumed when records are delivered, with each unique record counted once per organization per billing term across delivery channels. ## 1. Submit a full search ```bash theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search-jobs' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "Software engineers in Austin", "materialization_extent": "full" }' ``` The `202 Accepted` response contains a `segment_id`. Use it for polling and pagination. Queries can contain up to 500 characters. > [!NOTE] > > The default mode is `preview`: it returns an audience count and statistics > when ready, but does not provide the full PID result set. Set `full` when > submitting a search that you want to page. ## 2. Wait for completion ```bash theme={null} curl --url 'https://api.minerva.io/person-search/v0/search-jobs/' \ --header 'x-api-key: ' ``` Poll every 2–5 seconds until `status` is `completed`. The response includes `total_count`, the parsed criteria, and audience statistics. Stop polling on `failed` or `cancelled`; inspect `error` before submitting a revised search. Preview jobs can also finish with `completed`; `materialization_extent` identifies whether the job materialized a `preview` or the `full` audience. Treat `previewed` as a successful preview status as well. PID pagination requires `completed` with `materialization_extent: "full"`. For `failed` and `cancelled`, inspect the response's `error` object for its stable `code` and caller-safe `message`. `error.retryable` is always `false` because the job is terminal; submit a new or revised search to continue. `search_timed_out` means the processing budget was exhausted; `search_worker_lost` means a terminated worker was recovered from the failure queue. A nonterminal status alone does not predict completion. When criteria caused the failure, `error_criteria` identifies them and `suggested_search` provides a rephrased query worth trying instead. ## 3. Page the PIDs ```bash theme={null} curl --url 'https://api.minerva.io/person-search/v0/search-jobs//results?limit=100&offset=0' \ --header 'x-api-key: ' ``` Each page contains up to 100 PIDs: ```json theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "pids": ["pid_1", "pid_2"], "total": 2, "returned": 2, "limit": 100, "offset": 0 } ``` Increase `offset` by `returned` for the next page. Stop when `offset + returned >= total`. The page-size limit does not cap the audience. Requests made before a full search completes return `409 Conflict`. ## 4. Retrieve full records Pass the PIDs you need to [Enrich v2](/api-reference/enrich-v2): ```bash theme={null} curl --request POST \ --url 'https://api.minerva.io/v2/enrich' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "records": [ {"record_id": "person-1", "minerva_pid": ""} ] }' ``` For example, paging 10,000 PIDs consumes no record capacity. Enriching 200 of those records consumes capacity for the records delivered that your organization has not already received in the current term. See the endpoint references for [submission](/api-reference/person-search-job-submit), [status](/api-reference/person-search-job-status), and [results](/api-reference/person-search-job-results). ### Use preview counts before completion For a third-party preview backed by one Elasticsearch query, polling can return `total_count` while `status` is `computing_stats` and `stats` is still `null`. Display the count as soon as it is non-null, then continue polling the same job for demographics and completion. The count is exact; `0` is a valid result. A later failure preserves the count and returns a terminal failure status. Processing statuses include `counting`, `computing_stats`, `materializing`, `exporting`, and `finalizing`. Stop only on `completed`, `previewed`, `failed`, or `cancelled`; not every job passes through every stage. # Contact Append Source: https://docs.minerva.io/api-reference/person-search-contact-append POST https://api.minerva.io/person-search/v0/contact-append Queue an asynchronous ABM contact-append job that finds current employees at target companies matching desired job titles ## Quick Answer **How do I find contacts at specific companies by job title?** Use Contact Append to submit companies and job titles. Minerva queues an asynchronous job and returns a `job_id` you poll until completion, then unlock to retrieve billed results. **Common questions this endpoint answers:** * How do I find CTOs / VPs at a list of target accounts? * How do I run ABM contact append without blocking on a long search? * How do I safely retry a contact-append request? **What you need:** One or more company identifiers (name, domain, and/or LinkedIn URL) and one or more job titles. **What you get back:** HTTP `202` with a `job_id`, `job_type`, `status`, and `created_at`. Poll [Contact Job Status](/api-reference/person-search-contact-job), then unlock via [Contact Job Results](/api-reference/person-search-contact-job-results). ## Overview Contact Append finds current employees at the companies you specify whose titles approximately match the titles you request. The endpoint is **asynchronous**: 1. `POST /person-search/v0/contact-append` → `202` + `job_id` 2. Poll `GET /person-search/v0/contact-jobs/{job_id}` until `status` is `completed` (or `failed`) 3. `POST /person-search/v0/contact-jobs/{job_id}/results` once to unlock and bill 4. Page further results with `GET .../results` (no additional billing) Billing happens on unlock, not on submit. See [Contact Job Results](/api-reference/person-search-contact-job-results#billing). ```bash Request Example theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/contact-append' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: append-acme-cto-2026-07-21' \ --data '{ "companies": [ {"domain": "acme.com"}, {"name": "Globex", "linkedin_url": "https://www.linkedin.com/company/globex"} ], "job_titles": ["Chief Technology Officer", "VP Engineering"], "size": 100 }' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. **Idempotency-Key** `string` Optional client-supplied key (max 200 characters). Reusing the same key with the same org and an identical request returns the existing job. Reusing it with a different request body returns `409 Conflict`. ### Body **companies** `object[]` *required* Target companies (1–25). Each company must include at least one of `name`, `domain`, or `linkedin_url`. **companies\[].name** `string` Company name (exact, case-insensitive). Max 200 characters. **companies\[].domain** `string` Website domain. Bare domains and full URLs are accepted (for example `acme.com` or `https://www.acme.com/about`). **companies\[].linkedin\_url** `string` Company LinkedIn URL (`linkedin.com/company/...` or `/school/...`). **job\_titles** `string[]` *required* Desired job titles (1–25). Candidate titles are matched approximately. **size** `integer` Maximum contacts to return. Defaults to `100`. Range: `1`–`500`. ## Response ### Success Response (`202 Accepted`) **job\_id** `string` UUID of the queued job. Use it with [Contact Job Status](/api-reference/person-search-contact-job) and [Contact Job Results](/api-reference/person-search-contact-job-results). **job\_type** `string` Always `contact_append` for this endpoint. **status** `string` Initial status, typically `queued`. **created\_at** `string` ISO-8601 timestamp when the job was created. ```json Response Example theme={null} { "job_id": "550e8400-e29b-41d4-a716-446655440000", "job_type": "contact_append", "status": "queued", "created_at": "2026-07-21T13:54:00.123456+00:00" } ``` ## Errors | Status | When | | - | - | | `400` | Invalid body (missing companies/titles, out-of-range `size`, empty company identifier) | | `409` | `Idempotency-Key` reused with a different request body | | `503` | Job could not be queued for processing | ## Related * [Contact Prospect](/api-reference/person-search-contact-prospect) — NAICS-based prospecting * [Contact Job Status](/api-reference/person-search-contact-job) — poll job progress * [Contact Job Results](/api-reference/person-search-contact-job-results) — unlock and page results * [Person Search](/api-reference/person-search) — natural-language audience search # Contact Job Status Source: https://docs.minerva.io/api-reference/person-search-contact-job GET https://api.minerva.io/person-search/v0/contact-jobs/{job_id} Poll the status of an asynchronous contact-append or contact-prospect job ## Quick Answer **How do I know when my contact job is done?** Poll this endpoint with the `job_id` from Contact Append or Contact Prospect until `status` is `completed` or `failed`. **Common questions this endpoint answers:** * Is my contact-append / contact-prospect job still running? * How many contacts matched before the size cap? * Have results already been unlocked for billing? **What you need:** The UUID `job_id` from a previous submit call. **What you get back:** Current job status, optional result counts, unlock flag, and error details when failed. ## Overview Returns the current state of a contact job owned by your organization. Use this after [Contact Append](/api-reference/person-search-contact-append) or [Contact Prospect](/api-reference/person-search-contact-prospect). Recommended polling: every 2–5 seconds until `status` is terminal (`completed` or `failed`). Once `completed`, unlock results with [Contact Job Results](/api-reference/person-search-contact-job-results). ### Status values | Status | Meaning | | - | - | | `queued` | Accepted; waiting for a worker | | `running` | Worker is computing matches | | `retrying` | Transient failure; will be retried | | `completed` | Results are ready to unlock | | `failed` | Terminal failure — see `error_code` / `message` | This endpoint does **not** bill. Billing occurs only on the first successful `POST .../results` unlock. ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/person-search/v0/contact-jobs/550e8400-e29b-41d4-a716-446655440000' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. ### Path Parameters **job\_id** `string` *required* UUID of the contact job returned by Contact Append or Contact Prospect. ## Response ### Success Response (`200 OK`) **job\_id** `string` Job UUID. **job\_type** `string` `contact_append` or `contact_prospect`. **status** `string` One of `queued`, `running`, `retrying`, `completed`, `failed`. **created\_at** `string` ISO-8601 creation timestamp. **result\_count** `integer` Number of stored result rows when the job completed. `null` while in progress. **total\_matched** `integer` Contacts matched in evaluated title batches before applying the size cap. `null` while in progress. **results\_unlocked** `boolean` `true` after a successful unlock via `POST .../results`. **error\_code** `string` Machine-readable failure code when `status` is `failed`. **message** `string` Public error message when the job failed. **started\_at** `string` When the worker claimed the job, if started. **completed\_at** `string` When the job reached a terminal state, if finished. **updated\_at** `string` Last status update timestamp. ```json Response Example (completed) theme={null} { "job_id": "550e8400-e29b-41d4-a716-446655440000", "job_type": "contact_append", "status": "completed", "created_at": "2026-07-21T13:54:00.123456+00:00", "result_count": 42, "total_matched": 58, "results_unlocked": false, "error_code": null, "message": null, "started_at": "2026-07-21T13:54:02.000000+00:00", "completed_at": "2026-07-21T13:54:45.000000+00:00", "updated_at": "2026-07-21T13:54:45.000000+00:00" } ``` ## Errors | Status | When | | - | - | | `404` | Unknown `job_id`, or the job belongs to another organization | ## Related * [Contact Append](/api-reference/person-search-contact-append) * [Contact Prospect](/api-reference/person-search-contact-prospect) * [Contact Job Results](/api-reference/person-search-contact-job-results) # Contact Job Results Source: https://docs.minerva.io/api-reference/person-search-contact-job-results POST https://api.minerva.io/person-search/v0/contact-jobs/{job_id}/results Retrieve matched contacts using record capacity once per unique record per contract term ## Quick Answer **How do I get contacts from a finished contact job?** When status is `completed`, call `POST /person-search/v0/contact-jobs/{job_id}/results` to unlock the result view, then use `GET` on the same path to page additional results. Each returned record counts once per contract term. **Common questions this endpoint answers:** * How do I download contact-append / contact-prospect results? * When am I charged for contact jobs? * How do I paginate unlocked results? **What you need:** A completed `job_id` from your organization. **What you get back:** A page of matched contacts (PID, titles, company/NAICS match fields, enrichment jacket), plus `billable_count` and `unlocked_at`. ## Overview Contact job results are locked until you unlock them. | Method | Purpose | Bills? | | - | - | - | | `POST .../results` | Unlock the result view and return the requested page | New records in this page use record capacity | | `GET .../results` | Page results after unlock | New records in this page use record capacity | If you call `GET` before unlocking, the API returns `409 Conflict` telling you to `POST` first. ### Billing Records count once per organization per contract term across every delivery channel. Repeated reads within that term consume no additional capacity. A read in a new term counts the returned records again, even when the result view was unlocked earlier. * If the page exceeds available plan allowance and overage capacity, the request returns `402` without records. Increase the monthly spend limit or upgrade before retrying. * `billable_count` is the number of records newly counted by this response. It includes records funded by allowance, not only paid overage. * Unlimited Enterprise delivery does not consume record capacity. ```bash Unlock (POST) theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/contact-jobs/550e8400-e29b-41d4-a716-446655440000/results?limit=100&offset=0' \ --header 'x-api-key: ' ``` ```bash Page (GET) theme={null} curl --request GET \ --url 'https://api.minerva.io/person-search/v0/contact-jobs/550e8400-e29b-41d4-a716-446655440000/results?limit=100&offset=100' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. ### Path Parameters **job\_id** `string` *required* UUID of a completed contact job owned by your organization. ### Query Parameters **limit** `integer` Page size. Defaults to `100`. Range: `1`–`100`. **offset** `integer` Number of results to skip. Defaults to `0`. ## Response ### Success Response (`200 OK`) Same shape for `POST` (unlock) and `GET` (page). **job\_id** `string` Job UUID. **job\_type** `string` `contact_append` or `contact_prospect`. **results** `object[]` Page of matched contacts. **results\[].minerva\_pid** `string` Minerva person ID (`p-…`). **results\[].matched\_job\_title** `string` The requested job title this contact matched. **results\[].current\_job\_title** `string` Current job title on file, when available. **results\[].matched\_company** `object` Input company that matched (contact-append only). May include `name`, `domain`, and/or `linkedin_url`. **results\[].matched\_naics\_code** `string` Input NAICS code that matched (contact-prospect only). **results\[].jacket** `object` Enrichment payload for the person (lowercased column names from the enrichment dataset). **total** `integer` Total stored results for the job (`result_count`). **returned** `integer` Number of results in this page. **limit** `integer` Echo of the requested `limit`. **offset** `integer` Echo of the requested `offset`. **billable\_count** `integer` Records newly counted in this response under the current contract term. **unlocked\_at** `string` ISO-8601 timestamp of the successful unlock. ```json Response Example theme={null} { "job_id": "550e8400-e29b-41d4-a716-446655440000", "job_type": "contact_append", "results": [ { "minerva_pid": "p-abc123", "matched_job_title": "Chief Technology Officer", "current_job_title": "CTO", "matched_company": {"domain": "acme.com"}, "matched_naics_code": null, "jacket": { "full_name": "Ada Lovelace", "linkedin_url": "https://www.linkedin.com/in/ada" } } ], "total": 42, "returned": 1, "limit": 100, "offset": 0, "billable_count": 1, "unlocked_at": "2026-07-21T13:55:10.000000+00:00" } ``` ## Errors | Status | When | | - | - | | `404` | Unknown `job_id`, or job belongs to another organization | | `409` | Job not `completed` yet; unlock already in progress; or `GET` before unlock | | `402` | Insufficient plan allowance and overage capacity (`insufficient_record_capacity`) | | `503` | Billing or delivery initialization failed transiently — safe to retry | ## Related * [Contact Append](/api-reference/person-search-contact-append) * [Contact Prospect](/api-reference/person-search-contact-prospect) * [Contact Job Status](/api-reference/person-search-contact-job) # Contact Prospect Source: https://docs.minerva.io/api-reference/person-search-contact-prospect POST https://api.minerva.io/person-search/v0/contact-prospect Queue an asynchronous contact-prospect job that finds people in NAICS industries matching desired job titles ## Quick Answer **How do I find contacts in an industry by job title?** Use Contact Prospect with NAICS codes and job titles. Minerva queues an asynchronous job and returns a `job_id` you poll until completion, then unlock to retrieve billed results. **Common questions this endpoint answers:** * How do I prospect contacts in specific NAICS industries? * How do I find title matches without providing a company list? * How do I safely retry a contact-prospect request? **What you need:** One or more NAICS codes (2–6 digits) and one or more job titles with at least one meaningful alphanumeric token. **What you get back:** HTTP `202` with a `job_id`, `job_type`, `status`, and `created_at`. Poll [Contact Job Status](/api-reference/person-search-contact-job), then unlock via [Contact Job Results](/api-reference/person-search-contact-job-results). ## Overview Contact Prospect finds people whose current job falls under the NAICS industries you specify and whose titles approximately match the titles you request. NAICS codes are **prefix-matched** against stored 6-digit codes. For example, `"51"` matches information industries under that prefix. Note that a substantial share of current jobs have no NAICS code and are invisible to this filter. The endpoint is **asynchronous** — same lifecycle as [Contact Append](/api-reference/person-search-contact-append): 1. Submit → `202` + `job_id` 2. Poll status until `completed` 3. Unlock results (billing) with `POST .../results` 4. Page with `GET .../results` Billing happens on unlock, not on submit. See [Contact Job Results](/api-reference/person-search-contact-job-results#billing). ```bash Request Example theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/contact-prospect' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: prospect-5112-cfo-2026-07-21' \ --data '{ "naics_codes": ["5112", "518"], "job_titles": ["Chief Financial Officer", "VP Finance"], "size": 100 }' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. **Idempotency-Key** `string` Optional client-supplied key (max 200 characters). Reusing the same key with the same org and an identical request returns the existing job. Reusing it with a different request body returns `409 Conflict`. ### Body **naics\_codes** `string[]` *required* NAICS industry codes (1–10 entries). Each code must be 2–6 ASCII digits. Codes are prefix-matched against stored 6-digit NAICS values. **job\_titles** `string[]` *required* Desired job titles (1–25). Titles are pre-filtered in SQL, then matched approximately. At least one title must contain a non-stopword alphanumeric token. **size** `integer` Maximum contacts to return. Defaults to `100`. Range: `1`–`500`. ## Response ### Success Response (`202 Accepted`) **job\_id** `string` UUID of the queued job. Use it with [Contact Job Status](/api-reference/person-search-contact-job) and [Contact Job Results](/api-reference/person-search-contact-job-results). **job\_type** `string` Always `contact_prospect` for this endpoint. **status** `string` Initial status, typically `queued`. **created\_at** `string` ISO-8601 timestamp when the job was created. ```json Response Example theme={null} { "job_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "job_type": "contact_prospect", "status": "queued", "created_at": "2026-07-21T13:54:00.123456+00:00" } ``` ## Errors | Status | When | | - | - | | `400` | Invalid NAICS codes, empty/invalid titles, or out-of-range `size` | | `409` | `Idempotency-Key` reused with a different request body | | `503` | Job could not be queued for processing | ## Related * [Contact Append](/api-reference/person-search-contact-append) — company-targeted ABM append * [Contact Job Status](/api-reference/person-search-contact-job) — poll job progress * [Contact Job Results](/api-reference/person-search-contact-job-results) — unlock and page results # Get Person Search Source: https://docs.minerva.io/api-reference/person-search-get GET https://api.minerva.io/person-search/v0/search/{search_id} Retrieve a previously created person search by id, returning the same payload as the original search ## Quick Answer **How do I re-fetch the results of a previous person search?** Use this endpoint with the `search_id` you received from [Person Search](/api-reference/person-search) to get back the same search payload — PIDs, total count, and contact-channel coverage — without re-running the query. **Common questions this endpoint answers:** * How do I look up a saved person search? * How do I re-download results from a search I ran earlier? * How do I verify what query a given `search_id` corresponds to? **What you need:** The UUID `search_id` returned from a previous `POST /person-search/v0/search` call. **What you get back:** The same `PersonSearchResponse` shape as the original search, including `results`, `total_count`, and both full-set and page-level contact coverage stats. ## Overview The Get Person Search endpoint returns the stored payload for a search you created earlier with [Person Search](/api-reference/person-search). The response shape is identical to `POST /person-search/v0/search`, so you can use the same result-handling code for both endpoints. Only searches that belong to your organization can be accessed. Requests for `search_id` values from a different organization return `404`. ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/person-search/v0/search/550e8400-e29b-41d4-a716-446655440000' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. ### Path Parameters **search\_id** `string` *required* UUID of the search to retrieve. This is the `search_id` returned from `POST /person-search/v0/search`. ### Request Notes * There is no request body and no query parameters. * The search must belong to the organization associated with your API key. ## Response ### Success Response The endpoint returns the same payload shape as [Person Search](/api-reference/person-search). See that page for the full field reference on `total_contact_coverage` and `results_contact_coverage`. **search\_id** `string` UUID identifying the search. Matches the `search_id` you requested. **query** `string` The normalized natural-language query associated with this search. **results** `string[]` Array of Minerva PIDs previously returned for this search. Each PID has the format `p-{hash}`. **total\_count** `integer` Total number of people matching the search at the time it was run. **result\_count** `integer` Number of PIDs in `results`. **total\_contact\_coverage** `object` Availability of contact channels across the full match set of `total_count` people. See the [Person Search](/api-reference/person-search#coverage-stats) page for the field-level shape. **results\_contact\_coverage** `object` Availability of contact channels across the PIDs in `results`. Same shape as `total_contact_coverage`. **created\_at** `string` ISO 8601 timestamp (UTC) indicating when the search was originally created. ```json 200 theme={null} { "search_id": "550e8400-e29b-41d4-a716-446655440000", "query": "Software engineers in Denver with a professional email on file", "results": [ "p-a1b2c3d4e5f6", "p-b2c3d4e5f6a7", "p-c3d4e5f6a7b8" ], "total_count": 1284, "result_count": 3, "total_contact_coverage": { "personal_email": { "count": 812, "percent": 63.24 }, "professional_email": { "count": 1284, "percent": 100.0 }, "phone": { "count": 497, "percent": 38.71 }, "linkedin": { "count": 1110, "percent": 86.45 } }, "results_contact_coverage": { "personal_email": { "count": 2, "percent": 66.67 }, "professional_email": { "count": 3, "percent": 100.0 }, "phone": { "count": 1, "percent": 33.33 }, "linkedin": { "count": 3, "percent": 100.0 } }, "created_at": "2026-04-24T15:02:11.482915+00:00" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 403 theme={null} { "code": "forbidden", "message": "Not authorized for this route or plan", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 404 theme={null} { "code": "not_found", "message": "Search not found.", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "validation_error", "message": "Invalid request data", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123", "details": [ { "loc": ["search_id"], "type": "uuid_parsing" } ] } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ## Error Responses ### Common Errors * `401` - **Unauthorized**: Invalid or missing API key * `403` - **Forbidden**: The API key is valid but not authorized for this route or your plan tier * `404` - **Not Found**: No search with the provided `search_id` exists for your organization. This is also returned if the search belongs to a different organization. * `422` - **Unprocessable Entity**: `search_id` is not a valid UUID * `429` - **Too Many Requests**: Rate limit or plan quota exceeded * `500` - **Internal Server Error**: Unexpected server error ### Error Example **Search not found:** ```json theme={null} { "code": "not_found", "message": "Search not found.", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ## Implementation Notes * **Immutable payload**: The stored payload reflects the results at the time the search was originally run. Re-fetching does not re-execute the query, so it will not reflect any new matches that have entered the dataset since. * **Organization scoping**: A search is only accessible to the organization that created it. Cross-org access returns `404`. * **Retries**: Safe to call repeatedly; the endpoint is idempotent. ## Related Endpoints * [Person Search](/api-reference/person-search) - Create a new person search * [Person Search Usage](/api-reference/person-search-usage) - Daily delivery limits and consumption history * [Contact Append](/api-reference/person-search-contact-append) - Async ABM contact jobs * [Enrich v2](/api-reference/enrich-v2) - Fetch full profile data for the Minerva PIDs returned here # Async Person Search Results Source: https://docs.minerva.io/api-reference/person-search-job-results GET https://api.minerva.io/person-search/v0/search-jobs/{segment_id}/results Page the matching PIDs from a completed full person search Returns a page of PIDs from a search submitted with `materialization_extent: "full"` once its status is `completed`. PID retrieval does not consume record capacity. Use [Enrich v2](/api-reference/enrich-v2) to retrieve full profiles; record capacity is consumed on delivery. ```bash theme={null} curl --url 'https://api.minerva.io/person-search/v0/search-jobs/8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77/results?limit=100&offset=0' \ --header 'x-api-key: ' ``` **x-api-key** `string` *required* API key for the organization that submitted the search. **segment\_id** `string` *required* UUID returned when submitting the search. **limit** `integer` (default: 100) PIDs per page, from `1` to `100`. **offset** `integer` (default: 0) Number of PIDs to skip; must be zero or greater. ## Response ```json theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "pids": ["pid_1", "pid_2"], "total": 1250, "returned": 2, "limit": 2, "offset": 0 } ``` `total` is the full result count; `returned` is the number of PIDs in this page. Increase `offset` by `returned` until `offset + returned >= total`. An offset at or beyond the end returns an empty page. ## Errors | Status | Meaning | | - | - | | `401` | Missing or invalid credentials | | `403` | Organization lacks API access | | `404` | Search does not exist or belongs to another organization | | `409` | Full search results are not ready, including preview-only jobs | | `422` | Invalid segment ID or pagination parameters | | `503` | Search service unavailable | See the [complete flow](/api-reference/person-search-async). # Async Person Search Status Source: https://docs.minerva.io/api-reference/person-search-job-status GET https://api.minerva.io/person-search/v0/search-jobs/{segment_id} Poll search progress, audience size, and statistics Poll every 2–5 seconds until the search reaches a terminal status. Once a full search is `completed`, [page its PIDs](/api-reference/person-search-job-results). Polling and PID retrieval do not consume record capacity. ### Status values | Status | Meaning | | - | - | | `created` | Accepted and waiting to begin | | `initiated` | Processing has started | | `parsing_search` | The natural-language query is being parsed | | `building_query` | Structured search filters are being compiled | | `counting` | Computing the exact audience count | | `computing_stats` | Computing demographics and contact coverage; a preview count may already be available | | `materializing` | Collecting and staging matching audience members | | `exporting` | Writing audience result files | | `finalizing` | Persisting the completed result | | `querying` | Processing; a more specific worker phase is unavailable | | `completed` | Requested preview or full materialization is complete | | `failed` | Terminal processing failure | | `cancelled` | Processing was cancelled | | `previewed` | Preview materialization is complete | Preview jobs can return `completed`. Use `materialization_extent` to distinguish `preview` from `full`; status alone does not indicate that full PID results are available. ### Progressive preview results Submit once and poll the same job ID. For third-party previews that execute as one Elasticsearch query, `total_count` becomes available before demographic statistics finish. Use `total_count !== null` to display the audience size; `0` means the completed count found no matches. Continue polling for `stats` and terminal status. ```json Count available; demographics still running theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "status": "computing_stats", "materialization_extent": "preview", "created_at": "2026-10-15T17:00:00Z", "total_count": 12843, "stats": null } ``` `total_count` is exact for the count query, not a threshold or sampled estimate. Demographic statistics retain their existing sampling behavior for large audiences. If a later step fails, the count remains available alongside `status: "failed"`; a count alone does not mean the preview completed. Statuses reflect observed worker progress, so fast stages may be skipped between polls. Terminal status takes precedence over delayed worker updates. Clients should continue polling for any nonterminal status, including new processing stages. Full jobs and previews requiring other execution paths may only provide their count when processing completes. ```bash Poll status theme={null} curl --request GET \ --url 'https://api.minerva.io/person-search/v0/search-jobs/8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* An API key for the organization that submitted the search. ### Path Parameters **segment\_id** `string` *required* UUID returned by [Async Person Search](/api-reference/person-search-job-submit). ## Response ### Success Response (`200 OK`) **segment\_id** `string` Async search and segment UUID. **status** `string` Current processing status. **error** `object` Terminal failure details for `failed` or `cancelled` jobs. `null` for every other status. **error.code** `string` Stable machine-readable failure category: `search_criteria_failed`, `search_processing_failed`, `search_timed_out`, `search_worker_lost`, or `search_cancelled`. **error.message** `string` Caller-safe explanation and, when available, a suggested replacement search. **error.retryable** `boolean` Always `false`. Failed and cancelled jobs are terminal; submit a new or revised search to continue. **materialization\_extent** `string` Effective materialization mode applied to this job: `preview` or `full`. Results are available when this is `full` and status is `completed`. **created\_at** `string` ISO-8601 submission timestamp. **updated\_at** `string` ISO-8601 timestamp of the latest status update, when available. **full\_criteria\_tree** `object` Parsed criteria tree used to build the segment, when available. **error\_criteria** `object[]` Criteria that could not be processed, when applicable. **suggested\_search** `string` Suggested alternative query when the original search cannot be resolved. **total\_count** `integer` Exact audience match count, available before demographics finish for supported third-party previews. `null` until available; retained if a later step fails. **stats** `object` Compact contact coverage and demographic distributions for the preview or completed segment. `null` while the job is still processing or when it fails. ### Completed-job statistics Every distribution bucket uses `{ label, count, percentage }`. Percentages use `total_count` as the denominator and are rounded to two decimal places. * `age` returns individual ages in ascending numeric order. Labels are integer ages encoded as strings, such as `"31"`, rather than age bands. Unknown ages are omitted; percentages still use the full audience as the denominator. * `gender` uses `Female`, `Male`, and `Unknown`. * `home_ownership` uses `Owned`, `Rented`, and `Unknown`. * `job_title` is a high-cardinality dimension. It returns only the ten most frequent standardized current titles; remaining titles are intentionally omitted and are not combined into an `Other` bucket. * `current_address_state` returns every available state bucket without combining smaller states into an `Other` bucket. States are ordered by count, highest first, then by label for equal counts. ```json 200 — completed preview theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "status": "completed", "error": null, "materialization_extent": "preview", "created_at": "2026-07-21T20:00:00.000000Z", "updated_at": "2026-07-21T20:01:36.000000Z", "full_criteria_tree": { "node_type": "CRITERIA", "criteria": "Software engineers in Austin", "node_status": "FULL" }, "error_criteria": null, "suggested_search": null, "total_count": 1284, "stats": { "coverage": { "email": { "count": 1012, "percentage": 78.82 }, "phone": { "count": 744, "percentage": 57.94 }, "address": { "count": 1198, "percentage": 93.3 } }, "distributions": { "age": [ { "label": "31", "count": 410, "percentage": 31.93 } ], "gender": [ { "label": "Female", "count": 604, "percentage": 47.04 } ], "education_level": [], "job_title": [], "home_ownership": [], "income": [], "wealth": [], "current_address_state": [] } } } ``` ```json 200 — failed criteria theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "status": "failed", "error": { "code": "search_criteria_failed", "message": "Person Search could not resolve the audience using supported criteria. Suggested search: Aerospace executives in the United States", "retryable": false }, "materialization_extent": "preview", "created_at": "2026-07-21T20:00:00.000000Z", "updated_at": "2026-07-21T20:01:36.000000Z", "full_criteria_tree": null, "error_criteria": [ { "criteria": "People who own a moon base" } ], "suggested_search": "Aerospace executives in the United States", "total_count": null, "stats": null } ``` ## Errors | Status | When | | - | - | | `401` | Missing or invalid credentials | | `404` | Unknown `segment_id`, deleted segment, or segment belongs to another organization | | `422` | `segment_id` is not a valid UUID | | `503` | The segment status service is temporarily unavailable | ## Related * [Async Person Search walkthrough](/api-reference/person-search-async) * [Async Person Search](/api-reference/person-search-job-submit) * [Async Person Search Results](/api-reference/person-search-job-results) ## Processing deadlines Processing limits depend on the deployed worker configuration. The legacy Lambda worker has a four-minute processing budget, excluding queue wait and startup. When that budget is exhausted, polling returns `failed` with `error.code: "search_timed_out"`. When Temporal workers are enabled for the async API, full materializations may run longer than five minutes. Worker failure or an execution timeout is persisted as `failed` with `error.code: "search_worker_lost"`. Failure reporting can be delayed while the status service is unavailable. `querying` and `updated_at` do not establish worker liveness: `updated_at` is a stored segment update timestamp, not a heartbeat. Stop polling on terminal statuses. If your own polling timeout expires, you can resume polling the same job later. For very large audiences, narrow the criteria or use `materialization_extent: "preview"` when you only need counts and statistics. ### Async API worker liveness Jobs submitted through the async API may include an optional `worker` object with `status` (`queued`, `running`, or `finished`) and `heartbeat_at` (an ISO 8601 timestamp or `null`). This reports worker liveness, not a completion estimate. Continue to use the job's top-level terminal status and `error` to determine success or failure. A stale heartbeat alone does not prove failure. Full materializations may take longer than five minutes. # Async Person Search Source: https://docs.minerva.io/api-reference/person-search-job-submit POST https://api.minerva.io/person-search/v0/search-jobs Submit a natural-language person search for preview or full asynchronous materialization ## Overview Async Person Search builds a segment from a natural-language audience description. The submission returns immediately with `202 Accepted`, and processing continues in the background. It defaults to a fast preview that computes the match count, statistics, and a bounded internal preview. Set `materialization_extent` to `full` to persist every matching PID for pagination. This page documents step 1 of the flow in isolation. For the whole flow with worked examples, see the [Async Person Search walkthrough](/api-reference/person-search-async). > [!NOTE] > > Unlike synchronous [Person Search](/api-reference/person-search), the submit > response does not contain PIDs. Preview jobs do not expose PIDs through the > public results endpoint. Full jobs return PIDs through GET results once processing completes. ## Authentication requirement The API key must belong to the organization creating the search and have access to Person Search. ```bash Submit a search theme={null} curl --request POST \ --url 'https://api.minerva.io/person-search/v0/search-jobs' \ --header 'x-api-key: ' \ --header 'Content-Type: application/json' \ --data '{ "query": "Software engineers in Austin who previously worked at a public technology company" }' ``` ## Request ### Headers **x-api-key** `string` *required* An API key authorized to use Person Search for the organization. **Content-Type** `string` *required* `application/json` ### Request Body **query** `string` *required* Natural-language audience description. Must contain between `1` and `500` characters. **materialization\_extent** `string` (default: preview) `preview` computes the match count and statistics without persisting every matching PID. `full` materializes every PID so the results endpoint can page them. ## Response ### Success Response (`202 Accepted`) **segment\_id** `string` UUID identifying both the async search job and its segment-backed search. **status** `string` Initial job status. Normally `created`. **created\_at** `string` ISO-8601 submission timestamp. **materialization\_extent** `string` Effective materialization mode applied to the job: `preview` or `full`. ```json 202 theme={null} { "segment_id": "8c2a6f71-3d41-4fc5-a2b6-1f53a5c81d77", "status": "created", "created_at": "2026-07-21T20:00:00.000000Z", "materialization_extent": "preview" } ``` ## Errors | Status | When | | - | - | | `401` | Missing or invalid credentials | | `403` | The authenticated principal or billing tier cannot use this route | | `422` | `query` or `materialization_extent` is invalid | | `429` | Request-rate or plan quota exceeded | | `503` | The segment materialization service is temporarily unavailable | ## Related * [Async Person Search walkthrough](/api-reference/person-search-async) * [Async Person Search Status](/api-reference/person-search-job-status) * [Async Person Search Results](/api-reference/person-search-job-results) * [Synchronous Person Search](/api-reference/person-search) # Person Search Usage Source: https://docs.minerva.io/api-reference/person-search-usage GET https://api.minerva.io/person-search/v0/usage Retrieve your organization's daily person-search delivery limits, current-day consumption, and recent per-day history ## Quick Answer **How do I see my person-search usage?** Use this endpoint to check your organization's daily record-delivery limit, how many records you've already been charged for today, how much of the daily budget is remaining, and a per-day history of search activity. **Common questions this endpoint answers:** * What's my daily person-search record limit? * How many records have I been delivered today? * How much quota do I have left for today? * How many searches did we run per day over the last month? * How many natural-language parse requests did we consume per day? **What you get back:** The org's `daily_record_limit`, records delivered today, remaining budget today, and a per-UTC-day `history` array with delivered record counts, searches created, and parse requests. ## Overview The Person Search Usage endpoint returns quota and consumption metrics scoped to the organization associated with your API key. Use it to: * Check today's remaining record budget before issuing additional searches * Power a usage dashboard or chart day-over-day trends * Reconcile internal billing records against delivered record counts Each row of `history` represents a single UTC calendar day, with counts for: * `records_delivered` - PIDs delivered in search responses * `searches_created` - number of `POST /person-search/v0/search` calls that produced a stored search * `parse_requests` - natural-language query parses performed for searches ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/person-search/v0/usage?days=30' \ --header 'x-api-key: ' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. ### Query Parameters **days** `integer` (default: 30) Number of UTC calendar days of history to include, counting back from today (inclusive). Must be between `1` and `90`. Defaults to `30`. ### Request Notes * There is no request body. * The date range is always anchored to today (UTC) and cannot be customized beyond `days`. ## Response ### Success Response **org\_id** `string` UUID of the organization associated with your API key. **daily\_record\_limit** `integer` Maximum number of person records that can be delivered per UTC day for your organization. **current\_day\_records\_delivered** `integer` Records delivered so far today (UTC day). Counts toward `daily_record_limit`. **current\_day\_remaining** `integer` Remaining record budget for today, computed as `max(0, daily_record_limit - current_day_records_delivered)`. **history** `array` Array of `DailyUsage` objects, one per UTC calendar day in the requested window. See [Daily usage object](#daily-usage-object) below. ### Daily usage object **period\_start** `string` UTC calendar date for this row, in `YYYY-MM-DD` format. **records\_delivered** `integer` Number of person records delivered by the person search API on that day. **searches\_created** `integer` Number of `POST /person-search/v0/search` calls that produced a stored search on that day. **parse\_requests** `integer` Natural-language query parse requests processed on that day. ```json 200 theme={null} { "org_id": "8e3c4b7a-2d31-4f48-9b5a-1c2d3e4f5a6b", "daily_record_limit": 1000000, "current_day_records_delivered": 12840, "current_day_remaining": 987160, "history": [ { "period_start": "2026-04-24", "records_delivered": 12840, "searches_created": 9, "parse_requests": 11 }, { "period_start": "2026-04-23", "records_delivered": 45210, "searches_created": 22, "parse_requests": 27 }, { "period_start": "2026-04-22", "records_delivered": 0, "searches_created": 0, "parse_requests": 0 } ] } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 403 theme={null} { "code": "forbidden", "message": "Not authorized for this route or plan", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 422 theme={null} { "code": "validation_error", "message": "Invalid request data", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012", "details": [ { "loc": ["days"], "type": "less_than_equal" } ] } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ## Behavior Notes * Results are scoped to the organization associated with your API key. * All dates and day boundaries are in **UTC**. * `current_day_records_delivered` is the same value that appears in the `history` row whose `period_start` equals today's UTC date. * Days with no activity are included in `history` with zeroed counters, so the array length is always equal to the requested `days` value. * `current_day_remaining` is clamped at zero; it never goes negative even if delivery briefly exceeds the daily limit. ## Error Responses ### Common Errors * `401` - **Unauthorized**: Invalid or missing API key * `403` - **Forbidden**: The API key is valid but not authorized for this route or your plan tier * `422` - **Unprocessable Entity**: `days` is not an integer, or is outside the allowed range `1`-`90` * `429` - **Too Many Requests**: Rate limit or plan quota exceeded * `500` - **Internal Server Error**: Unexpected server error ### Error Example **Out-of-range `days`:** ```json theme={null} { "code": "validation_error", "message": "Invalid request data", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "details": [ { "loc": ["days"], "type": "less_than_equal" } ] } ``` ## Common Integration Patterns **Check remaining budget before a large search job:** ```python theme={null} usage = minerva_api.get("/person-search/v0/usage", params={"days": 1}) if usage["current_day_remaining"] < planned_record_count: raise RuntimeError("Not enough daily budget remaining for this job") ``` **Build a day-over-day consumption chart:** ```python theme={null} usage = minerva_api.get("/person-search/v0/usage", params={"days": 30}) for row in usage["history"]: print(row["period_start"], row["records_delivered"]) ``` ## Related Endpoints * [Person Search](/api-reference/person-search) - Create a new person search * [Get Person Search](/api-reference/person-search-get) - Retrieve a previously created search by id * [Endpoint Usage](/api-reference/usage-endpoints) - Org-wide usage metrics across other Minerva endpoints # Resolve v1 Source: https://docs.minerva.io/api-reference/resolve POST https://api.minerva.io/v1/resolve **Do not use Resolve v1.** This endpoint is deprecated and remains available only for backward compatibility. Use [Resolve v2](/api-reference/resolve-v2) for all identity-resolution workflows. Migrate existing v1 integrations to v2 as soon as possible. ## Quick Answer **How do I resolve a person's identity?** Do not use Resolve v1. Use [Resolve v2](/api-reference/resolve-v2) instead. Resolve v1 is deprecated and remains available only for backward compatibility. **Common questions this endpoint answers:** * How do I match a person to get their ID? * How do I find someone's Minerva PID? * How do I identify someone from their name and email? * How can I deduplicate or match records? * How do I get a unique identifier for a contact? **What you need:** Name (first + last or full name) AND contact information (email or phone). **What you get back:** Minerva PID (unique person identifier) and match confidence score. **Required action:** Migrate existing `/v1/resolve` integrations to `/v2/resolve` as soon as possible. ## Overview The Resolve v1 endpoint matches person identity data (name, email, phone) to a unique Minerva Person ID (`minerva_pid`). This is typically the first step before enriching person data. The endpoint uses fuzzy matching to handle variations in names and contact information. This reference remains available only to support migrations from v1 to [Resolve v2](/api-reference/resolve-v2). ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `object[]` *required* An array of person records to resolve. Maximum 1000 records per request. **Record object properties** **record\_id** `string` *required* Your unique identifier for this record **first\_name** `string` Person's first name **middle\_name** `string` Person's middle name **last\_name** `string` Person's last name **full\_name** `string` Person's full name (alternative to first/last name) **name\_suffix** `string` Name suffix (e.g., "Jr.", "Sr.", "III") **emails** `string[]` Array of email addresses **phones** `string[]` Array of phone numbers ### Request Example ```json theme={null} { "records": [ { "record_id": "user_001", "first_name": "John", "last_name": "Smith", "emails": ["john.smith@example.com"], "phones": ["+1-555-123-4567"] } ] } ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of resolution results, one per input record **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object **record\_id** `string` Your identifier from the request **is\_match** `boolean` Whether a match was found in the Minerva database **minerva\_pid** `string` Minerva person identifier (only present if is\_match is true) **match\_score** `number` Confidence score for the match, as an additive point total — **not** a 0-1 or 0-100 scale. Matches score at least 50 and routinely exceed 100. `null` unless `is_match` is true. See [Interpreting `match_score`](#interpreting-match-score). **is\_resolvable\_record** `boolean` Whether the input record had sufficient valid data to attempt resolution **validation\_errors** `object` Object containing any validation errors encountered with the input data > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "req_xyz789abc", "results": [ { "record_id": "user_001", "is_match": true, "minerva_pid": "p-a1b2c3d4e5f6g7h8i9j0", "match_score": 110.0, "is_resolvable_record": true, "validation_errors": null }, { "record_id": "user_002", "is_match": false, "minerva_pid": null, "match_score": null, "is_resolvable_record": true, "validation_errors": null } ], "request_completed_at": "2025-11-12T19:19:37.061415+00:00" } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must be a JSON object", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v1/resolve endpoint is 1000", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses ### Common Errors * `400` - Bad Request: Invalid input format or missing required fields * `401` - Unauthorized: Invalid or missing API key * `413` - Payload Too Large: More than 1000 records in request * `422` - Unprocessable Entity: Invalid data format * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error: Server error occurred ## Notes ### Input Requirements * **Name**: Required - provide either (`first_name` AND `last_name`) OR `full_name` * **Contact**: Required - provide at least one `emails` or `phones` * Both name and contact information are required for V1 resolve ### Matching Quality * The matching algorithm uses fuzzy matching to handle variations in names and contact information * Providing both accurate name and contact information improves match accuracy ### Interpreting `match_score` `match_score` is an **additive point total**, not a normalized 0-1 or 0-100 confidence. It is the sum of two components: * **Name** — up to 60 points, based on how closely the input name matches the person's known names and aliases * **Contact info** — points for every input email and phone that matches the person, weighted by how strongly that email or phone is associated with them Because the contact-info component grows with each additional match, there is no upper bound: a record matched on a name plus several emails and phones commonly scores 110-130. The example above scores `110.0`. > [!NOTE] > > Compare scores against each other, not against a fixed ceiling. Thresholding > on a percentage (for example, "accept above 0.8" or "above 80%") will not > behave the way you expect. Practical guidance: * Every record returned with `is_match: true` already cleared Minerva's internal match threshold and scores **at least 50**. You don't need your own floor unless you want to be stricter than Minerva. * `match_score` is `null` when `is_match` is false. * Scores are rounded to two decimal places. ### Migration to v2 Use [Resolve v2](/api-reference/resolve-v2) for: * Reverse lookup capabilities (email or phone only, no name required) * LinkedIn URL in response * Match condition filters to ensure data availability # Resolve v2 Source: https://docs.minerva.io/api-reference/resolve-v2 POST https://api.minerva.io/v2/resolve Enhanced resolve with reverse lookup capabilities and match condition filters ## Quick Answer **How do I resolve a person's identity?** Use this endpoint to find someone's Minerva PID (person identifier) and LinkedIn URL based on their name, email, or phone number. **Common questions this endpoint answers:** * How do I match a person to get their ID? * How do I find someone's Minerva PID? * How do I look up a person by email? * How do I search for someone by phone number? * How do I get a person's LinkedIn profile? * How can I identify someone from basic contact information? * How do I deduplicate or match records to unique people? **What you need:** Name and/or contact information (email or phone). **What you get back:** Minerva PID (unique person identifier) and LinkedIn URL if available. **Use cases:** * Get a person's PID to use with other endpoints (enrich, segments) * Match email addresses or phone numbers to unique individuals * Find LinkedIn profiles for contacts * Deduplicate customer records ## Overview The V2 Resolve endpoint provides enhanced identity resolution with two powerful matching modes: traditional fuzzy matching and reverse lookup. This version improves flexibility and adds LinkedIn URL to the response. ## Key Enhancements in V2 * **Reverse Lookup**: Resolve by single email or phone without requiring a name * **LinkedIn URL**: Returns LinkedIn profile URL in addition to Minerva PID * **Match Condition Filters**: Ensure matched records have specific data fields * **Flexible Name Requirements**: Name is optional when contact information is provided * **Optional Record ID**: Record ID is now optional for V2 ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `object[]` *required* An array of person records to resolve. Maximum 1000 records per request. **Record object properties** **record\_id** `string` Your unique identifier for this record (optional in V2) **first\_name** `string` Person's first name **middle\_name** `string` Person's middle name **last\_name** `string` Person's last name **full\_name** `string` Person's full name (alternative to first/last name) **name\_suffix** `string` Name suffix (e.g., "Jr.", "Sr.", "III") **emails** `string[]` Array of email addresses **phones** `string[]` Array of phone numbers **match\_condition\_fields** `string[]` **New in V2**: Optional list of fields that must be present in the matched record for it to be returned as a match. This filters results to only include matches that have these data fields available. Valid options: `minerva_pid`, `linkedin_url` Example: `["linkedin_url"]` will only return matches that have a LinkedIn profile Example: `["minerva_pid", "linkedin_url"]` will only return matches that have both ### Request Examples #### Standard Fuzzy Matching ```json theme={null} { "records": [ { "record_id": "user_001", "first_name": "John", "last_name": "Smith", "emails": ["john.smith@example.com"], "phones": ["+1-555-123-4567"] } ] } ``` #### Reverse Lookup (Email Only, No Name) ```json theme={null} { "records": [ { "record_id": "user_002", "emails": ["jane.doe@example.com"] } ] } ``` #### Reverse Lookup (Phone Only, No Name) ```json theme={null} { "records": [ { "record_id": "user_003", "phones": ["+1-555-987-6543"] } ] } ``` #### With Match Condition Filter ```json theme={null} { "records": [ { "first_name": "Jane", "last_name": "Doe", "emails": ["jane.doe@example.com"] } ], "match_condition_fields": ["linkedin_url"] } ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of resolution results, one per input record **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object **record\_id** `string` Your identifier from the request (may be null if not provided) **is\_match** `boolean` Whether a match was found in the Minerva database **minerva\_pid** `string` Minerva person identifier (only present if is\_match is true) **linkedin\_url** `string` **New in V2**: LinkedIn profile URL (only present if is\_match is true and LinkedIn data is available) **match\_score** `number` Confidence score for the match, as an additive point total — **not** a 0-1 or 0-100 scale. Fuzzy matches score at least 50 and routinely exceed 100; reverse lookups are fixed at `50.0`. `null` unless `is_match` is true. See [Interpreting `match_score`](#interpreting-match-score). **is\_resolvable\_record** `boolean` Whether the input record had sufficient valid data to attempt resolution **validation\_errors** `object` Object containing any validation errors encountered with the input data > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "req_abc123xyz", "results": [ { "record_id": "user_001", "is_match": true, "minerva_pid": "p-a1b2c3d4e5f6g7h8i9j0", "linkedin_url": "https://www.linkedin.com/in/johnsmith", "match_score": 110.0, "is_resolvable_record": true, "validation_errors": {} }, { "record_id": "user_002", "is_match": true, "minerva_pid": "p-b2c3d4e5f6a7b8c9d0e1", "linkedin_url": "https://www.linkedin.com/in/janedoe", "match_score": 50.0, "is_resolvable_record": true, "validation_errors": {} }, { "record_id": "user_003", "is_match": false, "minerva_pid": null, "linkedin_url": null, "match_score": null, "is_resolvable_record": true, "validation_errors": {} } ], "request_completed_at": "2025-11-12T19:19:25.679685+00:00" } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "8931445e-91f1-42c6-a53d-7381de862dc8" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "c1d2e3f4-a5b6-7890-cdef-1234567890ab" } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v2/resolve endpoint is 1000", "api_request_id": "e5f6a7b8-c9d0-1234-ef56-7890abcdef01" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must be a JSON object", "api_request_id": "f6a7b8c9-d0e1-2345-f678-90abcdef0123" } ``` ## Error Responses ### Common Errors * `400` - Bad Request: Invalid input format or missing required fields * `401` - Unauthorized: Invalid or missing API key * `413` - Payload Too Large: More than 1000 records in request * `422` - Unprocessable Entity: Invalid data format or invalid `match_condition_fields` * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error: Server error occurred ## Notes ### Matching Modes V2 supports two distinct matching modes: #### 1. Fuzzy Matching Mode * Provide name information (first/last OR full\_name) and/or contact information (emails/phones) * At least one of name or contact info must be provided * Uses advanced fuzzy matching algorithm * Returns an additive `match_score` — at least 50, and often above 100 #### 2. Reverse Lookup Mode * **Activated when**: No name provided AND exactly one email OR exactly one phone * Performs direct lookup in unique matching database * Faster than fuzzy matching * Returns match score of 50.0 for reverse lookup matches * Does not support multiple emails or phones simultaneously ### Input Requirements **For Fuzzy Matching:** * Provide either name OR contact information (or both) * If providing name, must include both first\_name and last\_name (or full\_name) * Can provide multiple emails and/or phones **For Reverse Lookup:** * Provide exactly ONE email OR exactly ONE phone * Do NOT provide name information * Cannot provide both email and phone ### Match Condition Fields Use `match_condition_fields` to filter results based on data availability: * `minerva_pid` - Only return matches where we have a Minerva PID * `linkedin_url` - Only return matches where we have LinkedIn profile data This is useful when you need to ensure the matched person has specific data fields available before considering them a valid match. ### Response Fields * `record_id` is optional in requests and may be null in responses * `linkedin_url` is new in V2 and only returned when available ### Interpreting `match_score` `match_score` is an **additive point total**, not a normalized 0-1 or 0-100 confidence. For a fuzzy match it is the sum of two components: * **Name** — up to 60 points, based on how closely the input name matches the person's known names and aliases * **Contact info** — points for every input email and phone that matches the person, weighted by how strongly that email or phone is associated with them Because the contact-info component grows with each additional match, there is no upper bound: a record matched on a name plus several emails and phones commonly scores 110-130. Every fuzzy match returned with `is_match: true` has already cleared Minerva's internal threshold and scores at least 50. > [!NOTE] > > Compare scores against each other, not against a fixed ceiling. Thresholding > on a percentage (for example, "accept above 0.8" or "above 80%") will not > behave the way you expect. Reverse lookups don't run the scoring algorithm at all — they match a single email or phone directly — so they return a fixed `50.0`. That value carries no information about match quality, and comparing it against a fuzzy score is meaningless. `match_score` is `null` when `is_match` is false, and scores are rounded to two decimal places. If you need stricter results, prefer `match_condition_fields` over a score threshold: it filters on which data is actually populated, which is both verifiable and stable across matching modes. ### Validation * Phone numbers must be valid US phone numbers * Email addresses must be valid email format * Names must have at least first and last name components * Records that fail validation will have `is_resolvable_record: false` and details in `validation_errors` ## Timeouts A timed-out request returns HTTP `504` with `code: "dependency_timeout"` and an `api_request_id` for support. Retry after a short delay. A request timeout does not imply a missing match. ## Migration from V1 If you're upgrading from V1: 1. URL changes from `/v1/resolve` to `/v2/resolve` 2. `record_id` is now optional (was required in V1) 3. Name is now optional if you provide contact information 4. New `linkedin_url` field in response 5. Use reverse lookup for faster email/phone-only matching 6. Use `match_condition_fields` to filter results by data availability 7. Match scores may differ slightly due to improved algorithm # Segments - Create Source: https://docs.minerva.io/api-reference/segments-create POST https://api.minerva.io/v2/segments/create Create a named segment to organize and track cohorts of people for analysis and signal monitoring ## Quick Answer **How do I create a segment?** Use this endpoint to create a named segment (a custom list or group) that you can populate with people and reference later for analysis, monitoring, or exports. **Common questions this endpoint answers:** * How do I create a custom segment? * How do I make a list of people I can track? * How do I create a group or cohort for monitoring? * How do I organize contacts into segments? * How do I set up a watchlist? * How can I create a segment I can add members to later? **Simple workflow:** 1. Use this endpoint to create a segment with a name 2. You'll get back a `segment_id` 3. Use `/v2/segments/members/add` to add people to it 4. Reference the segment for monitoring, exports, or analysis **What segments are useful for:** * Tracking high-value prospects or customers * Monitoring groups for lifecycle changes (death, job change, relocation) * Organizing contacts by geography, industry, or characteristics * Creating watchlists for compliance or fraud prevention ## Overview Segments are named collections of people that enable you to organize, monitor, and analyze specific cohorts within your data. The Segments Create endpoint initializes a new empty segment with a unique identifier that can be populated using the segments/members/add endpoint. **Common Use Cases:** * Track high-value prospect lists for sales campaigns * Monitor customer cohorts for lifecycle signals (deaths, job changes, relocations) * Organize contacts by geography, industry, or behavioral attributes * Create watchlists for compliance and fraud prevention purposes Once created, segments can be populated with Minerva PIDs obtained from resolve or enrich API calls. The segment system automatically tracks membership history, current size, and provides real-time signal detection for segment members. ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body The request body must be a JSON object with the following fields: **name** `string` *required* The name of the segment. Must be unique within your organization. This is the primary identifier you'll use to reference the segment. **description** `string` Optional description of the segment's purpose, selection criteria, or business context. Useful for documenting segment composition and intent. ### Request Example ```json theme={null} { "name": "Q1 2024 Enterprise Prospects", "description": "High-value enterprise leads from Q1 outbound campaign, companies with 500+ employees in tech sector" } ``` ## Response ### Success Response The API returns a JSON object containing the newly created segment's identifier along with request metadata. **api\_request\_id** `string` Unique identifier for this API request, useful for debugging and request tracking **segment\_id** `string` UUID of the newly created segment. Store this ID to add members, retrieve members, and access signals for this segment. **request\_completed\_at** `string` ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS.ffffffZ format) indicating when the segment was created > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 theme={null} { "api_request_id": "req_seg123", "segment_id": "550e8400-e29b-41d4-a716-446655440000", "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'name' field", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'name' field", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses The API returns standard HTTP status codes with detailed error messages: * `400` - **Bad Request**: Request body is not valid JSON or invalid data types * `401` - **Unauthorized**: Invalid or missing API key in x-api-key header * `422` - **Unprocessable Entity**: Missing required `name` field * `429` - **Too Many Requests**: Rate limit exceeded * `500` - **Internal Server Error**: Unexpected server error occurred ### Error Examples **Duplicate segment name:** ```json theme={null} { "code": "conflict", "message": "Segment name Q1 2024 Enterprise Leads already exists" } ``` **Missing required field:** ```json theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'name' field" } ``` **Invalid API version:** ```json theme={null} { "code": "bad_request", "message": "Segments create endpoint only supports v2 API version" } ``` ## Implementation Notes * **API Version**: This endpoint only supports v2. Using `/v1/segments/create` will return a 404 error. * **HTTP Method**: Only POST requests are accepted. GET, PUT, DELETE, and PATCH requests will return a 405 error. * **Uniqueness**: Segment names must be unique within your organization. Attempting to create a duplicate name returns a 409 conflict error. * **Initial State**: Newly created segments start empty (`current_size: 0`) with no members. * **Storage**: The `segment_id` is persisted and should be stored in your system for future operations. * **Source Attribution**: Segments created via API are automatically tagged with `source: "api"` for tracking purposes. ## Next Steps After creating a segment, you'll typically want to: 1. **Add members** using the `/v2/segments/members/add` endpoint with Minerva PIDs 2. **Monitor signals** using endpoints like `/v2/segments/signals/deaths` to track lifecycle events 3. **Retrieve members** using `/v2/segments/members` to export or process the segment 4. **Track size** by checking the `current_size` field in the segment metadata ## Related Endpoints * [Add Members to Segment](/api-reference/segments-members-add) - Populate the segment with Minerva PIDs * [Get Segment Members](/api-reference/segments-members) - Retrieve all members with pagination * [Death Signals](/api-reference/segments-signals-deaths) - Monitor death events for segment members * [Remove Members](/api-reference/segments-members-remove) - Remove specific PIDs from the segment # Segments - Members Source: https://docs.minerva.io/api-reference/segments-members GET https://api.minerva.io/v2/segments/members Retrieve all members of a segment with pagination support ## Quick Answer **How do I get the members of a segment?** Use this endpoint to retrieve the list of people in a segment, including their Minerva PIDs and when they were added. **Common questions this endpoint answers:** * How do I get all members in a segment? * How do I export a segment's member list? * How do I see who's in my segment? * How can I retrieve the people I added to a segment? * How do I list all contacts in a group? * How can I paginate through a large segment? **What you get back:** List of Minerva PIDs with timestamps showing when each person was added to the segment. Results are paginated with 5,000 members per page. **Common use cases:** * Export segment membership for reporting or processing * Sync segment data to CRM or marketing platforms * Feed PIDs into enrichment or other workflows * Audit segment composition ## Overview The Segments Members endpoint retrieves the complete list of people in a segment with their membership metadata. Results are paginated with a fixed page size of 5,000 members per page, making it efficient to export large segments or process members in batches. **What You Get:** * Complete list of Minerva PIDs for all segment members * `first_added_at` timestamp showing when each person initially joined the segment * Pagination metadata to traverse large segments * Total member count across all pages ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/v2/segments/members?segment_id=YOUR_SEGMENT_ID' \ --header 'x-api-key: ' ``` ### Headers **x-api-key** `string` *required* Your API key for authentication ### Query Parameters **segment\_id** `string` *required* The UUID of the segment to retrieve members from (obtained from the segments/create endpoint). The segment must exist and belong to your organization. **page** `integer` Page number for pagination, starting from 1 (not 0). Default is 1 if not specified. Each page returns up to 5,000 members (fixed limit). ### Request Example ```bash theme={null} # Get first page of members (PIDs 1-5000) GET /v2/segments/members?segment_id=550e8400-e29b-41d4-a716-446655440000&page=1 # Get second page of members (PIDs 5001-10000) GET /v2/segments/members?segment_id=550e8400-e29b-41d4-a716-446655440000&page=2 # Page parameter defaults to 1 if omitted GET /v2/segments/members?segment_id=550e8400-e29b-41d4-a716-446655440000 ``` ## Response ### Success Response The API returns a paginated list of segment members with metadata. **api\_request\_id** `string` Unique identifier for this API request, useful for debugging and support **results** `object` Paginated results object containing the member list and pagination metadata **request\_completed\_at** `string` ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS.ffffffZ format) when the request completed #### Results Object Structure **items** `array` Array of member objects for the current page. Maximum 5,000 items per page. Empty array if the segment has no members or you've requested a page beyond the last one. **total\_count** `integer` Total number of members in the segment across all pages. This is the segment's `current_size` and represents the complete membership count. **page** `integer` The current page number being returned (1-indexed). Matches the `page` query parameter you provided. **list\_continues** `boolean` Indicates whether more pages exist. `true` means you should request the next page to get additional members. `false` means this is the last page (or the only page). #### Member Object Structure Each item in the `items` array contains: **minerva\_pid** `string` The Minerva person identifier for this segment member, in the format "p-". Use this PID to enrich the person, retrieve their data, or remove them from the segment. **first\_added\_at** `string` ISO 8601 timestamp showing when this person was first added to the segment. This timestamp is preserved even if the person is removed and re-added later, providing historical continuity. ```json 200 theme={null} { "api_request_id": "req_members456", "results": { "items": [ { "minerva_pid": "p-a1b2c3d4e5f6", "first_added_at": "2024-01-10T14:30:00.000000Z" }, { "minerva_pid": "p-x9y8z7w6v5u4", "first_added_at": "2024-01-11T09:15:00.000000Z" }, { "minerva_pid": "p-m5n6o7p8q9r0", "first_added_at": "2024-01-12T16:45:00.000000Z" } ], "total_count": 12500, "page": 1, "list_continues": true }, "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` **Interpreting the Example:** * **Page 1 of 3** (12,500 total members ÷ 5,000 per page = 3 pages) * **3 members shown** (truncated for readability; actual response would have up to 5,000) * **`list_continues: true`** indicates more pages exist (pages 2 and 3) * Members are ordered by `first_added_at` descending (most recent additions first) **Empty Segment Response:** ```json theme={null} { "api_request_id": "req_members457", "results": { "items": [], "total_count": 0, "page": 1, "list_continues": false }, "request_completed_at": "2024-01-15T10:31:22.456789Z" } ``` **Last Page Response:** ```json theme={null} { "api_request_id": "req_members458", "results": { "items": [ { "minerva_pid": "p-final123", "first_added_at": "2024-01-08T12:00:00.000000Z" } ], "total_count": 10001, "page": 3, "list_continues": false }, "request_completed_at": "2024-01-15T10:32:15.789012Z" } ``` * Page 3 contains only 1 member (10,001 total = 5,000 + 5,000 + 1) * `list_continues: false` indicates this is the final page > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 400 theme={null} { "code": "bad_request", "message": "Request must contain 'segment_id' query parameter", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 404 theme={null} { "code": "not_found", "message": "Segment abc123 does not exist", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Request must contain 'segment_id' query parameter", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Pagination Guide The endpoint uses a fixed page size of **5,000 members per page**. To retrieve all members from a large segment: **Algorithm:** 1. Start with `page=1` 2. Process the `items` in the response 3. Check the `list_continues` field 4. If `true`, increment page and repeat; if `false`, you're done **Python Example:** ```python theme={null} segment_id = "550e8400-e29b-41d4-a716-446655440000" page = 1 all_members = [] while True: response = minerva_api.get_segment_members(segment_id, page=page) members = response['results']['items'] all_members.extend(members) print(f"Retrieved page {page}: {len(members)} members") if not response['results']['list_continues']: break # Last page reached page += 1 print(f"Total members retrieved: {len(all_members)}") ``` **Pagination Calculation:** * **Total pages** = `ceil(total_count / 5000)` * **Current page range** = `[(page-1) * 5000 + 1, min(page * 5000, total_count)]` * **More pages exist** = `page * 5000 < total_count` ## Error Responses The API returns standard HTTP status codes with descriptive error messages: * `400` - **Bad Request**: Missing `segment_id` query parameter * `401` - **Unauthorized**: Invalid or missing API key in x-api-key header * `404` - **Not Found**: Segment with the provided `segment_id` does not exist in your organization * `422` - **Unprocessable Entity**: Missing `segment_id` query parameter OR invalid `page` parameter (must be ≥ 1) * `429` - **Too Many Requests**: Rate limit exceeded * `500` - **Internal Server Error**: Unexpected server error occurred ### Error Examples **Segment not found:** ```json theme={null} { "code": "not_found", "message": "Segment 550e8400-e29b-41d4-a716-446655440000 does not exist" } ``` **Missing segment\_id:** ```json theme={null} { "code": "unprocessable_entity", "message": "Request parameters must contain a 'segment_id' field" } ``` **Invalid page number:** ```json theme={null} { "code": "unprocessable_entity", "message": "Page must be greater than or equal to 1" } ``` ## Implementation Notes * **API Version**: Only v2 is supported. Using `/v1/segments/members` returns a 404 error. * **HTTP Method**: Only GET requests are accepted. * **Page Size**: Fixed at 5,000 members per page. This cannot be customized. * **Page Indexing**: Pages are 1-indexed (first page is `page=1`, not `page=0`). * **Ordering**: Members are sorted by `first_added_at` in descending order (most recent additions first). * **Historical Timestamps**: The `first_added_at` timestamp is preserved across remove/re-add cycles, maintaining historical accuracy. * **Empty Segments**: If a segment has no members, you'll get `items: []`, `total_count: 0`, and `list_continues: false`. * **Out-of-Range Pages**: Requesting a page beyond the last page returns empty `items` with `list_continues: false`. ## Performance Characteristics * **Response Time**: Typically 100-300ms per page * **Consistency**: The `total_count` is computed from the segment metadata table (`current_size` field), so it's always accurate * **Concurrency**: Safe to paginate while other operations (add/remove members) are happening; you might see slightly inconsistent results across pages if the segment is being modified during pagination * **Rate Limiting**: Standard API rate limits apply ## Common Integration Patterns **Pattern 1: Export to CSV** ```python theme={null} import csv segment_id = "550e8400-e29b-41d4-a716-446655440000" with open('segment_export.csv', 'w', newline='') as csvfile: writer = csv.writer(csvfile) writer.writerow(['minerva_pid', 'first_added_at']) page = 1 while True: response = minerva_api.get_segment_members(segment_id, page=page) for member in response['results']['items']: writer.writerow([member['minerva_pid'], member['first_added_at']]) if not response['results']['list_continues']: break page += 1 ``` ## Related Endpoints * [Add Members](/api-reference/segments-members-add) - Add people to the segment * [Remove Members](/api-reference/segments-members-remove) - Remove people from the segment * [Enrich API](/api-reference/enrich-v2) - Get detailed data for the Minerva PIDs returned * [Death Signals](/api-reference/segments-signals-deaths) - Get death signals for segment members # Segments - Add Members Source: https://docs.minerva.io/api-reference/segments-members-add POST https://api.minerva.io/v2/segments/members/add Add one or more people to an existing segment using their Minerva PIDs ## Quick Answer **How do I add members to a segment?** Use this endpoint to add people to a custom segment. After creating a segment, you can populate it with people by providing their Minerva PIDs (person identifiers). **Common questions this endpoint answers:** * How do I add a bunch of members to a custom segment? * How do I populate a segment with people? * How do I add contacts to a segment I can reference later? * How do I build a list of people in a segment? * How do I add users to a group or cohort? **Simple workflow:** 1. Create a segment using `/v2/segments/create` 2. Get Minerva PIDs from `/v2/resolve` or `/v2/enrich` endpoints 3. Use this endpoint to add those PIDs to your segment 4. Reference the segment later for analysis, monitoring, or exports ## Overview The Segments Add Members endpoint populates a segment with people identified by their Minerva PIDs. This is the primary method for building segment membership after creating a segment. **How It Works:** 1. Provide a `segment_id` (from the create endpoint) and an array of `minerva_pids` (from resolve/enrich calls) 2. The API validates each PID against the Minerva database 3. New members are added; existing members are tracked but not duplicated 4. The segment's `current_size` is automatically updated 5. Membership timestamps (`first_added_at`, `last_added_at`) are maintained for each person The endpoint handles partial successes gracefully - invalid PIDs are reported but don't cause the entire operation to fail. Members can be re-added after removal; the system preserves their original `first_added_at` timestamp for historical tracking. ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body The request body must be a JSON object containing: **segment\_id** `string` *required* The UUID of the target segment (obtained from the segments/create endpoint). The segment must exist and belong to your organization. **minerva\_pids** `array` *required* Array of Minerva person identifiers (strings) to add to the segment. PIDs are obtained from the resolve or enrich endpoints and follow the format "p-". There is no strict upper limit on array size, but keep requests reasonable for performance (batches of 1,000-10,000 are typical). ### Request Example ```json theme={null} { "segment_id": "550e8400-e29b-41d4-a716-446655440000", "minerva_pids": [ "p-a1b2c3d4e5f6", "p-x9y8z7w6v5u4", "p-m5n6o7p8q9r0" ] } ``` ## Response ### Success Response The API returns a detailed breakdown of the operation, reporting successes, duplicates, and invalid PIDs. **api\_request\_id** `string` Unique identifier for this API request, useful for debugging and support **results** `object` Detailed results object containing operation statistics and invalid PIDs **request\_completed\_at** `string` ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS.ffffffZ format) when the operation completed #### Results Object Structure **invalid\_minerva\_pids** `array` Array of Minerva PID strings that were not found in the Minerva database. These PIDs were rejected and not added to the segment. This typically indicates PIDs that don't exist, were incorrectly formatted, or came from a different data source. **n\_redundant\_additions** `integer` Count of PIDs that were already members of this segment. These PIDs were not added again (segments maintain unique membership), but their `last_added_at` timestamp was updated to reflect the re-addition attempt. **n\_added** `integer` Count of PIDs successfully added to the segment as new members. These are PIDs that were valid and not previously in the segment. **new\_current\_size** `integer` The total number of unique members in the segment after this operation completes. This reflects the segment's size including all historical members, not just those added in this request. ```json 200 theme={null} { "api_request_id": "req_add789", "results": { "invalid_minerva_pids": ["p-invalid123"], "n_redundant_additions": 1, "n_added": 2, "new_current_size": 1523 }, "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` **Interpreting the Example Response:** * **3 PIDs submitted** in the request * **1 PID invalid** (`p-invalid123` not found in database) * **1 PID redundant** (already in the segment, `last_added_at` updated) * **2 PIDs added** (new members successfully added) * **1,523 total members** now in the segment (including these 2 new additions) **Perfect Success Response** (all PIDs added, none invalid or redundant): ```json theme={null} { "api_request_id": "req_add790", "results": { "invalid_minerva_pids": [], "n_redundant_additions": 0, "n_added": 5, "new_current_size": 1528 }, "request_completed_at": "2024-01-15T10:31:12.456789Z" } ``` > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 404 theme={null} { "code": "not_found", "message": "Segment abc123 does not exist", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'segment_id' field", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses The API returns standard HTTP status codes with descriptive error messages: * `400` - **Bad Request**: Request body is not valid JSON or missing required fields * `401` - **Unauthorized**: Invalid or missing API key in x-api-key header * `404` - **Not Found**: Segment with the provided `segment_id` does not exist in your organization * `422` - **Unprocessable Entity**: Missing required fields (`segment_id` or `minerva_pids`), or `minerva_pids` is not an array * `429` - **Too Many Requests**: Rate limit exceeded * `500` - **Internal Server Error**: Unexpected server error occurred ### Error Examples **Segment not found:** ```json theme={null} { "code": "not_found", "message": "Segment 550e8400-e29b-41d4-a716-446655440000 does not exist" } ``` **Missing minerva\_pids field:** ```json theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'minerva_pids' field with a list of IDs" } ``` **Invalid data type for minerva\_pids:** ```json theme={null} { "code": "unprocessable_entity", "message": "Field 'minerva_pids' must be a list" } ``` **Missing segment\_id field:** ```json theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'segment_id' field" } ``` ## Implementation Notes * **API Version**: Only v2 is supported. Using `/v1/segments/members/add` returns a 404 error. * **HTTP Method**: Only POST requests are accepted. * **Partial Success**: Invalid PIDs are reported in `invalid_minerva_pids` but don't cause the entire operation to fail. Valid PIDs are still added. * **Idempotency**: Adding a PID already in the segment is safe and not an error. It increments `n_redundant_additions` and updates `last_added_at`, but doesn't create a duplicate entry. * **Atomicity**: The operation is atomic for valid PIDs - either all are added successfully, or none are (in case of database errors). * **Batch Size**: There's no hard limit on array size, but for optimal performance keep batches between 1,000-10,000 PIDs. * **Validation**: Each PID is validated against the Minerva database (`person_core_v1` table). PIDs not found in the database are returned as invalid. * **Timestamps**: The system maintains both `first_added_at` (initial addition) and `last_added_at` (most recent addition) for each member. ## Performance Considerations * **Throughput**: The endpoint can handle large batches efficiently due to bulk SQL operations * **Response Time**: Expect \~100-500ms for batches of 1,000 PIDs, scaling roughly linearly * **Rate Limiting**: Standard API rate limits apply (contact support for details) * **Concurrent Requests**: Multiple concurrent add operations to the same segment are safe; the database handles concurrency ## Related Endpoints * [Create Segment](/api-reference/segments-create) - Create the segment before adding members * [Get Segment Members](/api-reference/segments-members) - Retrieve current members * [Remove Members](/api-reference/segments-members-remove) - Remove specific members * [Resolve API](/api-reference/resolve-v2) - Get Minerva PIDs for people to add # Segments - Remove Members Source: https://docs.minerva.io/api-reference/segments-members-remove POST https://api.minerva.io/v2/segments/members/remove Remove one or more people from an existing segment using their Minerva PIDs ## Quick Answer **How do I remove members from a segment?** Use this endpoint to remove specific people from a segment by providing their Minerva PIDs. **Common questions this endpoint answers:** * How do I remove members from a segment? * How do I delete people from a list? * How do I clean up my segment? * How can I remove opt-outs from my segment? * How do I exclude deceased individuals from my list? * How can I remove specific contacts from a group? **Common use cases:** * Remove opt-outs for compliance * Clean lists by removing deceased individuals * Exclude converted customers from prospect segments * Manage dynamic cohorts ## Overview The Segments Remove Members endpoint allows you to remove specific people from a segment by their Minerva PIDs. This is useful for cleaning segments, removing opt-outs, excluding deceased individuals, or managing dynamic cohorts. **How It Works:** 1. Provide a `segment_id` and an array of `minerva_pids` to remove 2. The API validates each PID against the Minerva database 3. Valid PIDs that are members of the segment are removed 4. The segment's `current_size` is automatically decremented 5. PIDs not in the segment or invalid PIDs are reported but don't cause errors **Important:** Removing a member deletes their current membership record but preserves historical tracking data. If a removed member is re-added later, their original `first_added_at` timestamp is restored, maintaining historical continuity. ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body The request body must be a JSON object containing: **segment\_id** `string` *required* The UUID of the target segment (from the segments/create endpoint). The segment must exist and belong to your organization. **minerva\_pids** `array` *required* Array of Minerva person identifiers (strings) to remove from the segment. PIDs follow the format "p-". There is no strict upper limit on array size, but keep batches reasonable for performance (typically 1,000-10,000). ### Request Example ```json theme={null} { "segment_id": "550e8400-e29b-41d4-a716-446655440000", "minerva_pids": [ "p-a1b2c3d4e5f6", "p-x9y8z7w6v5u4" ] } ``` ## Response ### Success Response The API returns a detailed breakdown of the removal operation. **api\_request\_id** `string` Unique identifier for this API request, useful for debugging and support **results** `object` Detailed results object containing operation statistics and invalid PIDs **request\_completed\_at** `string` ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS.ffffffZ format) when the operation completed #### Results Object Structure **invalid\_minerva\_pids** `array` Array of Minerva PID strings that were not found in the Minerva database. These PIDs could not be processed. This typically indicates PIDs that don't exist, were incorrectly formatted, or came from a different data source. **n\_deleted** `integer` Count of PIDs successfully removed from the segment. Only counts PIDs that were actually members of the segment and were valid. PIDs not in the segment (even if valid) are not counted here. **new\_current\_size** `integer` The total number of unique members remaining in the segment after this operation completes. This reflects the segment's size after the deletions. ```json 200 theme={null} { "api_request_id": "req_remove456", "results": { "invalid_minerva_pids": [], "n_deleted": 2, "new_current_size": 1521 }, "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` **Interpreting the Example Response:** * **2 PIDs submitted** in the request * **0 PIDs invalid** (all were found in the database) * **2 PIDs deleted** (both were members of the segment and successfully removed) * **1,521 total members** remaining in the segment (down from 1,523) **Partial Removal Response** (some invalid, some not in segment): ```json theme={null} { "api_request_id": "req_remove457", "results": { "invalid_minerva_pids": ["p-invalid999"], "n_deleted": 1, "new_current_size": 1520 }, "request_completed_at": "2024-01-15T10:32:18.789012Z" } ``` In this case: * **3 PIDs submitted** * **1 PID invalid** (`p-invalid999` not in database) * **1 PID not in segment** (valid but wasn't a member - implicitly: 3 - 1 invalid - 1 deleted = 1) * **1 PID deleted** (was a member and removed) * **1,520 members remaining** > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'segment_id' field", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 404 theme={null} { "code": "not_found", "message": "Segment abc123 does not exist", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'segment_id' field", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses The API returns standard HTTP status codes with descriptive error messages: * `400` - **Bad Request**: Request body is not valid JSON or missing required fields * `401` - **Unauthorized**: Invalid or missing API key in x-api-key header * `404` - **Not Found**: Segment with the provided `segment_id` does not exist in your organization * `422` - **Unprocessable Entity**: Missing required fields (`segment_id` or `minerva_pids`), or `minerva_pids` is not an array * `429` - **Too Many Requests**: Rate limit exceeded * `500` - **Internal Server Error**: Unexpected server error occurred ### Error Examples **Segment not found:** ```json theme={null} { "code": "not_found", "message": "Segment 550e8400-e29b-41d4-a716-446655440000 does not exist" } ``` **Missing minerva\_pids field:** ```json theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'minerva_pids' field with a list of IDs" } ``` **Invalid data type for minerva\_pids:** ```json theme={null} { "code": "unprocessable_entity", "message": "Field 'minerva_pids' must be a list" } ``` **Missing segment\_id field:** ```json theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'segment_id' field" } ``` ## Implementation Notes * **API Version**: Only v2 is supported. Using `/v1/segments/members/remove` returns a 404 error. * **HTTP Method**: Only POST requests are accepted. * **Partial Success**: Invalid PIDs are reported in `invalid_minerva_pids` but don't cause the entire operation to fail. Valid PIDs are still removed. * **Idempotency**: Attempting to remove a PID not in the segment is safe and not an error - it simply won't be counted in `n_deleted`. * **Atomicity**: The operation is atomic for valid PIDs - either all are removed successfully, or none are (in case of database errors). * **Batch Size**: There's no hard limit on array size, but for optimal performance keep batches between 1,000-10,000 PIDs. * **Validation**: Each PID is validated against the Minerva database. PIDs not found in the database are returned as invalid. * **Historical Preservation**: Removing a member deletes their current membership but preserves historical tracking. If re-added, their original `first_added_at` timestamp is restored. ## Performance Considerations * **Throughput**: The endpoint handles large batches efficiently via bulk SQL operations * **Response Time**: Expect \~100-500ms for batches of 1,000 PIDs, scaling roughly linearly * **Concurrent Requests**: Multiple concurrent remove operations on the same segment are safe ## Related Endpoints * [Add Members to Segment](/api-reference/segments-members-add) - Add members back or populate initially * [Get Segment Members](/api-reference/segments-members) - View current members before removing * [Death Signals](/api-reference/segments-signals-deaths) - Identify deceased members for removal * [Create Segment](/api-reference/segments-create) - Create the segment initially # Segments - Death Signals Source: https://docs.minerva.io/api-reference/segments-signals-deaths GET https://api.minerva.io/v2/segments/signals/deaths Retrieve death records and obituary information for segment members who have deceased ## Quick Answer **How do I find deceased people in my segment?** Use this endpoint to get death records and obituary information for segment members who have passed away. **Common questions this endpoint answers:** * How do I identify deceased individuals in my segment? * How can I find people who have died? * How do I get death signals for my contacts? * How can I clean my list of deceased people? * How do I monitor for death records? * How can I suppress deceased individuals from my campaigns? **What you get back:** List of segment members with death records, including date of death, obituary links, and confidence scores. **Common use cases:** * List hygiene: Remove deceased individuals from marketing campaigns * Compliance: Honor regulations by suppressing deceased contacts * Estate services: Identify opportunities for inheritance or probate services * Fraud prevention: Flag accounts for potential identity theft ## Overview The Segments Death Signals endpoint returns obituary and death records for segment members who have passed away. This data is sourced from obituary databases and public death records, enabling you to maintain respectful, compliant, and up-to-date contact lists. **What You Get:** * Death records matched to segment members via Minerva's identity resolution * Date of death and obituary publication information * Source metadata including obituary URLs and confidence scores * First observed timestamp showing when Minerva detected the death signal The endpoint only returns members with known death signals - it does not return all members. An empty result set indicates no death records have been found for the segment, which is typical for most segments. ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/v2/segments/signals/deaths?segment_id=YOUR_SEGMENT_ID' \ --header 'x-api-key: ' ``` ### Headers **x-api-key** `string` *required* Your API key for authentication ### Query Parameters **segment\_id** `string` *required* The UUID of the segment to retrieve death signals for (obtained from the segments/create endpoint). The segment must exist and belong to your organization. ## Response ### Success Response The API returns an array of death signal records. Only segment members with known death signals are included. **api\_request\_id** `string` Unique identifier for this API request, useful for debugging and support **results** `array` Array of death signal objects. Empty array if no segment members have known death records. Each object represents a matched death record for one segment member. **request\_completed\_at** `string` ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS.ffffffZ format) when the request completed #### Death Signal Object Structure Each object in the `results` array contains: **minerva\_pid** `string` The Minerva person identifier for the deceased individual, in the format "p-". This PID can be used to remove the person from segments or enrich their full profile. **obituary\_id** `string` Unique identifier for the obituary record in Minerva's death signals database. This ID is stable and can be used for deduplication. **date\_of\_death** `string | null` Date of death in ISO 8601 date format (YYYY-MM-DD). May be `null` if the obituary doesn't specify an exact date or only provides approximate information like "early 2023". **publication\_last\_update\_date** `string | null` Date when the obituary was last updated by the publication, in ISO 8601 date format (YYYY-MM-DD). May be `null` if this information is not available from the source. **first\_observed\_at** `string | null` ISO 8601 timestamp when Minerva first detected and ingested this death signal. This represents when the signal entered Minerva's database, not the date of death. May be `null` for older records. **signal\_metadata** `object` Additional metadata object about the death signal source, verification, and context. Structure varies by data source but typically includes source type, URLs, publication names, and confidence scores. ```json 200 Response theme={null} { "api_request_id": "req_deaths123", "results": [ { "minerva_pid": "p-a1b2c3d4e5f6", "obituary_id": "obit-xyz789", "date_of_death": "2023-12-15", "publication_last_update_date": "2023-12-18", "first_observed_at": "2023-12-20T08:30:00.000000Z", "signal_metadata": { "source": "obituary_database", "obituary_url": "https://example.com/obituary/xyz789", "publication_name": "Local News", "confidence_score": 0.95 } }, { "minerva_pid": "p-m5n6o7p8q9r0", "obituary_id": "obit-abc456", "date_of_death": "2024-01-05", "publication_last_update_date": "2024-01-07", "first_observed_at": "2024-01-08T14:15:00.000000Z", "signal_metadata": { "source": "obituary_database", "obituary_url": "https://example.com/obituary/abc456", "publication_name": "Regional Observer", "confidence_score": 0.98 } } ], "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` ```json 200 - No Death Signals theme={null} { "api_request_id": "req_deaths456", "results": [], "request_completed_at": "2024-01-15T10:30:45.123456Z" } ``` > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 400 theme={null} { "code": "bad_request", "message": "Request must contain 'segment_id' query parameter", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 404 theme={null} { "code": "not_found", "message": "Segment abc123 does not exist", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-123456789012" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Request must contain 'segment_id' query parameter", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` **Interpreting the Examples:** The first response shows 2 death signals were found for 2 different segment members: * One person died on December 15, 2023 (detected December 20) * Another person died on January 5, 2024 (detected January 8) * Both have high confidence scores (0.95 and 0.98) and obituary URLs The second response (empty array) is the most common result - it indicates no death records have been matched to segment members. This is typical and expected for most segments. ## Signal Metadata Structure The `signal_metadata` object is a JSON object whose structure varies by data source. Common fields include: **source** `string` Origin of the death signal. Common values: "obituary\_database" (online obituaries), "ssdi" (Social Security Death Index), "public\_records" (government death certificates) **obituary\_url** `string` Direct URL to the obituary page, if available. Useful for manual verification or providing family contact information. **publication\_name** `string` Name of the publication or website where the obituary appeared (e.g., "Legacy.com", "Local Funeral Home", "Regional Observer") **confidence\_score** `number` Minerva's confidence score for the identity match between the obituary and the Minerva PID, on a 0-1 scale. Scores above 0.90 indicate high confidence. Lower scores may warrant manual review. **Additional Fields (Source-Dependent):** * `funeral_home`: Name of funeral home handling arrangements * `city`, `state`: Location information * `age_at_death`: Reported age at time of death * `survivors`: List of surviving family members (for estate/inheritance use cases) * `service_date`: Date of memorial or funeral service * `memorial_donation_url`: Link to charity donation page ## Error Responses The API returns standard HTTP status codes with descriptive error messages: * `400` - **Bad Request**: Missing `segment_id` query parameter * `401` - **Unauthorized**: Invalid or missing API key in x-api-key header * `404` - **Not Found**: Segment with the provided `segment_id` does not exist in your organization * `422` - **Unprocessable Entity**: Missing `segment_id` query parameter or invalid format * `429` - **Too Many Requests**: Rate limit exceeded * `500` - **Internal Server Error**: Unexpected server error occurred ### Error Examples **Segment not found:** ```json theme={null} { "code": "not_found", "message": "Segment 550e8400-e29b-41d4-a716-446655440000 does not exist" } ``` **Missing segment\_id parameter:** ```json theme={null} { "code": "unprocessable_entity", "message": "Request parameters must contain a 'segment_id' field" } ``` **Wrong API version:** ```json theme={null} { "code": "bad_request", "message": "Segments signals deaths endpoint only supports v2 API version" } ``` ## Implementation Notes * **API Version**: Only v2 is supported. Using `/v1/segments/signals/deaths` returns a 404 error. * **HTTP Method**: Only GET requests are accepted. * **No Pagination**: Results are not paginated. All death signals for the segment are returned in a single response. * **Selective Results**: Only segment members with death signals are returned. Most segments will return an empty array. * **Data Freshness**: Death signals are updated regularly as new obituary data is ingested. Expect new deaths to appear within 1-7 days of public posting. * **Null Fields**: `date_of_death`, `publication_last_update_date`, and `first_observed_at` may be `null` if information is unavailable. * **Deduplication**: Minerva deduplicates death records from multiple sources to return one signal per person in most cases. * **Performance**: Response time is typically 100-500ms regardless of segment size, as the query is optimized with database joins. ## Data Quality & Confidence **Confidence Scores:** * **0.95-1.00**: Extremely high confidence - strong identity match across multiple attributes * **0.85-0.94**: High confidence - good identity match, safe for automated suppression * **0.70-0.84**: Medium confidence - reasonable match, consider manual review * **Below 0.70**: Lower confidence - manual verification recommended before action **Best Practices:** 1. Integrate death signal checking into regular list hygiene workflows 2. Maintain audit logs of all deceased suppressions for compliance documentation 3. Train staff to handle requests from family members sensitively 4. Use this data only for suppression/compliance, not for targeting (e.g., don't target surviving family) 5. Respect obituary URLs as sensitive content - don't scrape or republish without permission ## Related Endpoints * [Remove Members](/api-reference/segments-members-remove) - Remove deceased individuals from segments * [Get Segment Members](/api-reference/segments-members) - List all members to cross-reference with death signals * [Enrich API](/api-reference/enrich-v2) - Get additional context about deceased individuals * [Create Segment](/api-reference/segments-create) - Set up segments for signal monitoring # Storage — Boto Credentials Source: https://docs.minerva.io/api-reference/storage-boto POST https://api.minerva.io/storage/boto Mint short-lived AWS credentials scoped to your org's storage area for use with boto3 / the AWS SDKs. ## Quick Answer **How do I upload or download files to/from Minerva?** Call this endpoint to receive short-lived AWS credentials scoped to your org's storage area, then use any AWS SDK (boto3, AWS CLI, etc.) to read/write objects. **Common questions this endpoint answers:** * How do I send large files into Minerva? * How do I retrieve exported / batch results? * How do I authenticate to Minerva's S3 storage? * How long are storage credentials valid? * Can I use the AWS CLI / boto3 directly? **What you need:** A valid Minerva API key (`x-api-key`). **What you get back:** Temporary AWS credentials (access key, secret, session token, expiration) plus the S3 bucket name and your org's prefix. ## Overview This endpoint mints short-lived AWS STS credentials scoped to your org's directory inside the Minerva client storage bucket. Use them with `boto3`, the AWS CLI, or any AWS SDK to upload files for processing and download exports. Each org has a dedicated bucket; credentials are additionally scoped via session policy to `{your_org}/*` only, so other orgs' data is unreachable even if a key were misused. By convention the org directory has two subfolders: * `Incoming/` — files you send in (resolve/enrich batches, segment uploads, …). * `Outgoing/` — files placed for you to read (exports, batch results, …). > [!TIP] > > The Python SDK wraps this endpoint behind `mc.storage` — `upload`, > `download`, `list`, plus bulk helpers — and handles credential > refresh automatically. See the > [Storage SDK guide](/sdk/guides/storage). The boto endpoint is > documented here for AWS-SDK / CLI integrations and other languages. ## Request ### Headers **x-api-key** `string` *required* Your Minerva API key. ### Request Body No body. Send `POST` with an empty body (or `{}`). ## Response ### Response Structure **credentials** `object` Temporary AWS credentials scoped to your org's storage area. **bucket\_info** `object` Bucket name + prefix to scope your AWS-SDK calls to. #### `credentials` **aws\_region** `string` AWS region the bucket lives in. Always `us-east-1` today. **aws\_key\_id** `string` Temporary access key ID. **aws\_secret\_access\_key** `string` Temporary secret access key. **aws\_session\_token** `string` Temporary session token. Required alongside the access key / secret for STS credentials. **aws\_session\_expiration** `string` ISO 8601 timestamp at which the credentials expire. Typically 1 hour from issue. Refresh by calling this endpoint again before expiry. #### `bucket_info` **name** `string` S3 bucket name. Pass this as the `Bucket=` parameter on boto3 calls. **prefix** `string` Your org's directory inside the bucket — every key you read or write must start with this prefix. Looks like `/`. **uri** `string` Convenience `s3://{name}/{prefix}` URI. Useful as a base for the AWS CLI (`aws s3 cp ./local.csv $URI/Incoming/local.csv`). ```json 200 Response theme={null} { "credentials": { "aws_region": "us-east-1", "aws_key_id": "ASIAIOSFODNN7EXAMPLE", "aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "aws_session_token": "FwoGZXIvYXdzEJr...truncated", "aws_session_expiration": "2026-06-29T16:30:00+00:00" }, "bucket_info": { "name": "prod-minerva-client-acme", "prefix": "acme/", "uri": "s3://prod-minerva-client-acme/acme/" } } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 403 theme={null} { "code": "forbidden", "message": "Forbidden", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 500 theme={null} { "code": "internal_error", "message": "An unknown error occurred, please contact help@minerva.io if problem persists", "api_request_id": "c3d4e5f6-a7b8-2345-cdef-012345678901" } ``` ## Error Responses * `401` — Unauthorized: invalid or missing API key. * `403` — Forbidden: API key isn't entitled to storage, or org identity couldn't be resolved. * `500` — Internal Server Error: credential provisioning failed. ## Example — boto3 ```python theme={null} import boto3 import requests resp = requests.post( "https://api.minerva.io/storage/boto", headers={"x-api-key": ""}, ).json() creds = resp["credentials"] bucket = resp["bucket_info"]["name"] prefix = resp["bucket_info"]["prefix"] s3 = boto3.client( "s3", aws_access_key_id=creds["aws_key_id"], aws_secret_access_key=creds["aws_secret_access_key"], aws_session_token=creds["aws_session_token"], region_name=creds["aws_region"], ) # Upload into your Incoming/ folder s3.upload_file("local.csv", bucket, f"{prefix}Incoming/local.csv") # List what's waiting in Outgoing/ for obj in s3.list_objects_v2(Bucket=bucket, Prefix=f"{prefix}Outgoing/").get("Contents", []): print(obj["Key"], obj["Size"]) ``` ## Example — AWS CLI Export the credentials and use the AWS CLI like normal: ```bash theme={null} RESPONSE=$(curl -s -X POST https://api.minerva.io/storage/boto \ -H "x-api-key: $MINERVA_API_KEY") export AWS_ACCESS_KEY_ID=$(echo "$RESPONSE" | jq -r '.credentials.aws_key_id') export AWS_SECRET_ACCESS_KEY=$(echo "$RESPONSE" | jq -r '.credentials.aws_secret_access_key') export AWS_SESSION_TOKEN=$(echo "$RESPONSE" | jq -r '.credentials.aws_session_token') export AWS_DEFAULT_REGION=us-east-1 URI=$(echo "$RESPONSE" | jq -r '.bucket_info.uri') aws s3 cp ./local.csv "${URI}Incoming/local.csv" aws s3 ls "${URI}Outgoing/" ``` ## Notes * **Credential lifetime**: typically 1 hour. Refresh by calling the endpoint again before `aws_session_expiration`. * **Scope**: credentials are limited to `s3:GetObject` / `s3:PutObject` / `s3:DeleteObject` on `{prefix}*` and `s3:ListBucket` filtered to that same prefix. Other prefixes and operations fail closed. * **Caching**: the Python SDK caches the credentials in-process and auto-refreshes them near expiry. If you call this endpoint directly, implement the same pattern in your own client (don't call it per request — keep a single set of creds and refresh ahead of expiry). * **Region**: bucket lives in `us-east-1` today. * **Convention**: use `Incoming/` for client-to-Minerva transfers and read from `Outgoing/` for Minerva-to-client transfers. The session policy permits writes to both, but downstream pipelines watch `Incoming/`. # Endpoint Usage Source: https://docs.minerva.io/api-reference/usage-endpoints GET https://api.minerva.io/usage Retrieve org-wide API usage metrics for the endpoints available to your organization ## Quick Answer **How do I see API usage for my organization?** Use this endpoint to retrieve org-wide usage metrics for the Minerva API endpoints your organization can access. **Common questions this endpoint answers:** * Which Minerva endpoints has my organization used? * How many requests did we make to each endpoint? * How many input records, resolvable records, and matches did each endpoint produce? * When was each endpoint last used? * How can I get usage buckets over time for reporting? **What you get back:** A list of endpoint-level usage summaries for your organization, with optional time buckets when you provide a date range. ## Overview For remaining record allowance, overage spend and current export capacity, use [Billing Usage](/api-reference/billing-usage). The Endpoint Usage endpoint returns organization-wide usage metrics for the Minerva API endpoints your organization is allowed to access. Each result is grouped by endpoint, such as `v1/resolve` or `v2/enrich`, and includes aggregate counts for: * Total requests * Total input records * Total resolvable records * Total matches * Computed match rates * Last request timestamp If you provide both `start_date` and `end_date`, the response also includes a `buckets` array for each endpoint so you can chart usage over time. ```bash Request Example theme={null} curl --request GET \ --url 'https://api.minerva.io/usage' \ --header 'x-api-key: ' \ --get \ --data-urlencode 'start_date=2026-03-01' \ --data-urlencode 'end_date=2026-03-26' \ --data-urlencode 'bucketing_size=day' \ --data-urlencode 'timezone=UTC' \ --data-urlencode 'include_unused_endpoints=false' ``` ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication. ### Query Parameters **start\_date** `string` Optional start date in `YYYY-MM-DD` format. Must be provided together with `end_date`. When both dates are present, the response includes bucketed usage data. **end\_date** `string` Optional end date in `YYYY-MM-DD` format. Must be provided together with `start_date`. The date range is inclusive in the requested timezone. **bucketing\_size** `string` Optional bucket frequency. Supported values are `hour`, `day`, `week`, `month`, `quarter`, and `year`. Defaults to `day`. **timezone** `string` Optional IANA timezone name, such as `UTC` or `America/New_York`. Defaults to `UTC`. **include\_unused\_endpoints** `boolean` Optional flag indicating whether endpoints with zero usage should be included in the response. Defaults to `false`. ### Request Notes * There is no request body. * `start_date` and `end_date` must be supplied together or omitted together. ## Response ### Success Response **api\_request\_id** `string` Unique identifier for this request, useful for support and debugging. **results** `array` Array of endpoint usage summary objects for the requester's organization. **request\_completed\_at** `string` ISO 8601 timestamp indicating when the request finished. ### Result Object **endpoint** `string` Endpoint identifier in `version/path` format, such as `v1/resolve` or `v2/enrich`. **total\_requests** `integer` Total number of API requests made to this endpoint for the selected organization and date range. **num\_input\_records** `integer` Total number of input records submitted to this endpoint. **num\_resolvable\_records** `integer` Total number of records that were considered resolvable for this endpoint. **num\_matches** `integer` Total number of matched records produced by this endpoint. **overall\_match\_rate** `number` Computed as `num_matches / num_input_records`. Returns `0.0` when no input records exist. **resolvable\_match\_rate** `number` Computed as `num_matches / num_resolvable_records`. Returns `0.0` when no resolvable records exist. **last\_requested\_at** `string` Timestamp of the most recent request for this endpoint in the selected range. Can be `null` for unused endpoints when `include_unused_endpoints=true`. **buckets** `array` Array of bucket objects when both `start_date` and `end_date` are provided. Otherwise this field is `null`. ### Bucket Object **bucket\_start** `string` Start timestamp for the bucket in the requested timezone. **total\_requests** `integer` Number of requests in this bucket. **num\_input\_records** `integer` Number of input records in this bucket. **num\_resolvable\_records** `integer` Number of resolvable records in this bucket. **num\_matches** `integer` Number of matched records in this bucket. ```json 200 theme={null} { "api_request_id": "req_usage_12345", "results": [ { "endpoint": "v1/resolve", "total_requests": 42, "num_input_records": 1200, "num_resolvable_records": 1100, "num_matches": 980, "last_requested_at": "2026-03-26T14:00:00+00:00", "buckets": [ { "bucket_start": "2026-03-24T00:00:00+00:00", "total_requests": 10, "num_input_records": 300, "num_resolvable_records": 280, "num_matches": 250 }, { "bucket_start": "2026-03-25T00:00:00+00:00", "total_requests": 12, "num_input_records": 350, "num_resolvable_records": 320, "num_matches": 285 }, { "bucket_start": "2026-03-26T00:00:00+00:00", "total_requests": 20, "num_input_records": 550, "num_resolvable_records": 500, "num_matches": 445 } ], "overall_match_rate": 0.8166666666666667, "resolvable_match_rate": 0.8909090909090909 }, { "endpoint": "v2/enrich", "total_requests": 8, "num_input_records": 150, "num_resolvable_records": 150, "num_matches": 150, "last_requested_at": "2026-03-25T09:30:00+00:00", "buckets": [ { "bucket_start": "2026-03-24T00:00:00+00:00", "total_requests": 2, "num_input_records": 40, "num_resolvable_records": 40, "num_matches": 40 }, { "bucket_start": "2026-03-25T00:00:00+00:00", "total_requests": 6, "num_input_records": 110, "num_resolvable_records": 110, "num_matches": 110 }, { "bucket_start": "2026-03-26T00:00:00+00:00", "total_requests": 0, "num_input_records": 0, "num_resolvable_records": 0, "num_matches": 0 } ], "overall_match_rate": 1.0, "resolvable_match_rate": 1.0 } ], "request_completed_at": "2026-03-26T14:05:12.123456Z" } ``` ## Behavior Notes * Results are returned at the organization level, not the individual user level. * If you omit the date range, aggregate totals are still returned, but `buckets` will be `null`. * If `include_unused_endpoints=true`, endpoints with no usage can be returned with zero counts and `last_requested_at: null`. * Results are sorted by `num_matches` in descending order. ## Error Responses ### Common Errors * `400` - Bad Request: Invalid timezone, only one of `start_date` or `end_date` was supplied, or the requester organization could not be determined * `401` - Unauthorized: Invalid or missing API key * `405` - Method Not Allowed: Using a method other than `GET` * `422` - Unprocessable Entity: Invalid query parameter type or unsupported `bucketing_size` * `500` - Internal Server Error: Unexpected server error ### Error Examples **Only one date provided:** ```json theme={null} { "code": "bad_request", "message": "Both start_date and end_date must be provided, or neither." } ``` **Invalid timezone:** ```json theme={null} { "code": "bad_request", "message": "Invalid timezone: Mars/Phobos" } ``` ## Common Integration Patterns **Pattern 1: Daily endpoint usage dashboard** ```python theme={null} response = minerva_api.get( "/usage", params={ "start_date": "2026-03-01", "end_date": "2026-03-31", "bucketing_size": "day", "timezone": "UTC" } ) for endpoint in response["results"]: print(endpoint["endpoint"], endpoint["total_requests"]) ``` **Pattern 2: Discover all available endpoints for your org** ```python theme={null} response = minerva_api.get( "/usage", params={"include_unused_endpoints": "true"} ) all_endpoints = [item["endpoint"] for item in response["results"]] ``` # Validate Emails Source: https://docs.minerva.io/api-reference/validate-emails POST https://api.minerva.io/v2/validate_emails Validate email addresses and check their presence in the Minerva database ## Quick Answer **How do I validate email addresses or check if they exist in Minerva?** Use this endpoint to check if email addresses are valid and whether they exist in the Minerva database. **Common questions this endpoint answers:** * How do I validate email addresses? * How do I check if an email exists in the Minerva database? * How can I verify email validity before enriching? * How do I see when an email was last seen? * How can I filter my email list to only Minerva-known contacts? * How do I check email quality? **What you need:** List of email addresses (up to 2000 per request). **What you get back:** For each email: whether it's found in Minerva, validation status, and last seen timestamp. **Common use cases:** * Pre-validate emails before using resolve/enrich * Filter email lists to focus on known contacts * Check data freshness with last seen dates * Verify email quality and validity ## Overview The Validate Emails endpoint checks if email addresses exist in the Minerva database and provides validation status and last seen date information. This endpoint accepts a simple list of email address strings and returns match status, validation status, and last seen timestamps for each email. The endpoint automatically handles email normalization and will attempt to match both the original email and any sanitized versions against the Minerva database. ## Monthly limit Each organization can request 1,000,000 fresh email checks per calendar month in UTC, shared across the API, SDK, and dashboard. Cached results do not count. Fresh-check batches consume quota when accepted, including checks that fail. Requests that need more fresh checks than the remaining quota return `429` with code `email_validation_monthly_limit_reached` and `details.retry_after_seconds`. Requests served entirely from stored results remain available. ## Request ### Headers **x-api-key** `string` *required* Your API key for authentication **Content-Type** `string` *required* application/json ### Request Body **records** `string[]` *required* An array of email address strings to validate. Maximum 2000 email addresses per request. Each element in the array should be a simple email address string (e.g., "[user@example.com](mailto:user@example.com)"). **force\_refresh** `boolean` (default: false) Set to `true` to bypass stored validation results and run fresh validation checks on normalized email addresses. Successful checks update the stored results. Failed checks return an error or `UNKNOWN`; they never fall back to an older result. Omit this flag or set it to `false` to retain the existing lookup behavior. The 2,000-email request limit and existing rate limits still apply. Fresh checks must be enabled for your organization. Otherwise, `true` returns `403`. If feature availability cannot be checked, the API returns `503`. ```json theme={null} { "records": ["person@example.com"], "force_refresh": true } ``` ```python theme={null} result = client.api.validate_emails(["person@example.com"], force_refresh=True) ``` ## Response ### Response Structure **api\_request\_id** `string` Unique identifier for this API request **results** `array` Array of validation results, one per input email **request\_completed\_at** `string` ISO 8601 timestamp when the request was completed #### Result Object **email\_address** `string` The original email address from the request **is\_match** `boolean` Whether this email address (or its sanitized version) was found in the Minerva database **email\_validation\_status** `string` Validation status of the email address. Can be "valid", "invalid", "unknown", or null if no match was found. **email\_last\_seen** `string` ISO 8601 timestamp of when this email was last seen in the Minerva database. Returns null if the email was not found. > [!NOTE] > > Error responses include `statusCode` and `body` fields for backward compatibility with existing integrations. These are deprecated — prefer the HTTP status code and the top-level `code` / `message` / `api_request_id` fields directly. (The deprecated nested `body` still carries the legacy `error_message`.) ```json 200 Response theme={null} { "api_request_id": "req_email456", "results": [ { "email_address": "john.smith@gmail.com", "is_match": true, "email_validation_status": "valid", "email_last_seen": "2024-01-10T15:30:00.000000" }, { "email_address": "jane.doe@example.com", "is_match": true, "email_validation_status": "valid", "email_last_seen": "2023-12-15T09:22:00.000000" }, { "email_address": "invalid@nonexistent.com", "is_match": false, "email_validation_status": null, "email_last_seen": null } ], "request_completed_at": "2024-01-15T10:30:45.123456" } ``` ```json 400 theme={null} { "code": "bad_request", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } ``` ```json 401 theme={null} { "code": "unauthorized", "message": "Unauthorized", "api_request_id": "b2c3d4e5-f6a7-1234-bcde-f12345678901" } ``` ```json 413 theme={null} { "code": "payload_too_large", "message": "Maximum number of records for /v2/validate_emails endpoint is 2000", "api_request_id": "d4e5f6a7-b8c9-3456-def0-234567890123" } ``` ```json 422 theme={null} { "code": "unprocessable_entity", "message": "Input data must contain a 'records' key with a list of inputs", "api_request_id": "e5f6a7b8-c9d0-4567-ef01-345678901234" } ``` ```json 429 theme={null} { "code": "rate_limit_reached", "message": "You reached your total request-rate limit, please contact help@minerva.io for help", "api_request_id": "f6a7b8c9-d0e1-5678-f012-456789012345" } ``` ## Error Responses * `400` - Bad Request: Invalid input format * `401` - Unauthorized: Invalid or missing API key * `413` - Payload Too Large: More than 2000 email addresses in request * `422` - Unprocessable Entity: Invalid request structure * `429` - Too Many Requests: Rate limit exceeded * `500` - Internal Server Error: Unexpected server error ## Notes * **API Version**: This endpoint only supports v2 (`/v2/validate_emails`) * **Rate Limits**: Maximum 2000 email addresses per request * **Email Normalization**: Email addresses are automatically sanitized and normalized. The endpoint will match against both the original email and sanitized versions * **Match Priority**: If multiple versions of an email match (original vs. sanitized), the endpoint returns the best match based on most recent `email_last_seen` date * **Return Order**: Results are returned in the same order as the input array * **Use Case**: Use this endpoint to verify email existence in Minerva's database before using resolve or enrich endpoints * **Database Matching**: Emails are matched against the `data_lake.email_validation` table using MD5 hashes of lowercase email addresses # FAQ Source: https://docs.minerva.io/mcp/faq Billing and organization access for Minerva Data MCP ## Which billing rules apply? The same billing rules as the Minerva platform apply to MCP usage. ## How do I check my remaining allowance? Ask your assistant: “How much record export allowance do we have left?” ## Can I use MCP with multiple organizations? A Minerva user can belong to multiple organizations. Each MCP connection operates within one selected organization. `list_memberships` shows your memberships and identifies the organization selected for the current connection. Listing another membership does not switch the connection or grant access to its data. ## How do I switch organizations? Disconnect or sign out of Minerva in your MCP client, reconnect, and choose the desired organization during sign-in. Then ask your assistant which organization is selected, or use `list_memberships` to verify it. Switching organizations in the Minerva web app does not change an existing MCP connection. Users without a selected organization must complete organization setup and sign-in before connecting to MCP. For setup instructions, see [Connect to Minerva](/minerva-data-mcp#connect). For connection problems, see [Troubleshooting](/mcp/troubleshooting). # Available tools Source: https://docs.minerva.io/mcp/tools Explore Minerva Data MCP tools and endpoint availability | Task | Tools | Availability | | - | - | - | | Search and preview audiences | `person_search`, `get_person_search_status`, `get_person_search_preview` | Both endpoints; previews contain up to 25 people. | | Inspect selected profiles | `get_person_details` | Both endpoints; up to 10 people per call, with current preview access or a prior record export. | | Enrich known contacts | `enrich_people` | Standard endpoint; up to 25 records per call. | | Export or activate an audience | `create_activation`, `get_activation_status` | Creation requires the standard endpoint; status is available on both. | | Find saved audiences | `list_segments` | Both endpoints; filter saved audiences by name, creator, or other criteria. | | List organization users | `list_organization_users` | Both endpoints; identifies users for audience creator filters. | | Score audiences and explore personas | `calculate_audience_scores`, `create_audience_score_slice`, `list_personas`, `get_persona` | Both endpoints; requires the corresponding organization capability. | | Inspect organization context and connections | `get_organization_context`, `get_organization_integrations`, `get_organization_competitors`, `get_organization_product_categories` | Both endpoints. | | Read market insights | `get_market_insights` | Both endpoints; filter market and competitor insights. | | Add a competitor | `add_competitor` | Both endpoints; queues background research when you ask to add a public domain. | | Query connected business data | `get_organization_data_schema`, `query_organization_data` | Both endpoints; requires connected analytics data. | | Check access and usage | `list_memberships`, `get_billing_usage` | Both endpoints. | | Send support feedback | `submit_feedback` | Both endpoints; requires your agreement. | See [Connect to Minerva](/minerva-data-mcp#connect) for the MCP setup instructions. ## Verify the connection Ask your assistant: ```text theme={null} Which Minerva organization is selected for this connection? ``` The assistant should use `list_memberships` and identify the selected organization. Then try: ```text theme={null} What Minerva capabilities are available for our organization? ``` The assistant can use `get_organization_context` to check available capabilities. Neither check exports person records. ## Example prompts Ask your assistant in plain language. For example: * “Find Heads of Growth at B2B software companies in New York and show 10 people.” * “Which data sources and activation destinations are connected?” * “How much record export allowance do we have left?” # Troubleshooting Source: https://docs.minerva.io/mcp/troubleshooting Resolve common Minerva Data MCP connection and usage problems | Problem | What to do | | - | - | | Sign-in is required or the session expired | Run your client's authentication action. In Codex, run `codex mcp login minerva-data`. In Claude Code, open `/mcp` and authenticate Minerva. | | Account setup is incomplete (`onboarding_required`) | Open [Minerva](https://app.minerva.io), sign in with the same account, complete organization setup, and reconnect. | | The wrong organization is selected | Follow the [organization switching steps](/mcp/faq#how-do-i-switch-organizations). | | Export or enrichment tools are missing | Check whether the server URL ends in `/credit-safe`. Use the standard endpoint and authenticate again when you need those tools. | | First-party search or analytics is unavailable | Check organization capabilities and connected data. Complete data setup in Minerva before retrying. | | Record export is blocked | Ask the assistant to check `get_billing_usage`. Review your plan allowance, overage limit, and account access. | | A download link has expired | Ask the assistant to check the same activation again. It can retrieve a fresh link while the file remains available. | | Opening the MCP URL in a browser shows an error | Add the URL to an MCP client. It is a protocol endpoint, not a web page. | For unresolved problems, contact support through [Minerva](https://app.minerva.io). For setup instructions, see [Connect to Minerva](/minerva-data-mcp#connect). For billing and organization questions, see the [FAQ](/mcp/faq). # Minerva Data MCP Source: https://docs.minerva.io/minerva-data-mcp Connect Codex, Claude, and other MCP clients to Minerva Model Context Protocol (MCP) connects AI assistants to external tools and data. Minerva Data MCP lets your assistant search for people, preview profiles, enrich known contacts, export audiences, and query your organization’s connected data. ## Before you connect * Sign in to [Minerva](https://app.minerva.io) and complete your account and organization setup. * Use an MCP client that supports **Streamable HTTP** and **OAuth** sign-in. * Confirm which Minerva organization you want to use. Each connection operates within one selected organization. MCP uses your Minerva user account. Available operations depend on your organization’s access and connected data. ## Connect The standard MCP server URL is: ```text theme={null} https://api.minerva.io/mcp ``` For an endpoint that excludes billable record export, use: ```text theme={null} https://api.minerva.io/mcp/credit-safe ``` To use this endpoint, replace the URL in the setup instructions below with `https://api.minerva.io/mcp/credit-safe` and complete OAuth for that connection. > [tab] Codex > > [Install Minerva in Codex](https://chatgpt.com/plugins/plugin_asdk_app_6aa3ed91acb881918712d2f6731fe0a6?open_in_app), > or search for **Minerva** in the Codex plugin marketplace. Connect Minerva and > sign in to your Minerva account. > > Alternatively, add the server manually: > > ```bash theme={null} > codex mcp add minerva-data --url https://api.minerva.io/mcp > ``` > > Complete the browser sign-in if Codex starts it automatically. Otherwise, run: > > ```bash theme={null} > codex mcp login minerva-data > ``` > > The Codex app, CLI, and IDE extension share the same MCP configuration. > Start a new session after adding the server. > See the [Codex MCP guide](https://developers.openai.com/codex/mcp/) for client configuration. > [tab] Claude Code > > Add Minerva for your user account: > > ```bash theme={null} > claude mcp add --transport http --scope user minerva-data https://api.minerva.io/mcp > ``` > > Start Claude Code, run `/mcp`, select `minerva-data`, and complete authentication. > [tab] Other MCP clients > > Enter the server URL in your client's remote MCP settings and complete OAuth. > Configuration formats differ between clients. Clients that support the following > `mcpServers` HTTP format can use: > > ```json theme={null} > { > "mcpServers": { > "minerva-data": { > "type": "http", > "url": "https://api.minerva.io/mcp" > } > } > } > ``` > > Use the client's authentication action to complete OAuth after adding the > server. If the client only supports local command-based servers, this remote > configuration will not work directly. # Authentication Source: https://docs.minerva.io/sdk/authentication One credential — your API key. Goes on every request as `x-api-key`. `Minerva` is the single entry point. The only credential you need is your **API key**. ## Where to get your API key **1. Sign in** Log in at [app.minerva.io](https://app.minerva.io) (not available on the free tier). **2. Open Settings** Click your org name in the **bottom-left** → the three dots (`...`) → **Settings**. **3. Open the API tab** Open the **API** tab and copy your key. Treat it like a password. ## Use it | Variable | Used for | | - | - | | `MINERVA_API_KEY` | every call the SDK makes | ```python theme={null} from minerva import Minerva mc = Minerva() # api_key from MINERVA_API_KEY env mc = Minerva(api_key="mk_live_...") # explicit ``` ## Resolution order **1. Constructor argument** ```python theme={null} Minerva(api_key="mk_live_...") ``` **2. Environment variable** `MINERVA_API_KEY` If neither is set, the first call raises `MinervaAuthError("no API key (set MINERVA_API_KEY or pass api_key=).")`. ## Static egress IPs Outbound traffic Minerva sends to your endpoints — activation pushes, webhooks, any Minerva-initiated callback — originates from a fixed set of static IPs. If your security team needs to allowlist third-party inbound traffic, allow these three addresses: ``` 98.87.210.154 34.224.225.242 100.29.157.18 ``` > [!NOTE] > > You do **not** need to allow these IPs for your SDK calls to reach > `api.minerva.io` — outbound HTTPS from your side works without any > allowlist. The list above only matters for traffic Minerva sends **to** > your systems (activations / webhooks). If you don't receive > Minerva-initiated traffic, you can skip this. ## How it's sent The SDK sends the API key as the `x-api-key` header on every request. There's no token exchange, no session state, no rotation handled by the SDK — your long-lived API key is the only credential. The server-side authorizer decides what your key is entitled to. ```http theme={null} POST /v2/enrich x-api-key: mk_live_... Content-Type: application/json { "records": [ ... ] } ``` ## Rotating your key Rotate your key in the Minerva web app. Once rotated: * The old key continues working for the documented grace period (check your plan) * Update `MINERVA_API_KEY` in your deployment / secret store * Restart the process so a fresh `Minerva()` picks up the new value ## Errors you might see | Error | Meaning | | - | - | | `MinervaAuthError("no API key …")` | Neither `api_key=` nor `MINERVA_API_KEY` set | | `MinervaAuthError` from a server response | 401 / 403 — your key is invalid, revoked, or not entitled to the endpoint you called | | `MinervaRateLimitError(retry_after=…)` | 429 — you're rate-limited; back off and retry | See [Error handling](/sdk/guides/error-handling) for the full hierarchy. # Async + bulk batching Source: https://docs.minerva.io/sdk/guides/async-and-batching Use `AsyncMinerva` for concurrent calls under one client, with `enrich_many` / `resolve_many` for arbitrarily-large record lists. For bulk pipelines (thousands of records), `asyncio`-based services (FastAPI/Starlette), or anything that benefits from concurrent calls under a single client, use `AsyncMinerva` instead of the sync `Minerva` entry point. The API surface is identical — just `await` every call. ## Basic usage ```python theme={null} import asyncio from minerva import AsyncMinerva async def main(): async with AsyncMinerva() as mc: resp = await mc.api.enrich( [{"record_id": "1", "linkedin_url": "https://www.linkedin.com/in/x"}] ) print(resp.to_df()) asyncio.run(main()) ``` The `async with` form closes the underlying HTTP pool on exit. Without it, call `await mc.close()` manually. ## Auto-batching with `enrich_many` / `resolve_many` The Minerva API caps `/v2/enrich` and `/v2/resolve` at **500 records per request**. Rather than write your own chunking + fan-out, the SDK's batch helpers do it for you and aggregate results: ```python theme={null} async with AsyncMinerva() as mc: results = await mc.api.enrich_many( my_10000_records, # any size batch_size=500, # default; capped at 500 (API max) max_concurrency=20, # optional ceiling on in-flight batches ) # `results` is a flat list of EnrichResult, concatenated in input order. ``` `resolve_many` has the same shape for resolves. ### How `max_concurrency` interacts with rate limits `max_concurrency` is a hard ceiling on simultaneously-in-flight batches — useful when you also hold a separate scarce resource (e.g. a downstream DB). For most users it's safe to leave unset: the SDK's built-in [rate limiter](/sdk/guides/rate-limiting) governs throughput so you can fan out hundreds of batches without exceeding your plan. ## Failure semantics A single batch that errors propagates out of `enrich_many` / `resolve_many` and cancels in-flight peers. There's no partial-success aggregation in the helpers. For partial-failure handling, fan out manually: ```python theme={null} batches = [records[i:i+500] for i in range(0, len(records), 500)] results = await asyncio.gather( *[mc.api.enrich(b) for b in batches], return_exceptions=True, ) # results contains EnrichResponse or Exception per batch ``` ## Records arriving from a stream? `enrich_many` / `resolve_many` expect the **whole list** in memory. If records arrive incrementally (CSV cursor, Kafka, SQS, generator), use the [streaming batcher](./streaming-batcher) instead — feed it one record at a time and it fires when the buffer hits `size`. Same rate-limiter, same transient-retry semantics; just a different ergonomic entry point. ## Bulk batching for custom endpoints `enrich_many` and `resolve_many` only cover the typed endpoints. For an arbitrary preview / client-specific path (`mc.api.call(...)`), the equivalent is `AsyncBatcher` wrapping the call — see the [streaming-batcher guide → "Bulk fan-out: 10k records through a custom endpoint"](./streaming-batcher#bulk-fan-out-10k-records-through-a-custom-endpoint) for the worked example. # Custom & tailored endpoints Source: https://docs.minerva.io/sdk/guides/custom-endpoints Escape hatch for client-specific endpoints — preview routes, partner integrations, anything not yet wrapped in a typed SDK method. The typed methods (`mc.api.enrich` / `mc.api.resolve` / …) cover the public Minerva Data API. For **client-specific** routes — preview endpoints, partner integrations, a path Minerva built just for your org — use `mc.api.call(...)` directly. ```python theme={null} result = mc.api.call("POST", "/v2/acme/lookup", json={"record_id": "abc"}) # {"matches": [{"id": "p-1", ...}]} ``` Same `x-api-key` auth, same error mapping, same rate-limit handling as the typed methods — the difference is the SDK doesn't know the response schema, so you get back the raw parsed JSON (typically a dict). ## When to reach for it | You're calling… | Use | | - | - | | `/v2/enrich`, `/v2/resolve`, `/v2/validate_emails`, etc. | The typed method (`mc.api.enrich(...)`, `mc.api.resolve(...)`, …) — pydantic in, pydantic out, autocomplete | | A path tailored to your org (e.g. `/v2/acme/...`) | `mc.api.call(...)` | | A preview endpoint not yet promoted to the typed API | `mc.api.call(...)` | > [!TIP] > > If you find yourself calling the same custom endpoint a lot, ask us to add a > typed wrapper. Typed wrappers get autocomplete, schema validation, and > tabular response helpers for free. ## Authentication & entitlement Entitlement is enforced **server-side**. Your `x-api-key` is checked against an allow-list of paths per request — callers without entitlement get a 403, which the SDK surfaces as `MinervaAuthError`: ```python theme={null} from minerva import MinervaAuthError try: mc.api.call("POST", "/v2/acme/internal", json={...}) except MinervaAuthError: print("your key isn't entitled to this endpoint — contact your Minerva rep") ``` There's nothing special on the SDK side — same auth path as `mc.api.enrich(...)`. ## Parameters **method** `str` *required* HTTP verb: `"GET"`, `"POST"`, `"PUT"`, `"DELETE"`, `"PATCH"`. Case-insensitive. **path** `str` *required* URL path beginning with `/`, e.g. `"/v2/acme/lookup"`. **params** `dict` Optional query-string dict. Values are URL-encoded for you. **json** `Any` Optional JSON body (for POST/PUT/PATCH). Typically a `dict`. **headers** `dict[str, str]` Optional extra request headers — merged on top of the SDK's defaults. The `x-api-key` header is always set by the SDK and can't be overridden here. ## Return value The parsed JSON response body — whatever shape the endpoint returns. **No pydantic validation** is applied (the SDK doesn't know the schema); validate yourself if it matters: ```python theme={null} result = mc.api.call("POST", "/v2/acme/lookup", json={"record_id": "abc"}) from pydantic import BaseModel class AcmeMatch(BaseModel): id: str score: float matches = [AcmeMatch(**m) for m in result["matches"]] ``` ## Errors | Status | Raises | | - | - | | Local — bad `path` (empty / no leading `/`) | `MinervaValidationError` | | 401 / 403 | `MinervaAuthError` | | 429 | `MinervaRateLimitError(retry_after=...)` | | Other 4xx / 5xx | `MinervaAPIError(status_code=..., api_request_id=...)` | ## Examples **GET with query string:** ```python theme={null} mc.api.call("GET", "/v2/acme/audit", params={"since": "2026-05-01", "limit": 100}) ``` **POST with body + custom header for tracing:** ```python theme={null} mc.api.call( "POST", "/v2/acme/lookup", json={"record_id": "abc"}, headers={"X-Trace-Id": "tr-123"}, ) ``` **DELETE:** ```python theme={null} mc.api.call("DELETE", "/v2/acme/records/abc") ``` # Enrich Source: https://docs.minerva.io/sdk/guides/enrich Full person profiles — identity, contact, professional, financial, household, relatives — from a record stub. ```python theme={null} resp = mc.api.enrich( [{"record_id": "1", "linkedin_url": "https://www.linkedin.com/in/example"}], match_condition_fields=["linkedin_url"], return_fields=["full_name", "professional_emails", "phones"], ) for r in resp.results: print(r.record_id, r.is_match, r.minerva_pid, r.match_score) print(r.full_name, r.gender, r.age) # person fields are top-level print(r.professional_emails) # [{email_rank, email_address}, ...] resp.to_df() # one row per record ``` ## Parameters **records** `list[dict]` *required* Up to 500 per call. Each record must include `record_id` and satisfy one of the [Enrich input rules](/api-reference/enrich-inputs) supported by the Python SDK. **version** `str` (default: "v2") API version. **match\_condition\_fields** `list[str]` Quality gate (up to 3). A record only counts as a match if the resolved person actually has these fields. Useful when you need contact info you can act on (e.g. require a `phone`). Omit to match on resolution alone. **return\_fields** `list[str]` Narrow the response payload to just these fields. Reduces wire size; doesn't affect billing. **include\_premium\_fields** `bool` (default: False) Add a `premium_fields` object to each matched result with separately-licensed household, spending, vehicle, travel, and interest attributes. Requires the `api:premium-fields` entitlement — without it the call fails with `403`. v2 only; the flag is dropped when you pin `version="v1"`. **dry\_run** `bool` (default: False) Validate input locally without sending. Returns the `EnrichRequest` that *would* be sent. See [Validation](/sdk/guides/validation-dry-run). ## Response shape Results are flat — every person field is a top-level attribute of the result, not grouped under a `personal_information`-style object. Each result includes: | Field | What | | - | - | | `full_name`, `first_name`, `last_name`, `gender`, `dob`, `age`, `marital_status`, ... | Identity + demographics | | `minerva_household_id`, `minerva_spouse_pid`, `number_of_children` | Household composition | | `is_retired`, `estimated_income_range`, `estimated_wealth_range`, `home_ownership_status`, `has_bankruptcy_records`, `has_judgment_records` | Financial + legal records | | `linkedin_url`, `linkedin_title`, `linkedin_industry`, `linkedin_profile_pic_url`, `facebook_url`, `twitter_url` | Public profiles | | `personal_emails`, `professional_emails` | Ranked email arrays | | `phones` | Verified phone numbers | | `address_history` | Past + current addresses | | `work_experience` | Employment history | | `education_experience` | Schools + degrees | | `relatives` | Linked household members | | `premium_fields` | Premium attributes; only present with `include_premium_fields=True` | > [!NOTE] > > `match_condition_fields` is a **quality gate** — a record only counts as a > match if the resolved person actually has those fields (e.g. require a > `phone` you can dial). Omit it to match on resolution alone. ## Tabular output ```python theme={null} resp.to_dicts() # list[dict] resp.to_df() # pandas DataFrame (needs [pandas]) resp.to_csv("out.csv") resp.to_table() # pretty terminal table (needs [table]) ``` Person fields become columns directly; the one nested object, `premium_fields`, flattens into top-level columns. See [Output formats](/sdk/guides/output-formats). ## Map onto your own schema Results are flat, so field names line up directly with your own pydantic model: ```python theme={null} from pydantic import BaseModel class Lead(BaseModel): record_id: str full_name: str | None = None estimated_income_range: str | None = None crm_id: str | None = None # not a Minerva field → stays None leads = [Lead(**row) for row in mc.api.enrich(records).to_dicts()] ``` ## Limits * Records per call: **500** * Validation enforced locally before the call — over-limit records raise `MinervaValidationError` without a round-trip * Billing: each unique record counts once per contract term, using available record allowance or paid overage. # Error handling Source: https://docs.minerva.io/sdk/guides/error-handling One exception hierarchy. Specific subclasses where you'd actually want to branch on the failure. All SDK errors derive from `MinervaError`. The hierarchy lets you catch broadly (any SDK error) or narrowly (specific failure mode), and most carry context attributes so you can build a useful UI without parsing message strings. ## The hierarchy ``` Exception └── MinervaError ← catch-all ├── MinervaConfigError ← misconfiguration ├── MinervaValidationError ← boundary failures, raised locally ├── MinervaAuthError ← 401/403 (bad key, not entitled) ├── MinervaRateLimitError ← 429. .retry_after └── MinervaAPIError ← other 4xx/5xx. .status_code, .api_request_id, .body └── MinervaInsufficientCreditsError ← 402 record export capacity failure. .code, .details ``` ## Quick reference | Exception | When | Carries | | - | - | - | | `MinervaValidationError` | Bad input — raised locally, before the call | — | | `MinervaAuthError` | 401/403 — invalid key or not entitled to this endpoint | — | | `MinervaRateLimitError` | 429 — back off and retry | `.retry_after` (seconds) | | `MinervaAPIError` | Other 4xx/5xx | `.status_code`, `.api_request_id`, `.body` | | `MinervaInsufficientCreditsError` | 402 — record export capacity failure; subclass of `MinervaAPIError` | Inherited API error fields, `.code`, `.details` | | `MinervaConfigError` | Misconfiguration | — | ## Insufficient record capacity (402) Record export returns HTTP 402 with `code` `insufficient_record_capacity` when new records exceed the available plan allowance and monthly overage capacity. The SDK preserves its existing `MinervaInsufficientCreditsError` exception, a subclass of `MinervaAPIError`. Both sync and async clients expose the server's code and capacity details. ```python theme={null} from minerva import MinervaInsufficientCreditsError try: result = mc.api.enrich(batch) except MinervaInsufficientCreditsError as error: details = error.details or {} print(f"Available records: {details.get('records_available')}; " f"requested: {details.get('records_requested')}") ``` `allowance_records_available` and `overage_records_available` describe the two capacity sources. Increase the monthly spend limit or upgrade before retrying. A trial has no overage. ## Rate limits ```python theme={null} import time from minerva import MinervaRateLimitError while True: try: result = mc.api.enrich(batch) break except MinervaRateLimitError as e: time.sleep(e.retry_after or 1) ``` `retry_after` is the server's hint in seconds. Fall back to a sane default (1s) if the server didn't supply one. ## Server errors ```python theme={null} from minerva import MinervaAPIError try: mc.api.enrich(records) except MinervaAPIError as e: print(f"server returned {e.status_code}") if e.api_request_id: print(f"quote to support: {e.api_request_id}") ``` `api_request_id` is the server's trace ID — quote it when reporting issues to support. Responses are forward-compatible: fields the server adds later won't break an older SDK. ## Validation errors `MinervaValidationError` is raised **locally** before any HTTP call — bad payload shape, over-the-limit record counts, missing required fields: ```python theme={null} from minerva import MinervaValidationError try: mc.api.enrich([]) # 0 records — must be ≥ 1 except MinervaValidationError as e: print("caught before any API call:", e) ``` Use `dry_run=True` to trigger the same validation without committing to the call — see [Validation & dry\_run](/sdk/guides/validation-dry-run). ## Catch-all ```python theme={null} from minerva import MinervaError try: mc.api.enrich(records) except MinervaError as e: log.error("Minerva call failed", exc_info=e) raise ``` > [!NOTE] > > `MinervaAuthError` is also raised when no `MINERVA_API_KEY` is set (or > `api_key=` passed) — that's a local check, before any HTTP call. The error > message tells you exactly what's missing. # Liveness Source: https://docs.minerva.io/sdk/guides/health Probe Minerva API endpoints via `mc.status.health()`. Auto-upgrades to an authenticated metrics view when the client has an API key. Never raises — safe to call in a polling loop. `mc.status.health()` is a **starter / sanity check** — confirm Minerva is reachable, see if the API is currently healthy, debug "is my key wrong or is the service down?". The same method calls one of two endpoints depending on whether the client has an API key configured: | Client state | Endpoint hit | Auth | What you get back | | - | - | - | - | | No API key | `GET /health` | none | Liveness: `ok`, `latency_ms`, `status_code`, `status`, `message` | | API key set | `GET /health/metrics` | `x-api-key` | Same fields **plus** `refreshed_at` (server-side aggregation timestamp). The `message` rolls up to text like `"all systems normal"` or `"elevated latency on 2 endpoint(s)"` — counts, not per-route numerics. | The method **never raises** on probe failure. Each endpoint's outcome lives in its `HealthStatus` (`ok=False` with `error` set), so it's safe to call in a polling loop without `try/except`. ```python theme={null} from minerva import Minerva mc = Minerva() # MINERVA_API_KEY from env report = mc.status.health() # auto-picks /health or /health/metrics for name, h in report.items(): if not h.ok: alert(f"{name} {h.status}: {h.message} (HTTP {h.status_code})") else: log(f"{name} ok — {h.message} ({h.latency_ms:.0f} ms client-perceived)") ``` ## When (and when NOT) to call it > [card] Use as a checkpoint, not a per-call gate > > Every `mc.status.health()` is a real HTTP round-trip. Gating every > `mc.api.enrich(...)` on a health probe doubles your latency for no > useful signal — the next `mc.api.*` call itself raises `MinervaAPIError` > if something's wrong. ✅ **Good use cases** * A dashboard widget polled every 30-60s * A monitor / synthetic that fires every few minutes * A one-shot call at process startup * Debugging "is the API down or is my key wrong?" (works without a key) ❌ **Avoid** * Wrapping every `mc.api.enrich(...)` / `mc.api.resolve(...)` in a health check * Tight loops — the authed endpoint's data is up to \~60 s old by design; polling faster doesn't get you fresher numbers * Treating it as a substitute for client-side error handling ## Auto-upgrade behavior When the client has an API key, `health()` automatically hits the authenticated `/health/metrics` endpoint and returns the richer payload. You can override either way: ```python theme={null} mc.status.health() # auto: /health if no key, /health/metrics if key mc.status.health(detailed=False) # force /health (basic, skip the metrics overhead) mc.status.health(detailed=True) # force /health/metrics (raises MinervaAuthError if no key) ``` ## Return shape Always a `dict[str, HealthStatus]` keyed by endpoint name. One entry today (`"api"`); the dict grows as Minerva exposes more endpoints. Iterating today's code keeps working as endpoints come online. ### `HealthStatus` **ok** `bool` `True` when the endpoint is reachable and the gateway reports healthy (HTTP 2xx and `status == "ok"` in the body, when present). **latency\_ms** `float` Client-perceived round-trip time, in milliseconds. **status\_code** `int | None` HTTP status code returned by the endpoint. `None` on network-level failure (DNS, TCP, TLS, timeout). **status** `str | None` Value of the `status` field in the gateway's response body, when present (e.g. `"ok"`, `"degraded"`, `"warming"`). `None` if absent. **message** `str | None` Human-readable detail. On the unauthenticated endpoint, often `None` or a short free-text note from the gateway. On the authenticated endpoint, rolls up to phrases like `"all systems normal"` or `"elevated latency on 2 endpoint(s)"` — **counts only, no per-route numerics**. **refreshed\_at** `int | None` Unix timestamp of the last server-side aggregation (authenticated endpoint only). Data can be up to \~60 s old by design. **error** `str | None` SDK-side reason for `ok=False` — the HTTP code (e.g. `"HTTP 503"`) or the underlying network exception class (e.g. `"ConnectError: ..."`). `None` when the probe succeeded. Distinct from `message`: `error` is the SDK's verdict; `message` is whatever the gateway returned. ## Parameters **endpoints** `str | list[str] | None` Which endpoint(s) to probe. Omit (or pass `None`) to probe every known endpoint. Pass a single name or a list to filter. Today the only known name is `"api"`; unknown names raise `ValueError`. **timeout** `float` (default: 5.0) Per-endpoint timeout in seconds. Default 5 — for a liveness check, "no answer in 5 seconds" is itself a useful answer. **detailed** `bool | None` `None` (default) auto-picks the endpoint based on API-key presence. `True` forces `/health/metrics` (raises `MinervaAuthError` if no key). `False` forces `/health` (skip the metrics call even when a key is configured). ## Examples **Probe everything (default):** ```python theme={null} mc.status.health() # without API key → {"api": HealthStatus(ok=True, status="ok", refreshed_at=None, ...)} # with API key → {"api": HealthStatus(ok=True, status="ok", message="all systems normal", refreshed_at=1780617600, ...)} ``` **Force the basic call (skip the metrics overhead):** ```python theme={null} mc.status.health(detailed=False) ``` **Polling loop in a dashboard:** ```python theme={null} import time from minerva import Minerva mc = Minerva() while True: for name, h in mc.status.health().items(): if not h.ok: page_oncall(f"Minerva {name} {h.status}: {h.message}") time.sleep(30) ``` **Prometheus exporter:** ```python theme={null} from prometheus_client import Gauge up = Gauge("minerva_endpoint_up", "1 if up", ["endpoint"]) latency = Gauge("minerva_endpoint_latency_ms", "Probe latency", ["endpoint"]) def collect(): for name, h in mc.status.health().items(): up.labels(endpoint=name).set(1 if h.ok else 0) latency.labels(endpoint=name).set(h.latency_ms) ``` **Distinguish "API down" from "key invalid":** ```python theme={null} report = mc.status.health(detailed=False) # no key needed; hits /health if not report["api"].ok: print("API is down — try again later") else: try: mc.api.enrich([{"record_id": "1", "linkedin_url": "..."}]) except MinervaAuthError: print("API is fine — your key is the problem") ``` ## What the authed view tells you The `/health/metrics` payload is intentionally **minimal**: an overall `status` + a generic `message` + a `refreshed_at` timestamp. By design it does **not** expose: * Per-route latency or error-rate numbers * Internal service / Lambda names * Endpoints you're not entitled to use Engineers needing the raw view query their observability stack (DataDog / Grafana) directly. The SDK's view is a quick "is everything behaving?" signal. ## Authentication `GET /health` is unauthenticated. `GET /health/metrics` requires the same `x-api-key` you'd use for any data-API call. Both run on `api.minerva.io` so there's no DNS or TLS overhead beyond the data-plane connection your client already uses. ## Errors `health()` never raises for probe failures — the outcome is encoded in the returned `HealthStatus`. The only things that raise are misuses of the call itself: | Condition | Raises | | - | - | | Unknown name in `endpoints=` | `ValueError` | | `detailed=True` but no API key configured | `MinervaAuthError` | | Bad `timeout=` (e.g. negative) | `TypeError` / `ValueError` (from httpx) | # Country inference Source: https://docs.minerva.io/sdk/guides/infer-country Infer each record's country from its contact info (phone country code, email TLD, address signals, etc.). ```python theme={null} mc.api.infer_record_country([ {"record_id": "1", "emails": ["test@example.com"]} ]) ``` Returns a most-likely country per record. ## Parameters **records** `list[dict]` *required* Record objects (1–500), each with `record_id` + any of `emails` / `phones` / `name`. **dry\_run** `bool` (default: False) Validate input locally without sending. ## Response shape ```python theme={null} result = mc.api.infer_record_country([{"record_id": "1", "emails": ["test@example.com"]}]) # { # "results": [ # {"record_id": "1", "inferred_country": "US", "confidence": ...} # ] # } ``` ## Validation `dry_run=True` returns the validated `InferCountryRequest` without sending; an empty `records` list raises `MinervaValidationError` locally. See [Validation](/sdk/guides/validation-dry-run). # LinkedIn contact info Source: https://docs.minerva.io/sdk/guides/linkedin Look up ranked contact info for LinkedIn usernames. ```python theme={null} mc.api.get_li_contact_info(["johnsmith", "jane-doe-56583a93"]) ``` Pass strings containing LinkedIn usernames or full profile URLs. A username is the part after `/in/` in a profile URL. Full URLs are normalized server-side. The response contains ranked contact info per username. ## Parameters **records** `list[str]` *required* LinkedIn username or profile URL strings (1–500 per call). The API itself accepts up to 1000 per request; the SDK caps a single call at 500 — use [batching](/sdk/guides/async-and-batching) for larger lists. **version** `str` (default: "v2") API version. `"v1"` is also accepted, but returns a different shape — see [Migrating from v1](/api-reference/get-li-contact-info#migrating-from-v1). **presence\_only** `bool` (default: False) v2 only — return presence flags instead of the contact values themselves. Useful for quickly checking how much you'd get from a full lookup before spending the credit. **dry\_run** `bool` (default: False) Validate input locally without sending. ## Response shape ```python theme={null} result = mc.api.get_li_contact_info(["johnsmith"]) # { # "api_request_id": "a7bf5e42-6825-481b-9422-f3ec88b65382", # "results": [ # { # "linkedin_username": "johnsmith", # "is_match": True, # "phones": [ # {"phone_rank": "1", "phone_type": "mobile", # "phone_number": "(213) 761-9492", "confidence_score": 92}, # ], # "personal_emails": [ # {"email_rank": "1", "email_address": "john.smith@gmail.com", # "confidence_score": 99}, # ], # "professional_emails": [...], # } # ], # "request_completed_at": "2026-07-28T15:30:35.134682+00:00", # } ``` Ranks are strings and confidence scores are integers on a 0–100 scale. When nothing is found for a username, `is_match` is `False` and all three contact lists are `None`. The response is the raw API JSON (a dict) rather than a typed pydantic model — the shape is forward-compatible, so new fields the server adds don't break older clients. ## `presence_only` (v2) When `True`, each result carries booleans rather than values: ```python theme={null} mc.api.get_li_contact_info(["johnsmith"], presence_only=True) # {"results": [{"linkedin_username": "johnsmith", "is_match": True, # "personal_email_match": True, "professional_email_match": True, # "phone_match": True}], ...} ``` ## Validation `dry_run=True` returns the validated `LiContactInfoRequest` without sending; an empty `records` list, more than 500 entries, or a non-string entry raises `MinervaValidationError` locally. Pass each username or URL as a string. See [Validation](/sdk/guides/validation-dry-run). # Output formats Source: https://docs.minerva.io/sdk/guides/output-formats Every list-shaped result → dicts, DataFrame, CSV, or a pretty terminal table. ```python theme={null} resp = mc.api.enrich(records) resp.to_dicts() # list[dict] resp.to_df() # pandas DataFrame (needs [pandas]) resp.to_csv("out.csv") # write a CSV resp.to_table() # pretty terminal table (needs [table]) ``` Enrich results are already flat, so person fields such as `full_name` map straight to columns. Nested objects are flattened where it makes sense — the keys of `premium_fields` become top-level columns in the DataFrame, etc. ## Map results to your own schema Build your own pydantic model from `to_dicts()` — results are flat, so field names line up directly: ```python theme={null} from pydantic import BaseModel class Lead(BaseModel): record_id: str full_name: str | None = None estimated_income_range: str | None = None crm_id: str | None = None # not a Minerva field → stays None leads = [Lead(**row) for row in mc.api.enrich(records).to_dicts()] ``` ## Which extras you need | Method | Extra | Why | | - | - | - | | `to_dicts()` | — | Pure stdlib | | `to_df()` | `[pandas]` | DataFrame construction | | `to_csv(path)` | — | Pure stdlib (uses `csv` module) | | `to_table()` | `[table]` | Pretty box-drawing via `tabulate` | ## Which responses support them The list-shaped responses (`EnrichResponse`, `ResolveResponse`, `UsageResponse`) implement the `TabularMixin` — they have `to_dicts` / `to_df` / `to_csv` / `to_table`. The dict-returning methods (`get_li_contact_info`, `validate_emails`, `infer_record_country`, `mc.api.call`) return raw `dict` — convert to your preferred format yourself if needed: ```python theme={null} import pandas as pd result = mc.api.validate_emails(["test@example.com"]) df = pd.DataFrame(result["results"]) ``` # Person Search Source: https://docs.minerva.io/sdk/guides/person-search Find people from a natural-language audience description. Returns matching Minerva PIDs plus contact-channel coverage stats. Person Search accepts a plain-English audience description ("CFOs at Series B fintech startups in NYC") and returns the matching Minerva PIDs plus coverage statistics for how many of them have email, phone, LinkedIn, etc. ```python theme={null} from minerva import Minerva mc = Minerva() # 1. Kick off a search resp = mc.api.person_search( query="CFOs at Series B fintech startups in NYC", size=100, ) resp.search_id # str — store to re-fetch later resp.results # list[str] of Minerva PIDs resp.total_count # full match count (may exceed size) resp.total_contact_coverage.professional_email # CoverageStat(count, percent) # 2. Fetch the same search later by id again = mc.api.person_search_get(resp.search_id) # 3. Check your per-day usage usage = mc.api.person_search_usage() usage.current_day_remaining # remaining records in today's quota ``` ## SDK wrapper is sync-only `AsyncMinerva.api.person_search` (and its `_get` / `_usage` siblings) raise `NotImplementedError`. The endpoint runs for several seconds per call server-side and is metered per UTC day, so allowing concurrent fan-out via `asyncio.gather(...)` would make it trivial to drain the daily quota in a single client-side mistake. Use the sync `Minerva` client. ```python theme={null} async with AsyncMinerva() as mc: await mc.api.person_search("...") # raises NotImplementedError: AsyncMinerva.api.person_search is not # supported — person-search is sync-only by design. Use Minerva(). ``` ## Async REST workflow The REST API also provides a segment-backed async workflow for searches that need the complete matching PID set. It is not yet wrapped by `Minerva` or `AsyncMinerva`. 1. [Submit an async search](/api-reference/person-search-job-submit). 2. [Poll status and inspect the segment-size estimate](/api-reference/person-search-job-status). 3. [Unlock the full segment and page its PIDs](/api-reference/person-search-job-results). The [Async Person Search walkthrough](/api-reference/person-search-async) walks the whole flow end to end with a complete Python example. The results endpoint returns at most 100 PIDs per page. Unlocking requires full materialization and enables pagination. PID-only results consume no record capacity. Enrichment and record exports are billed separately. Campaign activations to supported ad and direct mail platforms do not consume record allowance or incur record overage. ## Validation (before any HTTP call) The wrapper validates locally first, so customer-side bugs surface as `MinervaValidationError` without making an API request: * `query` must be 1–500 characters * `size` must be in 1–100 ```python theme={null} mc.api.person_search("", dry_run=True) # MinervaValidationError: query — String should have at least 1 character ``` Pass `dry_run=True` to validate + get back the `PersonSearchRequest` model without firing the call. ## Retrying transient errors Person Search is one of Minerva's slowest endpoints — it makes its own upstream LLM calls to parse your query, which can take several seconds and is more exposed to transient network drops than the other data-plane methods. The SDK does not auto-retry, but it classifies network drops, read/connect timeouts, and 5xx responses as `MinervaTransientError` — a subclass of `MinervaAPIError` — so you can write a tight retry loop without catching things you don't want to retry (auth failures, input validation, etc.). The recommended pattern uses [`tenacity`](https://tenacity.readthedocs.io): ```python theme={null} from tenacity import ( retry, stop_after_attempt, wait_exponential, retry_if_exception_type, ) from minerva import Minerva, MinervaTransientError mc = Minerva() @retry( stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=1, max=10), retry=retry_if_exception_type(MinervaTransientError), ) def search_with_retry(query: str, size: int = 100): return mc.api.person_search(query, size=size) resp = search_with_retry("CFOs at Series B fintech startups in NYC") ``` `MinervaTransientError` covers: * Connection drops mid-response (the `RemoteDisconnected` family) * Connect / read / write timeouts * All `5xx` HTTP responses It does **not** cover (correctly, since retrying makes no difference): * `MinervaValidationError` — local input validation failed * `MinervaAuthError` — `401/403` API-key issue * `MinervaRateLimitError` — `429`, use the `retry_after` field on the exception to back off, then retry; don't bury it in a generic retry loop * Other `MinervaAPIError` subclasses for `4xx` responses — your input is the problem ## Writing good queries See the API reference for the canonical guide: **[Writing good queries →](/api-reference/person-search#writing-good-queries)** The page documents: * Supported attribute categories (role, industry, company, career history, location, education, age, income, contact channels) * Three worked examples with progressively more complexity * Tips on how to phrase queries the parser handles well ## Feeding results into other SDK methods Person Search returns PIDs. Plug them straight into `mc.api.enrich` to get full profiles for the matched audience — no second resolve hop needed: ```python theme={null} search = mc.api.person_search("Marketing directors at SaaS in the Bay Area") profiles = mc.api.enrich( [{"record_id": pid, "minerva_pid": pid} for pid in search.results], ) ``` This is the fastest path from "describe an audience" → "have their profile data" — the enrich call is keyed by PID, so it skips the match pipeline server-side (same optimization as [`mc.workflows.resolve_then_enrich`](/sdk/guides/workflows)). ## Full schema The request body fields (`query`, `size`), response shape (`search_id`, `results`, `total_count`, contact-coverage stats), and error responses are documented under the API Reference: * **[POST /person-search/v0/search →](/api-reference/person-search)** — kick off a search * **[GET /person-search/v0/search/\ →](/api-reference/person-search-get)** — fetch a prior search * **[Async Person Search →](/api-reference/person-search-async)** — create, poll, and page a full segment (REST; not yet wrapped in the SDK) * **[GET /person-search/v0/usage →](/api-reference/person-search-usage)** — per-day usage tallies * **[Contact Append / Prospect →](/api-reference/person-search-contact-append)** — async ABM / NAICS contact jobs (REST; not yet wrapped in the SDK) # Rate limiting (built in) Source: https://docs.minerva.io/sdk/guides/rate-limiting The SDK self-throttles to your plan's rate so you can fan out concurrent calls without writing your own throttler — and never see a 429 you didn't ask for. Both `Minerva` and `AsyncMinerva` self-throttle to whatever your plan allows. You don't have to write a token bucket, a semaphore, or back-off logic. ## How it works On the first call (sync or async), the SDK GETs `/v2/usage/limits` to discover your per-second rate, burst, and daily quota. The response is cached in-process and used to build a shared token bucket: ```json theme={null} { "rps_limit": 100, "burst_limit": 150, "daily_quota": null, "daily_quota_used": null, "reset_at_utc": null } ``` (Any field set to `null` is treated as "no limit on this axis.") Subsequent calls — including concurrent ones under one client — pass through the bucket. When the bucket is empty, the call waits the minimal time needed to acquire a token. ## When it helps Most when you fan out concurrent requests: ```python theme={null} async with AsyncMinerva() as mc: # 100 concurrent enriches; the SDK self-throttles to your plan's rps_limit. results = await asyncio.gather(*[ mc.api.enrich(batch) for batch in batches ]) ``` …or use the built-in `enrich_many` / `resolve_many` which already share the same client + bucket. ## Inspecting the active policy ```python theme={null} async with AsyncMinerva() as mc: limits = await mc.ensure_limits() print(f"{limits.rps_limit=} {limits.burst_limit=} {limits.daily_quota=}") ``` Or for the sync client: ```python theme={null} mc = Minerva() limits = mc.ensure_limits() ``` ## Opting out ```python theme={null} mc = Minerva(rate_limit=False) async_mc = AsyncMinerva(rate_limit=False) ``` Useful when: * You've already built your own throttler at the application layer. * You're running tests against a recorded response. * You want to deliberately push toward 429 to learn your ceiling. ## Older servers / endpoint not deployed If `/v2/usage/limits` returns 404 (or any error), the SDK silently falls back to "no throttle" and continues normally. Your calls won't fail because the limits probe didn't work. # Resolve Source: https://docs.minerva.io/sdk/guides/resolve Match your records to a unique Minerva PID. Lighter and cheaper than enrich when all you need is identity. ```python theme={null} match = mc.api.resolve([ {"record_id": "1", "first_name": "Jane", "last_name": "Doe", "emails": ["jane.doe@example.com"]} ]) for r in match.results: print(r.record_id, r.is_match, r.minerva_pid, r.match_score) ``` ## When to use resolve vs enrich | You need | Use | | - | - | | Just the Minerva PID (dedupe, key lookup, ID-to-ID linking) | `mc.api.resolve` | | The full person profile | `mc.api.enrich` | `resolve` is cheaper than `enrich` per matched record. Both run the same matching logic — the difference is what comes back. ## Parameters **records** `list[dict]` *required* Up to 500 per call. Each must have `record_id` + at least one matching field (LinkedIn URL, emails, name, etc.). **version** `str` (default: "v2") API version. **match\_condition\_fields** `list[str]` Quality gate. A record only counts as a match if the resolved person actually has these fields. Up to 3. **dry\_run** `bool` (default: False) Validate input locally without sending. Returns the `ResolveRequest` that *would* be sent. See [Validation](/sdk/guides/validation-dry-run). ## Response shape ```python theme={null} match.to_dicts() # [ # { # "record_id": "1", # "is_match": True, # "minerva_pid": "p-abc123", # "match_score": 110.0, # }, # ... # ] ``` `match.results` is a list of `ResolveResult` objects with `record_id`, `is_match`, `minerva_pid`, `match_score`. The response is typed end-to-end — IDE autocomplete + `mypy` will check field access for you. `match_score` is an additive point total, not a 0-1 or 0-100 confidence — every match scores at least 50 and strong ones routinely exceed 100, so don't threshold it as a percentage. It's `None` when `is_match` is false. See [Interpreting `match_score`](/api-reference/resolve-v2#interpreting-match-score). ## Tabular output ```python theme={null} match.to_dicts() # list[dict] match.to_df() # pandas DataFrame (needs [pandas]) match.to_csv("out.csv") match.to_table() # pretty terminal table (needs [table]) ``` See [Output formats](/sdk/guides/output-formats) for full conversion patterns. ## Limits * Records per call: **500** * Validation enforced locally before the call — over-limit records raise `MinervaValidationError` without a round-trip * Billing: see your plan for per-resolve / per-match pricing # Spreadsheets — Google Sheets & Excel Source: https://docs.minerva.io/sdk/guides/spreadsheets Run resolve / enrich directly off a Google Sheet or .xlsx workbook, and write results back the same way. `mc.io` lets you point the SDK at a spreadsheet, run the Data API on its rows, and write the results back — without the manual "read CSV → build records → call API → flatten response" loop. Two formats today: **Google Sheets** (via `gspread`) and **Excel .xlsx** (via `openpyxl`). Each is gated on its own optional extra so the base wheel stays small. ```bash theme={null} pip install "minerva-sdk[gsheet]" # Google Sheets I/O pip install "minerva-sdk[excel]" # .xlsx I/O ``` ## Google Sheets ### Read + run + write ```python theme={null} from minerva import Minerva mc = Minerva() # MINERVA_API_KEY from env # SHEET_ID is the long string between `/d/` and `/edit` in your spreadsheet's URL SHEET_ID = "" CREDS = "/path/to/service-account.json" # or a gspread.Client / dict / google Credentials resp = mc.io.enrich_from_sheet( SHEET_ID, credentials=CREDS, sheet_name="Customers", match_condition_fields=["linkedin_url"], ) resp.to_sheet( SHEET_ID, credentials=CREDS, sheet_name="Enriched", ) ``` `resolve_from_sheet` works the same way and returns a `ResolveResponse`. ### Credentials The `credentials=` kwarg accepts whatever's most natural for your environment — the SDK figures out what shape you passed: | You have | Pass | | - | - | | A service-account JSON file | `credentials="/path/to/sa.json"` | | Parsed service-account dict | `credentials={...}` | | A built `google.oauth2 Credentials` | `credentials=creds` | | A built `gspread.Client` | `credentials=gc` | | `GOOGLE_APPLICATION_CREDENTIALS` env var | omit `credentials=` entirely | The env-var fallback matches Google's own conventions, so apps already running with that variable set need no extra config. > [!TIP] > > Default scopes are read-only for `enrich_from_sheet` / `resolve_from_sheet` > / `read_sheet`, and read-write for `write_sheet` / `to_sheet`. If you pass > a pre-built `gspread.Client` or `Credentials`, the SDK uses the scopes you > configured — bring your own if you need something different. ### Field mapping By default the **first row is the header**, and each column name maps 1:1 to an enrich field (`record_id`, `linkedin_url`, `first_name`, `emails`, …). If your sheet has different column names, rename via `field_mapping`: ```python theme={null} mc.io.enrich_from_sheet( sheet_id, credentials=..., field_mapping={ "customer_id": "record_id", "li": "linkedin_url", }, ) ``` Columns not in the mapping pass through unchanged. Empty cells are dropped so pydantic-Optional fields stay `None`. ### Range and tab ```python theme={null} mc.io.enrich_from_sheet(sheet_id, credentials=..., sheet_name="Q2 Customers") mc.io.enrich_from_sheet(sheet_id, credentials=..., range_="A1:F500") ``` Omit `sheet_name` to use the first tab. Omit `range_` to read the whole worksheet. ### Chunking The Data API caps `enrich` and `resolve` at 500 records per call. `mc.io` chunks transparently — pass a 2,000-row sheet, the SDK runs four batches and returns one merged `EnrichResponse` (the `api_request_id` field reflects the last batch). ### Lower-level read/write If you need just the rows (not the API call), use the raw helpers: ```python theme={null} rows = mc.io.read_sheet(sheet_id, credentials=..., sheet_name="Tab") # -> [["record_id", "linkedin_url"], ["1", "https://lnkd.in/a"], …] mc.io.write_sheet( sheet_id, [["col_a", "col_b"], [1, 2], [3, 4]], credentials=..., sheet_name="Tab", range_="A1", # starting cell mode="overwrite", # or "append" ) ``` ## Excel (.xlsx) Same shape as Sheets, but reads from a local file path — no auth required. ```python theme={null} resp = mc.io.enrich_from_excel( "customers.xlsx", sheet_name="Sheet1", match_condition_fields=["linkedin_url"], ) resp.to_excel("enriched.xlsx") ``` If the workbook has more than one sheet, `sheet_name=` is required (we don't pick for you): ```python theme={null} mc.io.enrich_from_excel("workbook.xlsx", sheet_name="Q2 2026") ``` Raw row access works the same way: ```python theme={null} rows = mc.io.read_excel("customers.xlsx") mc.io.write_excel([["a", "b"], [1, 2]], "out.xlsx", sheet_name="Results") ``` ## Writing any response to a sheet `to_sheet()` and `to_excel()` live on every typed response — `EnrichResponse`, `ResolveResponse`, `UsageResponse`, etc. The response is flattened the same way `to_csv()` flattens it (union of keys across all rows, missing cells left blank): ```python theme={null} mc.api.enrich(records).to_sheet(sheet_id, credentials=...) mc.usage.tallies(start="2026-01-01", end="2026-06-01").to_excel("usage.xlsx") ``` ## Errors | Condition | Raises | | - | - | | Extra not installed (`[gsheet]` / `[excel]` missing) | `MinervaValidationError("install minerva-sdk[]")` | | Bad credentials, 401 / 403 from Google | `MinervaAuthError` | | Spreadsheet not found (404) | `MinervaAPIError(status_code=404)` | | Tab not found, malformed sheet, empty rows | `MinervaValidationError` | | Wrong file extension (Excel) | `MinervaValidationError` | | API errors from the underlying enrich/resolve call | Their usual exceptions (`MinervaRateLimitError`, etc.) | ## Setting up a Google service account (one-time) If you don't have one yet: 1. Create a project in [Google Cloud Console](https://console.cloud.google.com/). 2. Enable the **Google Sheets API** for that project. 3. Create a service account, download its JSON key. 4. **Share the target sheet with the service account's email address** (it looks like `name@project.iam.gserviceaccount.com`). Without this step the service account can't see the sheet, even with valid creds. 5. Point `credentials=` at the JSON path, or set `GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json` in your environment. Service accounts are usually the right call for server-side / scheduled runs. For interactive / notebook use where you'd prefer to log in as yourself, build a `gspread.Client` with OAuth and pass it to `credentials=`. # Storage — bulk upload & download Source: https://docs.minerva.io/sdk/guides/storage Move files in and out of your private storage area without writing boto3 by hand. Gated on the [storage] extra. `mc.storage` is a thin wrapper around your private S3 storage area with two well-known directories: * `Incoming/` — files **you send** in. * `Outgoing/` — files **placed for you** to read. `upload*` defaults to `Incoming/`; `download*`, `list*`, and `delete` default to `Outgoing/` so the natural list-then-act loop targets the same direction. Override per call with `direction="incoming"` / `direction="outgoing"`. ```bash theme={null} pip install "minerva-sdk[storage]" ``` ```python theme={null} from minerva import Minerva mc = Minerva() # MINERVA_API_KEY from env ``` ## Single file ```python theme={null} # Upload — defaults to Incoming/ mc.storage.upload("data/customers.csv") # → Incoming/customers.csv mc.storage.upload("data/customers.csv", remote_name="batch-001.csv") # → Incoming/batch-001.csv mc.storage.upload("data/customers.csv", subdir="2026-06-29") # → Incoming/2026-06-29/customers.csv # Download — defaults to Outgoing/ mc.storage.download("results.csv") # → ./results.csv mc.storage.download("sub/inner.csv", local_path="out/inner.csv") # → ./out/inner.csv (creates parent dirs) # Delete — defaults to Outgoing/. Pass direction="incoming" to clean up your own uploads. mc.storage.delete("results.csv") mc.storage.delete("batch-001.csv", direction="incoming") ``` `upload` returns the relative remote key. `download` returns the local `Path` that was written. ## Listing ```python theme={null} for obj in mc.storage.list(): # Outgoing/ by default print(obj.key, obj.size, obj.last_modified) for obj in mc.storage.list(subdir="2026-06"): ... ``` Each `ObjectMeta` carries `key` (relative — pass back to `download` / `delete` as-is), `size`, `last_modified`, and `etag`. ## Bulk Bulk methods run uploads/downloads in parallel — defaults to 8 workers, tune with `max_concurrency=`. Order is preserved; the first error in a batch fails the call. ```python theme={null} # Many files at once mc.storage.upload_many(["a.csv", "b.csv", "c.csv"]) # Whole directory tree, relative paths preserved mc.storage.upload_directory("./batch-2026-06-29") # Sends ./batch-2026-06-29/x.csv → Incoming/x.csv # Sends ./batch-2026-06-29/sub/y.csv → Incoming/sub/y.csv mc.storage.upload_directory("./day", subdir="2026-06-29") # → Incoming/2026-06-29/... # Pull a batch by keys (typically the output of list()) mc.storage.download_many( ["results-1.csv", "sub/inner.csv"], local_dir="./out", ) # List, then download everything — single call mc.storage.download_all(local_dir="./out") ``` ## Credentials Storage credentials are fetched lazily on first call and cached on the client. The SDK auto-refreshes them when they're within \~2 minutes of expiry, so a long-running process can hold one `Minerva()` instance and keep working across hour-long sessions without manual renewal. Construct **one `Minerva()` per process and reuse it** — every fresh instance pays the credential round-trip again. ```python theme={null} creds = mc.storage.get_credentials() print(creds.bucket_name, creds.prefix, creds.aws_session_expiration) # Secrets (aws_secret_access_key, aws_session_token) are hidden from repr # but accessible by attribute. ``` ## Access scope Storage credentials are scoped to your org's directory — the underlying session policy only permits `s3:GetObject` / `s3:PutObject` / `s3:DeleteObject` on `{your_org}/*` keys, and `s3:ListBucket` filtered to the same prefix. Other orgs' data is unreachable regardless of what you pass to the SDK. The SDK additionally rejects path-traversal-shaped keys (`..` segments, absolute paths, backslashes) at the call site for clean local errors — but the real isolation is server-side. ## Errors All storage errors derive from `MinervaStorageError`: | Condition | Raises | | - | - | | `[storage]` extra not installed (`boto3` missing) | `MinervaStorageExtraNotInstalledError` | | Credentials endpoint returned an unexpected shape, missing fields, or unparsable expiry | `MinervaStorageCredentialError` | | Object doesn't exist (404) | `MinervaStorageObjectNotFoundError` — carries `.key` | | Access denied (403) | `MinervaStorageAccessDeniedError` — carries `.key` | | Network / transient S3 failure (5xx, timeouts, …) | `MinervaStorageTransferError` — carries `.original` | | Bad input (non-file path, `..` in key, invalid `direction`, …) | `MinervaValidationError` | ```python theme={null} from minerva import ( MinervaStorageError, MinervaStorageObjectNotFoundError, MinervaStorageAccessDeniedError, MinervaStorageTransferError, ) try: mc.storage.download("missing.csv") except MinervaStorageObjectNotFoundError as e: print(f"no such key: {e.key}") except MinervaStorageError: raise ``` > [!TIP] > > The `[storage]` extra pulls in `boto3` so the base wheel stays small. If > you already have `boto3` in your environment, the extra still wires up > the SDK's lazy-import guard cleanly — install it either way. # Streaming batcher Source: https://docs.minerva.io/sdk/guides/streaming-batcher Feed records one at a time. `Batcher` (sync) and `AsyncBatcher` (async) buffer until the size cap is hit, then auto-fire any callable — enrich, resolve, or your own. `enrich_many` / `resolve_many` work when you have the **whole list** in memory. When records arrive from a stream — a CSV cursor, a SQS poller, a Kafka consumer, a generator — you don't want to materialize everything first. The `Batcher` and `AsyncBatcher` helpers let you `add()` items one at a time. They buffer up to `size`, fire the batch, and drain whatever's left on context exit. They're generic over the callable. The SDK's own `mc.api.enrich` / `mc.api.resolve` fit because they take `list[Record]`. But anything that matches `Callable[[list[T]], R]` plugs in — a DB upsert, a webhook fan-out, a file writer. ## Sync ```python theme={null} from minerva import Minerva, Batcher mc = Minerva() with Batcher(mc.api.enrich, size=100) as b: for row in iter_csv("leads.csv"): b.add(row) for resp in b.results: print(resp.to_df()) ``` ## Async ```python theme={null} from minerva import AsyncMinerva, AsyncBatcher async with AsyncMinerva() as mc: async with AsyncBatcher(mc.api.enrich, size=100) as b: async for row in aiter_kafka_topic("leads"): await b.add(row) for resp in b.results: print(resp.to_df()) ``` By default each filled batch fires as a **background task** — `add` returns immediately and the next batch starts buffering while the previous one is in flight. The context manager's exit awaits all outstanding tasks. Set `block=True` to serialize instead, or `max_concurrency=N` to cap how many run in parallel. ## Custom callables The batcher is not enrich-specific. Drop in any function that takes a `list[T]`: ```python theme={null} def upsert_to_warehouse(rows: list[dict]) -> int: return db.bulk_insert("leads", rows) with Batcher( upsert_to_warehouse, size=500, on_result=lambda n: log.info(f"wrote {n} rows"), ) as b: for row in some_stream(): b.add(row) ``` `on_result` runs after every batch. When set, results are **not** accumulated on `b.results` — the callback is the sink. ### Custom Minerva endpoints via `mc.api.call` If you're hitting a preview / client-specific endpoint that doesn't have a typed wrapper yet, wrap [`mc.api.call`](./custom-endpoints) in a thin function so it matches the `list[T] -> R` shape. You get the same authentication, rate limiting, and `MinervaTransientError` retry as the typed methods: ```python theme={null} def post_to_special(records: list[dict]) -> dict: return mc.api.call("POST", "/v2/your-special-endpoint", json={"records": records}) with Batcher(post_to_special, size=100) as b: for row in iter_stream(): b.add(row) ``` Async equivalent: ```python theme={null} async with AsyncMinerva() as mc: async def post_special(rows: list[dict]) -> dict: return await mc.api.call("POST", "/v2/your-special-endpoint", json={"records": rows}) async with AsyncBatcher(post_special, size=100) as b: async for row in aiter_stream(): await b.add(row) ``` #### Bulk fan-out: 10k records through a custom endpoint Same pattern handles the "I have a big list, fan it out" case — just iterate the list into `add()`. With `max_concurrency` you cap how many batches run in parallel: ```python theme={null} async with AsyncMinerva() as mc: async def post_special(rows: list[dict]) -> dict: return await mc.api.call( "POST", "/v2/your-special-endpoint", json={"records": rows} ) async with AsyncBatcher( post_special, size=500, # batch cap max_concurrency=8, # at most 8 in-flight HTTP calls ) as b: for row in my_10000_rows: await b.add(row) # b.results now has 20 entries (10,000 / 500), one response dict per batch. # If your endpoint returns {"results": [...]} per batch, flatten client-side: all_results = [r for resp in b.results for r in resp["results"]] ``` What happens under the hood for 10,000 rows with `size=500` + `max_concurrency=8`: 1. `await b.add(row)` fills an internal buffer 2. Every 500 rows, the buffer flushes — `post_special` fires as a background task 3. The semaphore caps in-flight HTTP calls at 8; the other 12 queue and run as slots free up 4. `async with` exit awaits all outstanding tasks before returning 5. `b.results` ends up with 20 entries — one per batch, in completion order The SDK's [rate limiter](./rate-limiting) still gates the per-second rate across batches, and [`MinervaTransientError`](./error-handling) wrapping applies — so a connection drop or 5xx on one batch raises and (with the default `swallow_errors=False`) the context exit re-raises from `flush()`. To keep going past per-batch failures, pass `swallow_errors=True` and inspect `b.errors` after exit. #### Why no `mc.api.call_many`? The typed methods (`enrich_many`, `resolve_many`) auto-flatten per-batch results into one merged list, because the SDK knows the response shape. For an arbitrary custom endpoint, the SDK doesn't know which key holds the records — so it can't flatten safely. `AsyncBatcher + mc.api.call` is the equivalent primitive; you flatten client-side once per call site. If you find yourself writing the same `post_special(...)` wrapper in many places, that's a signal to add a typed method on `mc.api.*` for that endpoint (with a pydantic response model) — you'll get auto-flattening, better autocompletion, and validated outputs for free. ## Pydantic validation at `add()` Pass `schema=` to validate every item against a pydantic model before it's queued. The original input is still what gets buffered — pydantic is a shape gate, not a transformer. ```python theme={null} from minerva import Batcher, EnrichRecord with Batcher(mc.api.enrich, size=100, schema=EnrichRecord) as b: for row in iter_csv("leads.csv"): b.add(row) print(b.invalid_count) # how many rows failed the schema print(b.invalid) # [(item, summary), ...] ``` Three policies for the failure path: | `on_invalid` | Behavior on a row that fails `schema.model_validate(item)` | | - | - | | `"warn"` *(default)* | Emits `MinervaValidationWarning`. The row **is still added** — the API is the final arbiter. | | `"skip"` | Emits the warning, **drops** the row, bumps `b.invalid_count`. | | `"raise"` | Raises `MinervaValidationError` from `add()` immediately. | `"warn"` is the default because the SDK shouldn't second-guess the API. If pydantic is stricter than the server, dropping the row hides records the server would have accepted. Flip to `"skip"` when you'd rather keep the batch clean than ship something that might 4xx, or `"raise"` when the pipeline should fail fast on bad input. To silence the warning entirely: ```python theme={null} import warnings from minerva import MinervaValidationWarning warnings.filterwarnings("ignore", category=MinervaValidationWarning) ``` ## Error handling By default, if the batch call raises, the error surfaces from `add()` or `flush()` and aborts the loop. For pipelines that should keep going past a failure, pass `swallow_errors=True`: ```python theme={null} with Batcher(mc.api.enrich, size=100, swallow_errors=True) as b: for row in iter_csv("leads.csv"): b.add(row) print(f"sent {len(b.results)} batches, {len(b.errors)} failed") for e in b.errors: log.warning("batch failed: %s", e) ``` ## What lives on the batcher | Attribute | Meaning | | - | - | | `b.results` | One entry per successful batch — the callable's return value (unless `on_result` is set). | | `b.errors` | One entry per batch that raised (only populated with `swallow_errors=True`). | | `b.invalid` | `(item, summary)` tuples for every row that failed schema validation. | | `b.invalid_count` | Count of `b.invalid`. | | `b.buffered` | How many items are currently in the buffer. | | `b.in_flight` | (`AsyncBatcher` only) background-task count not yet completed. | ## When to reach for `enrich_many` instead | You have… | Use | | - | - | | A finite list in memory | `mc.api.enrich_many(records)` — simpler, fans out concurrently, returns one merged list. | | A stream / cursor / generator | `Batcher` / `AsyncBatcher`. | | A list, but want callback-per-batch | `Batcher` with `on_result=…`. | Both pipe through the same `_request_data` path, so rate-limiting + [`MinervaTransientError`](./error-handling) compose with either choice. # Usage tallies Source: https://docs.minerva.io/sdk/guides/usage Your per-endpoint API usage — how many calls, when, against your key. ```python theme={null} mc.usage.tallies() # all-time mc.usage.tallies(start="2026-05-01", end="2026-05-31") # bounded range ``` ## Parameters **start** `str` ISO date (`"YYYY-MM-DD"`). Inclusive. Omit for no lower bound. **end** `str` ISO date. Inclusive. Omit for no upper bound. **format** `str` (default: "models") `"models"` returns a typed `UsageResponse`; other values pass through to the underlying serializer. ## Response shape ```python theme={null} res = mc.usage.tallies(start="2026-05-01", end="2026-05-31") res.to_dicts() # [ # {"endpoint": "v2/enrich", "count": 1247}, # {"endpoint": "v2/resolve", "count": 318}, # ... # ] res.to_df() # pandas DataFrame (needs [pandas]) res.to_csv("usage.csv") res.to_table() # pretty terminal table (needs [table]) ``` The exact response shape is server-defined; the SDK surfaces whatever list-of-rows the server returns. Use `to_dicts()` for the raw shape, `to_df()` for analysis. ## Common patterns **Post-call audit** — confirm a specific call actually billed: ```python theme={null} res = mc.usage.tallies(start="2026-06-02", end="2026-06-02") for row in res.to_dicts(): print(row) ``` **Monitoring feed** — periodically poll for use in dashboards / alerts: ```python theme={null} import time while True: res = mc.usage.tallies(start=today_iso(), end=today_iso()) send_to_monitoring(res.to_dicts()) time.sleep(3600) ``` # Email validation Source: https://docs.minerva.io/sdk/guides/validate-emails Verify email addresses against the Minerva database. ```python theme={null} mc.api.validate_emails(["test@example.com", "bad@example.invalid"]) ``` Returns a status per email (valid, invalid, unknown) plus any associated profile info. ## Parameters **records** `list[str]` *required* Email-address strings (1–500). **dry\_run** `bool` (default: False) Validate input locally without sending. ## Response shape ```python theme={null} result = mc.api.validate_emails(["test@example.com"]) # { # "results": [ # {"email": "test@example.com", "status": "valid", ...} # ] # } ``` Status values are documented server-side and are forward-compatible. New status values added by the server won't break older clients — match on the strings you know about. ## Validation `dry_run=True` returns the validated `ValidateEmailsRequest` without sending; an empty `records` list raises `MinervaValidationError` locally. See [Validation](/sdk/guides/validation-dry-run). # Validation & dry_run Source: https://docs.minerva.io/sdk/guides/validation-dry-run Validate input locally before any network round-trip — same checks the server runs, available offline. Every input-bearing method accepts `dry_run=True`. It validates your input and returns the exact request that *would* be sent — **without touching the network**: ```python theme={null} from minerva import Minerva, MinervaValidationError mc = Minerva() # Returns the validated request model, no HTTP call. req = mc.api.enrich(records, match_condition_fields=["linkedin_url"], dry_run=True) print(req.model_dump()) # exact wire payload # Invalid input fails fast — before any HTTP call. try: mc.api.enrich([], dry_run=True) # 0 records → must be ≥ 1 except MinervaValidationError as e: print("caught before any API call:", e) ``` Great for checking a batch is well-formed (record limits, allowed `match_condition_fields`, record shape) before spending a call. ## What gets validated locally The local validation enforces the same constraints the server does: * **Record counts** — `enrich` and `resolve` cap at 500 records per call * **Required fields** — `record_id` on every record, etc. * **Field types** — strings where strings expected, lists where lists expected * **Allowed values** — `match_condition_fields` capped at 3, only allowed values What it **doesn't** check (server-only): * Billing eligibility (whether your plan covers this endpoint) * Whether matches will actually be found * Per-row business rules Use `dry_run` for shape; trust the server for substance. ## The request models directly Every method has an underlying pydantic request model — you can construct + validate it yourself if you want: ```python theme={null} from minerva import EnrichRequest req = EnrichRequest.model_validate({ "records": [{"record_id": "1", "linkedin_url": "..."}], "match_condition_fields": ["linkedin_url"], }) # req is a typed model; req.model_dump() is the JSON wire payload. ``` Useful when you want to drive the validation from your own dict-based pipeline, generate a JSON Schema, or pre-validate before queueing the call. ## All input-bearing methods take `dry_run` | Method | Returns when `dry_run=True` | | - | - | | `mc.api.enrich(...)` | `EnrichRequest` | | `mc.api.resolve(...)` | `ResolveRequest` | | `mc.api.get_li_contact_info(...)` | `LiContactInfoRequest` | | `mc.api.validate_emails(...)` | `ValidateEmailsRequest` | | `mc.api.infer_record_country(...)` | `InferCountryRequest` | > [!NOTE] > > `mc.api.call(...)` does not take `dry_run` — there's nothing for the SDK to > validate (the SDK doesn't know the schema of the path you're calling). # Workflows — `mc.workflows.*` Source: https://docs.minerva.io/sdk/guides/workflows Encoded best-practice multi-call recipes. Start with `resolve_then_enrich` — the faster path for going from names/emails to full profiles. The shortest path between "I have a list of names/emails" and "I have full profiles" isn't a single call to `enrich`. It's a two-step pattern: 1. **`/resolve`** — match your records to Minerva PIDs. 2. **`/enrich`** — fetch profiles, keyed *only* by the PIDs from step 1. The second call skips our match pipeline entirely (we already know who they are), so it's faster and cheaper than re-running the whole enrich-by-PII flow. For pipelines that re-process the same person list periodically (monthly hygiene refresh, segment re-materialization, customer data activation), step 1 only needs to run once — cache the PIDs and call `enrich` directly on subsequent runs. `mc.workflows.resolve_then_enrich` is the encoded version of step 1 + 2: ```python theme={null} from minerva import Minerva mc = Minerva() result = mc.workflows.resolve_then_enrich( records=[ {"record_id": "u1", "emails": ["a@example.com"]}, {"record_id": "u2", "emails": ["b@example.com"]}, {"record_id": "u3", "full_name": "Some Person"}, ], ) result.resolved # list[ResolveResult] — PIDs (or None for unmatched) result.enriched # list[EnrichResult] — full profiles, keyed by PID result.unmatched_record_ids # list[str] — record_ids that didn't match ``` The async sibling is `await mc.workflows.resolve_then_enrich(...)` on an `AsyncMinerva` client; same shape. ## What it does for you * Validates the resolve request locally (raises `MinervaValidationError` before any HTTP call). * Splits the resolve results into "matched" + "unmatched" so you don't have to filter manually. * Builds the enrich payload from the matched PIDs only — your original fields (emails, names, etc.) don't get sent on the second call, and the server takes the fast path. * Skips the enrich call entirely if no records resolved (saves a round-trip * your daily quota). ## When to use it vs. `mc.api.enrich` directly | You have… | Use | | - | - | | Names/emails/phones, want profiles | `mc.workflows.resolve_then_enrich(records)` | | Already-known Minerva PIDs (e.g. from a prior run) | `mc.api.enrich(records)` with `minerva_pid` per record | | LinkedIn URLs | `mc.api.enrich(records)` — direct lookup, no resolve needed | ## Caching the resolved PIDs If your workflow repeats (e.g. nightly), cache the `result.resolved` list and short-circuit step 1 on the next run: ```python theme={null} # First run: full pipeline result = mc.workflows.resolve_then_enrich(records) cache.save({r.record_id: r.minerva_pid for r in result.resolved if r.minerva_pid}) # Subsequent runs: enrich by PID directly known_pids = cache.load() enrich_resp = mc.api.enrich( [{"record_id": rid, "minerva_pid": pid} for rid, pid in known_pids.items()] ) ``` That second pattern is what the server is most optimized for — single round trip, no match pipeline, just a profile lookup. # Installation Source: https://docs.minerva.io/sdk/installation pip install minerva-sdk — plus opt-in extras for pandas DataFrames and pretty terminal tables. ```bash theme={null} pip install minerva-sdk ``` The base install pulls in only `httpx` and `pydantic`. Everything else is an opt-in extra so the wheel stays small. ## Extras | Extra | Adds | Why | | - | - | - | | `pandas` | `pandas` | `result.to_df()` returns a DataFrame | | `table` | `tabulate` | `result.to_table()` for pretty terminal output | | `gsheet` | `gspread`, `google-auth` | `mc.io.*_from_sheet` / `to_sheet` for Google Sheets | | `excel` | `openpyxl` | `mc.io.*_from_excel` / `to_excel` for `.xlsx` | | `storage` | `boto3` | `mc.storage.*` for bulk upload / download | | `all` | everything above | One-shot | ```bash theme={null} pip install "minerva-sdk[pandas]" pip install "minerva-sdk[table]" pip install "minerva-sdk[gsheet]" pip install "minerva-sdk[excel]" pip install "minerva-sdk[storage]" pip install "minerva-sdk[all]" ``` > [!NOTE] > > Use quotes around `minerva-sdk[extra]` — zsh interprets `[ ]` as a glob without them. ## Python versions * Required: **3.11+** * Tested: 3.11, 3.12, 3.13, 3.14 The SDK is fully type-annotated (ships `py.typed`). Run `mypy` / `pyright` against your code and you'll get static checking on method args + response shapes for free. ## Verify the install ```bash theme={null} python -m minerva --version # → minerva-sdk 0.0.x python -m minerva # Prints the banner + a usage cheat-sheet. ``` From Python: ```python theme={null} >>> import minerva >>> minerva.__version__ '0.0.x' >>> from minerva import Minerva >>> help(Minerva) # class + method docstrings ``` # Minerva Python SDK Source: https://docs.minerva.io/sdk/introduction One client for the Minerva Data API. Typed end-to-end. Input validation before any call hits the network. The official Python SDK for the Minerva Data API. Identity **resolution**, person **enrichment**, LinkedIn lookup, email validation, country inference, and usage tallies — all from one client, with typed responses and validation built in. > [!NOTE] > > **A Minerva API key is required.** Set `MINERVA_API_KEY` in your environment > or pass `api_key=` to the constructor. See [Authentication](/sdk/authentication) > for where to find your key and how the SDK resolves credentials. > [!NOTE] > > **Early access (alpha).** The interface below is stable; we're hardening the > edges ahead of the public release. Feedback welcome. ## Why this SDK > [card] One client, one credential > > `Minerva(api_key=...)` is the only entry point. Your `x-api-key` goes on > every request. No tokens, no sessions, no rotation logic to manage. > [card] Typed end-to-end > > Every response is a typed pydantic object with IDE autocomplete. Missing > fields fail at type-check, not at runtime. Forward-compatible — new fields > the API adds won't break older clients. > [card] Validate before you spend > > `dry_run=True` validates input locally and tells you exactly what's wrong — > before anything hits the network. Same checks the server runs, available > offline. > [card] Tabular by default > > Any list-shaped result → `to_df()` / `to_csv()` / `to_dicts()` / > `to_table()`. Nested fields flatten for you; missing extras error clearly. > [card] Hardened > > The `Minerva` instance rejects any attribute writes after construction — > typos and accidental tinkering raise `AttributeError` instead of silently > breaking subsequent calls. > [card] Custom-endpoint escape hatch > > `mc.api.call(method, path, …)` for client-specific routes that don't have a > typed wrapper yet. Same auth + error mapping; raw JSON in/out. ## Where to go next > [card] [Quickstart](/sdk/quickstart) > > Five-minute tour — install, set your key, run your first enrichment. > [card] [Authentication](/sdk/authentication) > > Just `MINERVA_API_KEY`. No token exchange. No session state. > [card] [Enrich](/sdk/guides/enrich) > > Full person profiles from a record stub. Up to 500 records per call. > [card] [Custom endpoints](/sdk/guides/custom-endpoints) > > The `mc.api.call(...)` escape hatch for tailored / preview routes. ## Get help fast * `python -m minerva` — banner, version, and a cheat-sheet of the public API. * `help(Minerva)` in a REPL or `Minerva?` in Jupyter — full class + method docstrings. * Reach support with the `api_request_id` carried on every `MinervaAPIError`. # Quickstart Source: https://docs.minerva.io/sdk/quickstart Install, set your API key, run your first enrichment. **1. Install** ```bash theme={null} pip install minerva-sdk ``` Python 3.11+ (tested through 3.14). **2. Set your API key** ```bash theme={null} export MINERVA_API_KEY=mk_live_... ``` The SDK reads `MINERVA_API_KEY` from the environment by default. You can also pass it as a constructor arg (handy in tests / notebooks): ```python theme={null} mc = Minerva(api_key="mk_live_...") ``` **3. Resolve, enrich** ```python theme={null} from minerva import Minerva mc = Minerva() # Resolve — match records to a Minerva PID (lighter / cheaper than enrich) match = mc.api.resolve([ {"record_id": "1", "first_name": "Jane", "last_name": "Doe", "emails": ["jane.doe@example.com"]} ]) for r in match.results: print(r.record_id, r.is_match, r.minerva_pid, r.match_score) # Enrich — full person profiles (up to 500 records per call) people = mc.api.enrich([ {"record_id": "1", "linkedin_url": "https://www.linkedin.com/in/example"} ]) people.to_df() # straight to a pandas DataFrame (needs [pandas]) people.to_csv("out.csv") ``` **4. Explore from the terminal** ```bash theme={null} python -m minerva # banner + cheat-sheet of every namespace python -m minerva --help # argparse help with usage epilog ``` From a REPL: ```python theme={null} >>> from minerva import Minerva >>> help(Minerva) # full class docstring >>> help(Minerva.api) # the data-API namespace ``` ## What you get > [card] [`mc.api`](/sdk/guides/enrich) > > `resolve` · `enrich` · `get_li_contact_info` · `validate_emails` · `infer_record_country` · `call` > [card] [`mc.usage`](/sdk/guides/usage) > > `tallies()` — your per-endpoint API usage > [card] [`mc.status`](/sdk/guides/health) > > `health()` — unauthenticated liveness probe > [card] [`mc.io`](/sdk/guides/spreadsheets) > > `enrich_from_sheet` / `_excel` — run the Data API directly off spreadsheets ## Validate before you call Every input-bearing method accepts `dry_run=True` — validates input locally and returns the exact request that *would* be sent, without spending a credit: ```python theme={null} req = mc.api.enrich(records, dry_run=True) # -> EnrichRequest (nothing sent); inspect req.model_dump() ``` See [Validation & dry\_run](/sdk/guides/validation-dry-run) for the full pattern. # CLI reference Source: https://docs.minerva.io/sdk/reference/cli python -m minerva — a help screen + cheat-sheet for users who installed the SDK and aren't sure where to start. The SDK is primarily a library. The CLI entry point exists so a new user typing `python -m minerva` gets a useful response rather than silence. ```bash theme={null} python -m minerva # banner + cheat-sheet python -m minerva --help # argparse help with usage epilog python -m minerva --version # → minerva-sdk X.Y.Z ``` The cheat-sheet covers: * Credential resolution (constructor args vs env vars) * Quick examples for `mc.api.resolve`, `mc.api.enrich`, `mc.api.call`, `mc.usage.tallies` * The two resource namespaces (`mc.api`, `mc.usage`) * Where to dig deeper (`help(Minerva)` in REPL) ## Env vars the SDK reads | Variable | Purpose | | - | - | | `MINERVA_API_KEY` | Your `x-api-key`. Required if you don't pass `api_key=` to the constructor. | Just the one. The SDK never reads any other env var. > [!TIP] > > For per-method docs, REPL is faster than this docs site — > `help(mc.api.enrich)` shows the exact signature, args, returns, raises, and > an example for one method. # Exception reference Source: https://docs.minerva.io/sdk/reference/errors Every exception the SDK raises, what triggers it, and what context it carries. All SDK exceptions are importable from the top-level package: ```python theme={null} from minerva import ( MinervaError, # base MinervaConfigError, MinervaValidationError, MinervaAuthError, MinervaRateLimitError, MinervaAPIError, MinervaWIPWarning, ) ``` ## `MinervaError` Base for everything the SDK raises. Catch this to handle "any SDK failure" without caring about the specific cause. ## `MinervaConfigError(MinervaError)` Misconfiguration — usually surfaces at first call, not at `Minerva(...)` construction. Fix is always: pass the missing value via constructor arg or env var. ## `MinervaValidationError(MinervaError)` Boundary validation failed — input never left the process. ```python theme={null} try: mc.api.enrich([]) # 0 records — must be ≥ 1 except MinervaValidationError as e: print(e) ``` Raised by the request models (pydantic) when input shape is wrong, by `mc.api.call()` when `path` is empty / doesn't start with `/`, and by every method's preflight when record counts / required fields fail. ## `MinervaAuthError(MinervaError)` 401 / 403 from the server, or no usable credential at all. Common causes: * API key missing — `MINERVA_API_KEY` not set and no `api_key=` passed * API key invalid or revoked * Caller not entitled to the endpoint hit (returned by the server-side authorizer) ## `MinervaRateLimitError(MinervaError)` HTTP 429. **Attributes:** * `.retry_after` — seconds (float) if the server supplied a `Retry-After` header ```python theme={null} try: mc.api.enrich(batch) except MinervaRateLimitError as e: time.sleep(e.retry_after or 1) ``` ## `MinervaAPIError(MinervaError)` Any other non-2xx response from the server. **Attributes:** * `.status_code` — HTTP status (int) * `.api_request_id` — server's trace ID — **quote this when reporting issues** * `.body` — parsed response body if available ```python theme={null} try: mc.api.enrich(records) except MinervaAPIError as e: log.error("Minerva %s: %s", e.status_code, e.api_request_id) ``` **HTTP 402 — record export capacity exhausted.** This raises `MinervaInsufficientCreditsError`, a `MinervaAPIError` subclass. Its `.details` contains `records_available` and `records_requested`: ```python theme={null} except MinervaInsufficientCreditsError as e: details = e.details or {} print(f"{details.get('records_available')} records available, " f"requested: {details.get('records_requested')}") ``` ## `MinervaWIPWarning` *(warning, not an error)* Emitted via `warnings.warn` when you exercise an SDK feature that ships for forward-compat but isn't fully GA. The feature still runs; the warning just signals "this isn't GA, behaviour may change." Inherits from `UserWarning`, so the standard `warnings` machinery applies: ```python theme={null} import warnings from minerva import MinervaWIPWarning # Suppress wholesale: warnings.filterwarnings("ignore", category=MinervaWIPWarning) # Or turn it into an error to catch every use during development: warnings.filterwarnings("error", category=MinervaWIPWarning) ``` No methods currently emit it — it's exported infrastructure for future use. # Minerva SFTP Source: https://docs.minerva.io/sftp/introduction Connect to Minerva, find the right folder, and upload your files with Cyberduck, FileZilla, or a terminal. Minerva SFTP is a secure place to send us your data files and pick up files we prepare for you. You can use a desktop app to drag and drop files from your computer, or follow the [terminal instructions](#send-files-from-a-terminal-optional) below. **To send us data: connect, open `Incoming`, and upload your files.** The steps below walk you through the process. ## Connect ### Get your connection details You'll need your organization's **Minerva API key**, which serves as your SFTP password. To find it, sign in at [app.minerva.io](https://app.minerva.io), click your organization name in the bottom-left, open the three-dot menu, and choose **Settings → API**. Copy the key. If you don't have access, ask your Minerva contact for help. | Setting | What to enter | | - | - | | Server / Host | `sftp.minerva.io` | | Port | `22` | | Protocol | **SFTP** | | Username / User | `sftp-user` | | Password | Your organization's **Minerva API key** | Enter `sftp-user` exactly as shown; you don't need to create a separate SFTP account. Use the API key in the password field, rather than your Minerva sign-in password. Keep the key private, just as you would a password. ### Connect with a desktop app Choose either [Cyberduck](https://cyberduck.io/) or [FileZilla Client](https://filezilla-project.org/download.php?type=client). You only need one. Install it, then follow the matching tab below. > [tab] Cyberduck > > 1. Open Cyberduck and choose **File → Open Connection**. > 2. In the connection-type menu, select **SFTP (SSH File Transfer Protocol)**. > 3. Enter **Server** `sftp.minerva.io`, **Port** `22`, and **Username** `sftp-user`. > 4. Paste your Minerva API key into **Password**. > 5. Click **Connect**. Once connected, you should see the `Incoming` and `Outgoing` folders. > [tab] FileZilla > > 1. Open FileZilla and choose **File → Site Manager**. > 2. Click **New site** and name it **Minerva**. > 3. Set **Protocol** to **SFTP - SSH File Transfer Protocol**. > 4. Enter **Host** `sftp.minerva.io` and **Port** `22`. > 5. Set **Logon Type** to **Ask for password** and enter **User** `sftp-user`. > 6. Click **Connect**. When prompted for a password, paste your Minerva API key and confirm. > 7. On the right side, under **Remote site**, you should see the `Incoming` and `Outgoing` folders. The left side shows files on your computer. The first time you connect, the app may ask you to trust the server's identity (its "host key"). Ask your Minerva contact to confirm the fingerprint shown in that message before accepting it. ## Directory layout A directory is simply a folder. After connecting, you'll see these two folders: | Folder | What it's for | What you do | | - | - | - | | `Incoming` | Files you send to Minerva | **Upload your data here.** | | `Outgoing` | Files Minerva sends back to you | Open this folder to download your results when they're ready. | Double-click `Incoming` to open it before uploading. For example, if you send a file named `customers.csv`, it should appear inside that folder as `Incoming/customers.csv`. ## Send your files Use the file format and naming instructions agreed with your Minerva contact. If you're unsure which files to send or how to format them, check with your contact before uploading. > [tab] Cyberduck > > 1. In the connected Cyberduck window, double-click **Incoming**. > 2. Open **Finder** on Mac or **File Explorer** on Windows and find the files you want to send. > 3. Drag the files into the open `Incoming` folder in Cyberduck. You can also choose **File → Upload** and select the files. > 4. Keep Cyberduck open until every upload has finished successfully. Check the **Transfers** window, or the status at the bottom of the main Cyberduck window if the uploads aren't listed under Transfers. > 5. Refresh the folder listing and check that your files appear inside `Incoming`. > [tab] FileZilla > > 1. On the **right side** (Minerva's folders), double-click **Incoming**. > 2. On the **left side** (your computer), find the files you want to send. > 3. Drag the files from the left side into the open `Incoming` folder on the right. > 4. Keep FileZilla open until your files appear under **Successful transfers** at the bottom. Check **Failed transfers** for any uploads that need to be retried. > 5. Refresh the right-hand folder listing and check that your files appear inside `Incoming`. **Your files have been sent when the app reports a successful transfer and you can see them in `Incoming`.** You can then disconnect or close the app. A successful upload confirms file delivery; follow the processing and results timeline agreed with your Minerva contact. Let your Minerva contact know which filenames you uploaded and what you'd like us to do with them, unless you've already arranged a recurring delivery process. When Minerva has prepared files for you, you'll find them in `Outgoing`. ### Send files from a terminal (optional) On macOS or Linux, you can upload with the `sftp` command instead of a desktop app. These examples send a file named `customers.csv` from your Downloads folder. Replace the folder and filename with your own. Before starting, rename files containing `*`, `?`, `[` or `]` — for example, change `report[1].csv` to `report-1.csv`. SFTP treats those characters as filename patterns even inside quotes. Use the renamed file in both the upload and verification commands below. 1. Open **Terminal** and go to the folder on your computer that contains your file: ```bash theme={null} cd ~/Downloads ``` 2. Connect to Minerva: ```bash theme={null} sftp -P 22 -o PasswordAuthentication=yes -o PubkeyAuthentication=no sftp-user@sftp.minerva.io ``` On your first connection, you may be asked to confirm the server's fingerprint. Confirm it with your Minerva contact before typing `yes`. When asked for a password, paste your **Minerva API key** and press **Enter**. Nothing appears while you enter the password; this is normal. 3. Once you see `sftp>`, upload your file to `Incoming`: ```text theme={null} put "customers.csv" Incoming/ ``` Type only the command shown above; `sftp>` is the prompt, not part of the command. The file is copied from your computer to Minerva. Keep the quotes if your filename contains spaces. Uploading a file with the same name as an existing file in `Incoming` replaces it, so use a new filename unless you intend to update the earlier delivery. 4. Wait for the upload to finish and the `sftp>` prompt to return without an error. Then check that the file is in Minerva's folder: ```text theme={null} ls -l Incoming/customers.csv ``` Replace `customers.csv` with the filename you uploaded, using quotes around the full path if it contains spaces. The listing shows the file's name and size. Repeat `put` and this check for each additional file. 5. When all files have uploaded, disconnect: ```text theme={null} bye ``` Your files are now in `Incoming`. Let your Minerva contact know which files you sent, unless you've already arranged a recurring delivery process. ### Need help? * **Can't connect?** Check that the protocol is **SFTP**, the port is `22`, and the password is your Minerva API key. Copy the key again if needed. * **Upload failed or stopped?** Reconnect, open `Incoming`, and retry the failed files. Wait for the app to confirm success. * **Asked to replace an existing file?** Only replace it if you intend to update the earlier delivery. Otherwise, cancel and check with your Minerva contact. * **Still stuck?** Share the error message and filename with your Minerva contact. Keep your API key out of messages and screenshots.