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

# Poll TAM Builder Results

> Poll a TAM build job for its status, manifest, live progress, and one page of results. Call repeatedly until `status` is `completed` (or `cancelled` / `failed`), paginating with `cursor` / `next_cursor`. While running, `processed` and `bands_done` advance as each sub process completes and its companies are written.



## OpenAPI

````yaml agent-primitives/openapi.json GET /api/v1/tam/build/{job_id}
openapi: 3.1.0
info:
  title: OpenFunnel Agent Primitives
  version: 1.0.0
servers:
  - url: https://api.openfunnel.dev
security: []
paths:
  /api/v1/tam/build/{job_id}:
    get:
      tags:
        - Poll TAM Builder Results
      summary: Poll TAM Builder Results
      description: >-
        Poll a TAM build job for its status, manifest, live progress, and one
        page of results. Call repeatedly until `status` is `completed` (or
        `cancelled` / `failed`), paginating with `cursor` / `next_cursor`. While
        running, `processed` and `bands_done` advance as each sub process
        completes and its companies are written.
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
          description: The `job_id` returned by the TAM build submit endpoint.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
          description: >-
            Page to read, e.g. `page_0003` (use `next_cursor` from the previous
            response). Omit for the first page.
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      responses:
        '200':
          description: Job status, manifest, live progress, and one page of results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TamBuildJobResponse'
              example:
                job_id: 8a8e8a97-8192-48ff-849a-d8a96e949732
                status: completed
                manifest:
                  pages: 219
                  page_size: 100
                  unique_count: 21815
                  partial: false
                  degraded: false
                  ranked: true
                  stop_reason: null
                  credits_consumed: 21815
                error_message: null
                rows:
                  - name: Acme Observability
                    domain: acme-observe.com
                    linkedin_url: https://www.linkedin.com/company/acme-observe
                    headquarters: San Francisco, California, United States
                    match_reason: >-
                      Provides "cloud observability" and "application
                      performance monitoring" tooling.
                    match_score: 92
                    source_band: 201-1000
                    source_query: cloud observability and monitoring tools
                    employee_count: 420
                    funding_stage: Series C
                    industries:
                      - Software
                      - DevOps
                    hq_city: San Francisco
                    hq_region: California
                    hq_country: United States
                page: page_0000
                next_cursor: page_0001
                count: 100
                processed: 21815
                progress_message: completed
                bands_done: 6
                bands_total: 6
                degraded: false
        '404':
          description: Job not found for this API key.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TamBuildJobResponse:
      type: object
      title: TamBuildJobResponse
      description: Combined status + live progress + one page of the TAM master set.
      required:
        - job_id
        - status
      properties:
        job_id:
          type: string
          title: Job Id
        status:
          type: string
          title: Status
          description: >-
            `pending` | `running` | `completed` | `failed` | `cancelling` |
            `cancelled`.
        manifest:
          anyOf:
            - $ref: '#/components/schemas/TamBuildManifest'
            - type: 'null'
          description: Build summary; populated once the job is terminal.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        rows:
          type: array
          items:
            $ref: '#/components/schemas/TamCompanyResult'
          title: Rows
          description: Companies in the requested page.
        page:
          anyOf:
            - type: string
            - type: 'null'
          title: Page
          description: Name of the page returned (e.g. `page_0003`).
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Pass as `cursor` to fetch the next page; null when this is the last
            page.
        count:
          type: integer
          default: 0
          title: Count
          description: Rows in this page.
        processed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Processed
          description: Unique qualified companies so far (advances live as bands complete).
        progress_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Progress Message
          description: 'Current stage, e.g. `band 201-1000: validating 5000`.'
        bands_done:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bands Done
        bands_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bands Total
        degraded:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Degraded
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    TamBuildManifest:
      type: object
      title: TamBuildManifest
      description: >-
        Summary of a completed (or partial) TAM build; present once the job is
        terminal.
      properties:
        pages:
          type: integer
          title: Pages
          description: Number of NDJSON page files written.
        page_size:
          type: integer
          title: Page Size
          description: Max rows per page.
        unique_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Unique Count
          description: Unique companies in the deduped TAM (null on failed jobs).
        partial:
          type: boolean
          default: false
          title: Partial
          description: True if the build was cancelled or failed after writing some pages.
        degraded:
          type: boolean
          default: false
          title: Degraded
          description: True if one or more grid cells errored and were skipped.
        ranked:
          type: boolean
          default: true
          title: Ranked
          description: >-
            Always true: pages are ICP-band priority ordered, best-fit-first
            within each band.
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stop Reason
          description: '`cancelled` when cancelled; null otherwise.'
        credits_consumed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits Consumed
          description: Credits charged (unique_count x per-company cost).
    TamCompanyResult:
      type: object
      title: TamCompanyResult
      description: >-
        One company in the TAM master set (lookalike projection + ClickHouse
        firmographic enrichment, plus which grid cell first surfaced it).
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Company name.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: Primary company domain.
        linkedin_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedin Url
        headquarters:
          anyOf:
            - type: string
            - type: 'null'
          title: Headquarters
          description: Best available HQ location.
        match_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Match Reason
          description: >-
            One-sentence LLM justification for why this company matches the
            canonical intent.
        match_score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Match Score
          description: >-
            0-100 LLM closeness score to the canonical intent. Rows are ordered
            best-fit-first by this score.
        source_band:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Band
          description: ICP (employee-count) band that first surfaced this company.
        source_query:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Query
          description: Query variation that first surfaced this company.
        employee_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Employee Count
        funding_stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Funding Stage
        revenue_usd:
          anyOf:
            - type: integer
            - type: 'null'
          title: Revenue Usd
        industries:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          title: Industries
        hq_city:
          anyOf:
            - type: string
            - type: 'null'
          title: Hq City
        hq_region:
          anyOf:
            - type: string
            - type: 'null'
          title: Hq Region
        hq_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Hq Country
        linkedin_follower_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Linkedin Follower Count
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        tagline:
          anyOf:
            - type: string
            - type: 'null'
          title: Tagline
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string

````