> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extruct.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> Get a Deep Search task by ID.

# Get Discovery Task

## Overview

This endpoint returns the current state of a Deep Search task.
It is the primary status endpoint for polling progress, checking counters, and seeing whether the task is exhausted.

## Example request

```bash theme={null}
export EXTRUCT_API_TOKEN="YOUR_API_TOKEN"
export TASK_ID="YOUR_TASK_ID"

curl --get "https://api.extruct.ai/v1/discovery_tasks/${TASK_ID}" \
  -H "Authorization: Bearer ${EXTRUCT_API_TOKEN}"
```

## Key parameters

* `task_id` (required): Task identifier returned by create-task.

Track these fields while polling:

* `status`
* `is_exhausted`
* `num_results_discovered`
* `num_results_enriched`
* `num_results_evaluated`
* `num_results`

Interpret them like this:

* `num_results_discovered`: candidates gathered from the selected data sources.
* `num_results_enriched`: discovered candidates that passed the relevance pre-filter and were enriched with company profiles.
* `num_results_evaluated`: enriched candidates that have been fully scored across all criteria.
* `num_results`: evaluated candidates currently counted as high-fit, meaning at least 75% of criteria are graded 4 or 5.

## Success signal

The task is complete when `status=done` or `is_exhausted=true`.

## Common errors

### `401 Unauthorized`

Check that your header is `Authorization: Bearer ${EXTRUCT_API_TOKEN}`.

### `404 Not Found`

The task ID is invalid or unavailable in your workspace. Re-check `TASK_ID` from create-task response.

### `status=failed`

The task did not complete. Inspect returned error details, then retry create-task or use resume if appropriate.

## Related endpoints

* [Get Task Results Endpoint](/api-reference/discover/get-company-discovery-task-results)
* [Resume Task Endpoint](/api-reference/discover/resume-company-discovery-task)

## Related guides

* [Deep Search](/api-guides/search/deep-search)


## OpenAPI

````yaml get /v1/discovery_tasks/{task_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v1/discovery_tasks/{task_id}:
    get:
      tags:
        - company-discovery
      summary: Get Discovery Task
      operationId: get_discovery_task_v1_discovery_tasks__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryTaskOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DiscoveryTaskOutput:
      properties:
        id:
          type: string
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        status:
          $ref: '#/components/schemas/Status'
        query:
          type: string
          title: Query
        desired_num_results:
          type: integer
          title: Desired Num Results
        is_exhausted:
          type: boolean
          title: Is Exhausted
          default: false
        num_results_discovered:
          type: integer
          title: Num Results Discovered
          description: Total number of company candidates discovered from search
          default: 0
        num_results_enriched:
          type: integer
          title: Num Results Enriched
          description: Number of candidates enriched with company profiles
          default: 0
        num_results_evaluated:
          type: integer
          title: Num Results Evaluated
          description: Number of candidates that had criteria evaluation completed
          default: 0
        num_results:
          type: integer
          title: Num Results
          description: Total number of results
          default: 0
        table_id:
          anyOf:
            - type: string
            - type: 'null'
        auto_data_sources:
          type: boolean
          title: Auto Data Sources
          default: true
        data_sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/DiscoveryDataSource'
              type: array
            - type: 'null'
        criteria:
          anyOf:
            - items:
                $ref: '#/components/schemas/CriterionDefinition'
              type: array
            - type: 'null'
        exclude_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exclude Domains
          description: >-
            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.
      type: object
      required:
        - id
        - created_at
        - status
        - query
        - desired_num_results
      title: DiscoveryTaskOutput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Status:
      type: string
      enum:
        - created
        - in_progress
        - done
        - failed
      title: Status
    DiscoveryDataSource:
      type: string
      enum:
        - web_search
        - linkedin
        - maps
      title: DiscoveryDataSource
    CriterionDefinition:
      properties:
        key:
          type: string
          pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
          title: Key
          description: Unique identifier for this criterion (e.g., "is_ai_company")
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Human-readable name for this criterion (e.g., "AI Company")
        criterion:
          type: string
          maxLength: 500
          minLength: 10
          title: Criterion
          description: The actual criterion text to evaluate against companies
      type: object
      required:
        - key
        - name
        - criterion
      title: CriterionDefinition
      description: Definition of a criterion for evaluating companies in discovery tasks
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````