Skip to main content
POST
/
v1
/
discovery_tasks
Create Discovery Task
curl --request POST \
  --url https://api.extruct.ai/v1/discovery_tasks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "desired_num_results": 100,
  "table": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "run": false,
    "columns": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "auto_import": false
  },
  "auto_data_sources": true,
  "data_sources": [
    "web_search"
  ],
  "criteria": [
    {
      "key": "<string>",
      "name": "<string>",
      "criterion": "<string>"
    }
  ]
}
'
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "status": "created",
  "query": "<string>",
  "desired_num_results": 123,
  "is_exhausted": false,
  "num_results_discovered": 0,
  "num_results_enriched": 0,
  "num_results_evaluated": 0,
  "num_results": 0,
  "table_id": "<string>",
  "auto_data_sources": true,
  "data_sources": [
    "web_search"
  ],
  "criteria": [
    {
      "key": "<string>",
      "name": "<string>",
      "criterion": "<string>"
    }
  ]
}

Overview

This endpoint creates a Deep Search task and returns a task ID immediately. Deep Search is the asynchronous discovery path for cases where indexed similarity and firmographic filters are not enough.

Example request

export EXTRUCT_API_TOKEN="YOUR_API_TOKEN"

curl -X POST "https://api.extruct.ai/v1/discovery_tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${EXTRUCT_API_TOKEN}" \
  -d '{
    "query": "vertical SaaS companies serving freight forwarding",
    "desired_num_results": 100
  }'

Key parameters

  • query (required): Natural-language description of companies to find.
  • desired_num_results (optional): target result count; default 100, min 1, max 250.
  • auto_data_sources (optional): default true.
  • data_sources (optional): ignored when auto_data_sources=true.
  • criteria (optional): explicit criterion definitions; each is graded 1-5 in results. If omitted, criteria are inferred from query.

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 provide criteria, those are used instead.
  • Use Get Task to monitor progress and Get Task Results to review the companies.

Success signal

A successful response includes task id 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}.

422 Unprocessable Entity

Common causes are invalid JSON, unsupported fields, or desired_num_results outside 1..250. Validate body first:
echo '<json-body>' | jq empty

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required

Ideal description of companies to find

desired_num_results
integer
default:100

Target number of results for this task. Maximum is 250.

Required range: 1 <= x <= 250
table
TableForDiscoveryTaskInput · object
auto_data_sources
boolean
default:true

Automatically determine best data sources based on query

data_sources
enum<string>[] | null

Manual data source selection (ignored if auto_data_sources=True)

Available options:
web_search,
linkedin,
maps
criteria
CriterionDefinition · object[] | null

Optional criteria for evaluating discovered companies. Each criterion will be graded on a 1-5 scale.

Response

Successful Response

id
string
required
created_at
string<date-time>
required
status
enum<string>
required
Available options:
created,
in_progress,
done,
failed
query
string
required
desired_num_results
integer
required
is_exhausted
boolean
default:false
num_results_discovered
integer
default:0

Total number of company candidates discovered from search

num_results_enriched
integer
default:0

Number of candidates enriched with company profiles

num_results_evaluated
integer
default:0

Number of candidates that had criteria evaluation completed

num_results
integer
default:0

Total number of results

table_id
string | null
auto_data_sources
boolean
default:true
data_sources
enum<string>[] | null
Available options:
web_search,
linkedin,
maps
criteria
CriterionDefinition · object[] | null