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

# Get a search

> Read the current status and progress counters for a search. The example shows a completed search. While terminal is false, continue polling. Retrieve the answers from `GET /search/{id}/results`.

Read a search's status and progress using the `id` returned at creation.

`completed` means processing has finished. Read the answers from [Get search results](https://www.thred.dev/api-reference/search-results.md); results are also available while the search is running.


## OpenAPI

````yaml api-reference/openapi.json GET /search/{id}
openapi: 3.0.3
info:
  title: Thred API
  version: 2.0.0
  description: >-
    Retrieve information over the phone for your app or AI assistant. Submit a
    search query and read answers asynchronously, with source details and
    supporting evidence. API keys select workspace and environment.
servers:
  - url: https://api.thred.dev
    description: Thred API
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Verify the workspace and environment selected by your API key.
  - name: Usage
    description: Read daily operational usage.
  - name: Health
    description: Check public API availability.
  - name: Search
    description: >-
      Search for answers over the phone, with source details and supporting
      evidence.
paths:
  /search/{id}:
    get:
      tags:
        - Search
      summary: Get a search
      description: >-
        Read the current status and progress counters for a search. The example
        shows a completed search. While terminal is false, continue polling.
        Retrieve the answers from `GET /search/{id}/results`.
      operationId: getSearch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^search_[a-z0-9-]+$
          description: Search ID returned by POST /search.
          example: search_6c479a30-cf06-4dba-8dc9-2d2893bbc64f
      responses:
        '200':
          description: Current search status and progress counters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Search'
              example:
                id: search_6c479a30-cf06-4dba-8dc9-2d2893bbc64f
                query: Where can I buy a Nintendo Switch 2 in Austin today?
                status: completed
                environment: development
                identity:
                  name: AI assistant
                call_reason: public
                requested_calls: 2
                selected_businesses: 2
                attempted_calls: 2
                answered_calls: 2
                published_results: 2
                discovery_shortfall: 0
                created_at: '2026-11-12T15:00:00Z'
                deadline_at: '2026-11-12T15:30:00Z'
                finished_at: '2026-11-12T15:03:10Z'
                terminal: true
                cancellation_requested: false
                stop_reason: null
                error: null
          headers:
            X-Request-ID:
              description: >-
                Server-generated request identifier for correlating this
                response.
              schema:
                type: string
                format: uuid
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    Search:
      type: object
      required:
        - id
        - query
        - status
        - environment
        - identity
        - call_reason
        - requested_calls
        - selected_businesses
        - attempted_calls
        - answered_calls
        - published_results
        - discovery_shortfall
        - created_at
        - deadline_at
        - finished_at
        - terminal
        - cancellation_requested
        - stop_reason
        - error
      properties:
        id:
          type: string
          pattern: ^search_[a-z0-9-]+$
          description: Search ID returned when the request was accepted.
          example: search_6c479a30-cf06-4dba-8dc9-2d2893bbc64f
        query:
          type: string
          example: Where can I buy a Nintendo Switch 2 in Austin today?
        status:
          type: string
          enum:
            - discovering
            - running
            - canceling
            - completed
            - failed
            - canceled
            - expired
          description: >-
            Current search state. completed, failed, canceled, and expired are
            terminal.
        environment:
          type: string
          enum:
            - development
            - production
        identity:
          type: object
          additionalProperties: false
          required:
            - name
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 100
            url:
              type: string
              format: uri
              description: >-
                HTTPS website without embedded credentials, to share when
                relevant.
              minLength: 1
            description:
              type: string
              maxLength: 1000
              minLength: 1
        call_reason:
          type: string
          enum:
            - public
            - customer
        requested_calls:
          type: integer
          minimum: 1
          maximum: 100
          description: The call-attempt limit supplied in the request results field.
        selected_businesses:
          type: integer
          minimum: 0
          description: Number of selected sources.
        attempted_calls:
          type: integer
          minimum: 0
          description: Number of sources where starting a call was attempted.
        answered_calls:
          type: integer
          minimum: 0
          description: >-
            Calls answered by the destination, including automated answering
            systems.
        published_results:
          type: integer
          minimum: 0
          description: >-
            Number of published result entries available from the results
            endpoint.
        discovery_shortfall:
          type: integer
          nullable: true
          minimum: 0
          description: >-
            Requested calls minus selected sources, bounded at zero. Null until
            source selection has finished.
        created_at:
          type: string
          format: date-time
        deadline_at:
          type: string
          format: date-time
          description: >-
            New dialing stops after 30 minutes. Active calls are canceled;
            post-call processing may finish later.
        finished_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the search reached a terminal state; null while work is in
            progress.
        terminal:
          type: boolean
          description: Whether all work has settled and no more results will be published.
        cancellation_requested:
          type: boolean
          description: Whether cancellation was requested for this search.
        stop_reason:
          type: string
          nullable: true
          description: >-
            Reason work was stopped early, when present; null for normal
            completion.
        error:
          type: object
          nullable: true
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          description: >-
            Search-level failure details, or null when no search-level error was
            recorded.
      example:
        id: search_6c479a30-cf06-4dba-8dc9-2d2893bbc64f
        query: Where can I buy a Nintendo Switch 2 in Austin today?
        status: completed
        environment: development
        identity:
          name: AI assistant
        call_reason: public
        requested_calls: 2
        selected_businesses: 2
        attempted_calls: 2
        answered_calls: 2
        published_results: 2
        discovery_shortfall: 0
        created_at: '2026-11-12T15:00:00Z'
        deadline_at: '2026-11-12T15:30:00Z'
        finished_at: '2026-11-12T15:03:10Z'
        terminal: true
        cancellation_requested: false
        stop_reason: null
        error: null
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
          description: >-
            Request-level error details with a machine-readable code and a
            message.
  responses:
    Unauthorized:
      description: >-
        Missing, malformed, invalid, revoked, or environment-mismatched bearer
        API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: >-
        No matching search in this key’s workspace and environment, or the
        endpoint does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: >-
        The service or required environment configuration is unavailable. Codes
        include calling_unavailable, environment_unavailable, not_configured,
        and backend_unavailable. Inspect error.code and error.message.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Thred API key
      description: >-
        Send Authorization: Bearer <THRED_API_KEY>. Development keys begin
        thr_dev_; Production keys begin thr_prod_. Each key is scoped to a
        workspace and environment. Keep secrets on your server.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.