Create Discovery Task
Create a new Deep Search task.
Overview
This endpoint creates a Deep Search task and returns a task ID immediately. Deep Search is the asynchronous discovery path for when indexed similarity and firmographic filters fall short.Example request
Key parameters
query(required): Natural-language description of companies to find.desired_num_results(optional): target result count; default100, min1, max250.auto_data_sources(optional): defaulttrue.data_sources(optional): ignored whenauto_data_sources=true.criteria(optional): explicit criterion definitions; each is graded 1-5 in results. If omitted, criteria are inferred fromquery.exclude_domains(optional): domains or URLs to exclude from results. Server normalizes each entry to its registered domain (https://www.Acme.com/about→acme.com). Duplicates are collapsed.exclude_task_ids(optional): up to 100 IDs of completed (status = "done") Deep Search tasks. The visible (returned) companies from those tasks are added to the exclusion set at creation time. Tasks must be owned by you (or someone in your organization).
exclude_domains ∪ visible results of exclude_task_ids) is capped at 1000 unique domains. The resolved list is stored on the task and returned in the response as exclude_domains.
Endpoint behavior
- This call creates the task and returns immediately. Use the task ID to poll status and read results.
- Every Deep Search result includes criteria and scores. If you omit
criteria, Extruct generates them for you. If you providecriteria, those are used instead. exclude_*inputs are resolved once at creation time and frozen on the task. Resuming or re-reading the task uses the same resolved set — references are not re-evaluated later.- Use Get Task to monitor progress and Get Task Results to review the companies.
Excluding prior results
A common pattern is to run a follow-up Deep Search that skips companies already returned by an earlier run:Success signal
A successful response includes taskid and initial status. Save id and use it with task/status/results endpoints.
Common errors
401 Unauthorized
Check that your header is Authorization: Bearer ${EXTRUCT_API_TOKEN}.
400 Bad Request
Returned when an exclude_task_ids entry references a task that is not in status = "done".
403 Forbidden
Returned when an exclude_task_ids entry references a task you do not own (and that is not owned by your organization).
404 Not Found
Returned when an exclude_task_ids entry references a task that does not exist.
422 Unprocessable Entity
Common causes:
- Invalid JSON or unsupported fields.
desired_num_resultsoutside1..250.- An entry in
exclude_domainsthat cannot be parsed as a domain. - The resolved exclusion set exceeds the 1000-domain cap. Reduce
exclude_domainsorexclude_task_ids.
Related endpoints
Related guides
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Ideal description of companies to find
Target number of results for this task. Maximum is 250.
1 <= x <= 250Automatically determine best data sources based on query
Manual data source selection (ignored if auto_data_sources=True)
web_search, linkedin, maps Optional criteria for evaluating discovered companies. Each criterion will be graded on a 1-5 scale.
Domains (or URLs) of companies the run must not return. Normalized server-side to registered domains.
IDs of completed (DONE) Deep Search tasks whose returned companies must be excluded from the run. Up to 100 tasks. Tasks must belong to the caller (or their organization).
100Response
Successful Response
created, in_progress, done, failed Total number of company candidates discovered from search
Number of candidates enriched with company profiles
Number of candidates that had criteria evaluation completed
Total number of results
web_search, linkedin, maps The resolved, sorted list of registered domains that were excluded from this run (union of exclude_domains and the visible results of exclude_task_ids at creation time). Capped at 1000.