External API docs

Find company emails

Submit an async batch to discover shared company inboxes (info@, support@, sales@…) for a known domain.

Overview

Use this endpoint when you have a company domain and want its generic mailboxes — the info@, support@, sales@ style addresses. This is NOT the endpoint for finding individuals; for that use find decision makers or enrich known people.

Each request submits a batch of 1 to 100 tasks. Submission returns immediately with a batch_id; results are fetched via the standard batch → task flow.

Before you start

Make sure you have:

  • an Openmart account
  • an API key
  • a tool to send API requests, such as Postman or curl

Authentication: send your key in the X-API-Key header. Authorization: Bearer <key> is also accepted.

Submission latency. Every request to this route sleeps for about 26 seconds before the server processes it (including when the body is invalid). This is a deliberate throttle for downstream concurrency. Make sure your client timeout is at least 60 seconds.

This is an asynchronous workflow. After submit, follow: check batch status, get task IDs, then get task results.

1

Submit a batch of email lookups

Endpoint
POST https://api.openmart.ai/api/v1/task/batch/lookup_business_email

Parameters

Parameter
domain
Type
string
Required
Yes
Example
"milvali.com"
Description
Company root domain.
Parameter
company_name
Type
string
Required
Yes
Example
"Milvali"
Description
Company display name. Required by the validator — even though the Go type is a pointer, empty/nil fails.
Parameter
city / state / country
Type
string
Required
No
Example
"San Francisco" / "CA" / "US"
Description
Optional company-location narrowing when multiple companies share a name.
Parameter
tracking_id
Type
string
Required
No
Example
"milvali-emails"
Description
Your correlation ID. Echoed back when you fetch the task result.

cURL request

cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[
    {
      "domain": "milvali.com",
      "company_name": "Milvali",
      "city": "San Francisco",
      "state": "CA",
      "country": "US",
      "tracking_id": "milvali-emails"
    }
  ]'

Submission response

JSON
{
  "batch_id": "2fc8b627-1111-2222-3333-123456789abc",
  "submit_for": "lookup_people",
  "status": {
    "processing": 1,
    "completed": 0,
    "errored": 0,
    "total": 1,
    "batch_ready": false
  }
}
Response element
batch_id
Description
UUID for the submitted batch. Use this with the polling endpoints.
Response element
submit_for
Description
Task type echoed back. Either "lookup_people" or "lookup_business_email" (depending on which endpoint you called).
Response element
status.processing / completed / errored / total
Description
Per-task counts. On submit, everything starts in processing.
Response element
status.batch_ready
Description
true once processing == 0. Keep polling GET /api/v1/task/batch/{batch_id}/status until this flips to true.

Per-task result (via GET /api/v1/task/{task_id})

Once the batch is ready, fetching each task ID returns:

JSON
{
  "task_id": "2fc8b627-aaaa-bbbb-cccc-0011aabbccdd",
  "status": "COMPLETED",
  "tracking_id": "milvali-emails",
  "data": [
    { "email": "info@milvali.com",    "status": "VALID" },
    { "email": "support@milvali.com", "status": "VALID" }
  ]
}

data is an array of {email, status} records.

After submission: get your results

Submission just enqueues the batch. To retrieve results:

  1. Poll GET /api/v1/task/batch/{batch_id}/status until batch_ready is true.
  2. Call GET /api/v1/task/batch/{batch_id}/task_ids?status=COMPLETED to list task IDs that finished.
  3. For each task ID, call GET /api/v1/task/{task_id} to read data — the task-specific result payload.

All request parameters

Request body is a JSON array of 1–100 task objects for POST /api/v1/task/batch/lookup_business_email. Batch-size errors return 400 with {"detail":"the number of tasks in each batch should be between 1 and 100"}.

Per-task fields

Each item in the batch array is one task. Submit 1 to 100 tasks per request.

domainstringRequired: Yes
Example: "milvali.com"

Company root domain. Drives the lookup. Missing → 400 detail:"Domain is required".

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali"}]'
company_namestringRequired: Yes
Example: "Milvali"

Company display name. Marked required by the validator. Missing → 400 detail:"CompanyName is required".

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali"}]'
citystringRequired: No
Example: "San Francisco"

Optional company-location narrowing.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali","city":"San Francisco"}]'
statestringRequired: No
Example: "CA"

Optional company-location narrowing.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali","state":"CA"}]'
countrystringRequired: No
Example: "US"

Optional company-location narrowing.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali","country":"US"}]'
tracking_idstringRequired: No
Example: "milvali-emails"

Caller-supplied correlation ID. Echoed back on task read. Useful for reconciling async results with your local records.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali","tracking_id":"milvali-emails"}]'
notify_urlstring (URL)Required: No
Example: "https://your.webhook/endpoint"

Optional webhook URL. Must be a valid URL when present (validator tag omitempty,url).

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v1/task/batch/lookup_business_email \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '[{"domain":"milvali.com","company_name":"Milvali","notify_url":"https://your.webhook/endpoint"}]'
# Find Company Emails

## Endpoint

POST https://api.openmart.ai/api/v1/task/batch/lookup_business_email

## Description

Submit an async batch to discover shared company mailboxes (info@,
support@, sales@…) for a known domain. Not for individuals — for those
use find_people or lookup_people.

Submission enqueues tasks and returns immediately with a batch_id.
Fetch results via the standard batch → task flow.

## Authentication

- `X-API-Key: <your_api_key>` (recommended)
- `Authorization: Bearer <your_api_key>` (also accepted)

## Latency

This route sleeps ~26 seconds before the handler runs, even when the
body is invalid (deliberate concurrency throttle). Use a client
timeout of at least 60s.

## Request body

JSON array of 1–100 task objects. Per-task fields:

- `domain` — required, company root domain.
- `company_name` — required (validator rejects nil/empty), company display name.
- `city`, `state`, `country` — optional, narrow when company names clash.
- `tracking_id` — optional, echoed back on task read.
- `notify_url` — optional, must be a valid URL.

Batch-size errors → 400 `{"detail":"the number of tasks in each batch should be between 1 and 100"}`.
Missing required fields → 400 `{"detail":"<field> is required"}`.

## Example Request

```bash
curl -X POST "https://api.openmart.ai/api/v1/task/batch/lookup_business_email" \
  -H "Accept: application/json" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "domain": "milvali.com",
      "company_name": "Milvali",
      "tracking_id": "milvali-emails"
    }
  ]'
```

## Submission Response

```json
{
  "batch_id":   "2fc8b627-1111-2222-3333-123456789abc",
  "submit_for": "lookup_business_email",
  "status":     { "processing": 1, "completed": 0, "errored": 0, "total": 1, "batch_ready": false }
}
```

## Async workflow

1. Submit → receive batch_id.
2. Poll `GET /api/v1/task/batch/<batch_id>/status` until
   `batch_ready == true`.
3. List task IDs with `GET /api/v1/task/batch/<batch_id>/task_ids?status=COMPLETED`.
4. For each task ID: `GET /api/v1/task/<task_id>`. `data` is an array
   of `{email, status}`.

## Errors

- 400 — JSON bind / batch-size / per-task validator failure (`{"detail":"..."}`)
- 401 — missing or invalid API key
- 402 — credit limit reached
- 403 — banned user
- 500 — internal failure