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.
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".
# 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