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

# Get detection intermediates

> Returns the detection's enrichment intermediates — an image's OCR layout, an audio clip's transcript, or tokenized text — as an object with a `parts` list, each part carrying its path `id`, `modality`, and the extracted `artifact`, so a client can search the content and add entities the analysis missed. A detection whose analysis ran no enricher has no intermediates (404).



## OpenAPI

````yaml /api-reference/openapi.json get /workspaces/{workspaceId}/detections/{detectionId}/intermediates
openapi: 3.1.0
info:
  title: Nvisy API
  summary: Document detection and redaction platform
  description: >-
    Nvisy provides intelligent detection of sensitive content in documents,
    redaction pipelines, and reviewer workflows. This API enables document
    upload, detection analysis, redaction, and collaborative review across your
    workspaces.
  termsOfService: https://nvisy.com/legal/terms-of-service
  contact:
    name: Nvisy Support
    url: https://nvisy.com
    email: hello@nvisy.com
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.1.0
servers: []
security: []
tags:
  - name: Health
    description: Service health checks
  - name: Capabilities
    description: Read-only reference data describing this deployment
  - name: Accounts
    description: Account management and profile operations
  - name: Identities
    description: 'Account sign-in methods: password and linked providers'
  - name: Avatars
    description: Public avatar image serving
  - name: Authentication
    description: Login, signup, and token management
  - name: Workspaces
    description: Workspace creation and management
  - name: Activities
    description: Workspace activity log and export
  - name: Documents
    description: Document upload, download, and management
  - name: Analytics
    description: Aggregate metrics over a workspace's documents
  - name: Members
    description: Workspace member management
  - name: Invites
    description: Workspace invitation handling
  - name: API Tokens
    description: API token management
  - name: Connections
    description: External provider connections
  - name: Connection Syncs
    description: Connection synchronization runs
  - name: Providers
    description: Inference-provider configuration
  - name: Pipelines
    description: Redaction pipeline configuration
  - name: Detections
    description: Detection analysis and redaction
  - name: Redactions
    description: Redactions produced from a detection, with reviewer edits
  - name: Reviews
    description: Document reviews, the review queue, and their discussion
  - name: Policies
    description: Redaction policy configuration
  - name: Webhooks
    description: Webhook configuration
  - name: Notifications
    description: Account notification management
paths:
  /workspaces/{workspaceId}/detections/{detectionId}/intermediates:
    get:
      tags:
        - Detections
      summary: Get detection intermediates
      description: >-
        Returns the detection's enrichment intermediates — an image's OCR
        layout, an audio clip's transcript, or tokenized text — as an object
        with a `parts` list, each part carrying its path `id`, `modality`, and
        the extracted `artifact`, so a client can search the content and add
        entities the analysis missed. A detection whose analysis ran no enricher
        has no intermediates (404).
      parameters:
        - in: path
          name: workspaceId
          description: Workspace identifier.
          required: true
          schema:
            description: Workspace identifier.
            type: string
            format: uuid
          style: simple
        - in: path
          name: detectionId
          description: Opaque identifier of the detection.
          required: true
          schema:
            $ref: '#/components/schemas/DetectionId'
            description: Opaque identifier of the detection.
          style: simple
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactSet'
        '401':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    DetectionId:
      description: Opaque detection identifier (detection_<uuid>).
      type: string
      pattern: >-
        ^detection_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
    ArtifactSet:
      type: object
      properties:
        parts:
          type: array
          items:
            discriminator:
              propertyName: modality
            oneOf:
              - type: object
                properties:
                  artifact:
                    $ref: '#/components/schemas/Tokens'
                  id:
                    type: array
                    items:
                      type: string
                    minItems: 1
                  modality:
                    type: string
                    const: text
                required:
                  - id
                  - modality
                  - artifact
              - type: object
                properties:
                  artifact:
                    $ref: '#/components/schemas/Layout'
                  id:
                    type: array
                    items:
                      type: string
                    minItems: 1
                  modality:
                    type: string
                    const: image
                required:
                  - id
                  - modality
                  - artifact
              - type: object
                properties:
                  artifact:
                    $ref: '#/components/schemas/Transcription'
                  id:
                    type: array
                    items:
                      type: string
                    minItems: 1
                  modality:
                    type: string
                    const: audio
                required:
                  - id
                  - modality
                  - artifact
              - type: object
                properties:
                  artifact:
                    $ref: '#/components/schemas/Tokens'
                  id:
                    type: array
                    items:
                      type: string
                    minItems: 1
                  modality:
                    type: string
                    const: tabular
                required:
                  - id
                  - modality
                  - artifact
      required:
        - parts
    ErrorResponse:
      description: >-
        The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
        view

        that [`Error`] renders to at the response boundary.


        It carries no builder logic — [`Error`] is the type handlers construct
        and

        thread through `Result`, and it builds an `ErrorResponse` directly in
        its

        `IntoResponse` impl. `context` and `status` are not part of the JSON
        body

        (`context` is logged, `status` sets the HTTP status line).


        [`Error`]: crate::response::Error
      type: object
      properties:
        message:
          description: User-friendly error message safe for client display.
          type: string
        name:
          description: The error name/type identifier.
          type: string
      required:
        - name
        - message
    Tokens:
      description: >-
        Owning token sequence: the [`Text`](super::Text) modality's enrichment

        artifact, produced by a tokenizing enricher and read by a context
        enhancer.


        Tokens are sorted by `offset.start` (producers should emit them in
        order;

        consumer-side code assumes this). A context enhancer borrows the
        underlying

        slice via [`as_slice`](Tokens::as_slice) and walks it by count when
        scoring an

        entity's neighbourhood. Empty ([`Default`]) until a tokenizing enricher
        fills

        it, the enhancer then tokenizes on demand instead.
      type: array
      items:
        $ref: '#/components/schemas/Token'
    Layout:
      description: >-
        An image's recognized text, laid out in space.


        An ordered set of [`LayoutBlock`]s (the recognized text regions). The
        flat

        [`text`], the blocks joined, is what a recognizer

        inspects; [`resolve`] maps a byte range of that text back

        to the [`ImageLocation`] it occupies, using the blocks' (and their

        words') bounding boxes. Empty when the backend recognized nothing.


        [`text`]: Self::text

        [`resolve`]: Self::resolve
      type: object
      properties:
        blocks:
          description: Blocks in reading order.
          type: array
          items:
            $ref: '#/components/schemas/LayoutBlock'
        text:
          description: >-
            The blocks' text joined by [`BLOCK_SEPARATOR`], cached so
            recognition

            and byte-range resolution share one flat string.
          type: string
      required:
        - blocks
        - text
    Transcription:
      description: |-
        Timestamped transcript of an audio stream.

        An ordered set of [`TranscriptSegment`]s. The flat
        [`text`], the segments joined, is what a recognizer
        inspects; [`resolve`] maps a byte range of that text back
        to the [`TimeSpan`] it occupies, using the segments' (and their words')
        timings. Empty when the backend produced nothing (silence, or a no-op
        backend).

        [`text`]: Self::text
        [`resolve`]: Self::resolve
      type: object
      properties:
        segments:
          description: Segments in stream order.
          type: array
          items:
            $ref: '#/components/schemas/TranscriptSegment'
        text:
          description: |-
            The segments' text joined by [`SEGMENT_SEPARATOR`], cached so
            recognition and byte-range resolution share one flat string. Each
            segment's text begins at a known offset within it (see
            [`segment_offsets`]).

            [`segment_offsets`]: Self::segment_offsets
          type: string
      required:
        - segments
        - text
    Token:
      description: >-
        One token produced by an upstream tokenizer.


        `lemma` falls back to `text` when the producer has no lemmatizer, so
        callers

        that want lemma-aware matching can read `token.lemma` uniformly without

        checking which engine produced the artifact.
      type: object
      properties:
        is_punct:
          description: Producer-asserted punctuation flag.
          type: boolean
        is_stop:
          description: |-
            Producer-asserted stopword flag (e.g. "the", "a", "of" for English).
            Producers without a stopword list set this to `false`.
          type: boolean
        lemma:
          description: >-
            Lemma when the producer emitted one; otherwise ==
            [`text`](Self::text).
          type: string
        offset:
          description: >-
            Byte range this token occupies in the source text. Use this to map
            back

            to substrings of the original input.
          allOf:
            - $ref: '#/components/schemas/Range_of_uint'
        text:
          description: Surface form as it appears in the source text.
          type: string
      required:
        - text
        - lemma
        - offset
        - is_stop
        - is_punct
    LayoutBlock:
      description: |-
        One recognized region of an image: its bounding box and text, optionally
        broken into per-word boxes.
      type: object
      properties:
        region:
          description: Bounding region of the block in image coordinates.
          allOf:
            - $ref: '#/components/schemas/ImageLocation'
        text:
          description: Recognized text for this block.
          type: string
        words:
          description: |-
            Per-word boxes within the block, when the backend emitted them.
            Empty otherwise; resolution then falls back to the block region.
          type: array
          default: []
          items:
            $ref: '#/components/schemas/LayoutWord'
      required:
        - region
        - text
    TranscriptSegment:
      description: |-
        One segment of a [`Transcription`]: a span of audio and the text
        recognised within it, with optional diarization, language, confidence,
        and per-word timings.

        `speaker_id` is populated only by backends with diarization;
        `language` by backends that emit per-segment language detection;
        `confidence` when the backend reports one; `words` when it emits a
        word-level breakdown (which is what lets a sub-segment range resolve to
        a tighter span than the whole segment).
      type: object
      properties:
        confidence:
          $ref: '#/components/schemas/Confidence'
          description: Backend confidence in the segment, when reported.
        language:
          description: Detected language for this segment, when the backend reported one.
          type: string
        span:
          description: Time span the segment covers within the stream.
          allOf:
            - $ref: '#/components/schemas/TimeSpan'
        speaker_id:
          description: Diarization speaker label, when the backend assigned one.
          type: string
        text:
          description: Recognised text for this segment.
          type: string
        words:
          description: |-
            Per-word timings within the segment, when the backend emitted them.
            Empty otherwise; resolution then falls back to the segment span.
          type: array
          default: []
          items:
            $ref: '#/components/schemas/TranscriptWord'
      required:
        - span
        - text
    Range_of_uint:
      type: object
      properties:
        end:
          type: integer
          format: uint
          minimum: 0
        start:
          type: integer
          format: uint
          minimum: 0
      required:
        - start
        - end
    ImageLocation:
      description: |-
        Region within image content.

        An axis-aligned [`BoundingBox`] in pixel coordinates locates the
        region; an optional [`Polygon`] captures a rotated or quadrilateral
        shape when the source produced one (OCR engines that emit 4-point
        polygons), and an optional page number addresses multi-page documents.
      type: object
      properties:
        bounding_box:
          description: Axis-aligned bounding box of the region, in pixel coordinates.
          allOf:
            - $ref: '#/components/schemas/BoundingBox'
        page:
          description: 1-based page number, for multi-page documents like PDFs.
          type: integer
          format: uint32
          minimum: 0
        polygon:
          $ref: '#/components/schemas/Polygon'
          description: |-
            Polygon vertices when the region is rotated or quadrilateral.
            Axis-aligned-only sources leave this unset.
      required:
        - bounding_box
    LayoutWord:
      description: One word within a [`LayoutBlock`], with its own bounding box.
      type: object
      properties:
        confidence:
          $ref: '#/components/schemas/Confidence'
          description: Per-word confidence, when reported.
        region:
          description: Bounding region of the word in image coordinates.
          allOf:
            - $ref: '#/components/schemas/ImageLocation'
        text:
          description: The word text, as it appears in the block text.
          type: string
      required:
        - region
        - text
    Confidence:
      description: |-
        Confidence score in the closed range `0.0..=1.0`.

        Carried by every provenance [`AuditEvent`] (the `before`/`after` of a
        recognition, fusion, or calibration) and by the effective confidence
        of an [`Entity`]. The newtype enforces the range at construction so
        no downstream code has to defend against values outside `[0, 1]`.

        Distinct from [`ConfidenceThreshold`] so the two cannot be confused
        at a call site: a score is *produced* by detection, a threshold is a
        *cutoff* configured to filter scores. Compare the two with
        [`ConfidenceThreshold::passes`].

        [`AuditEvent`]: crate::entity::audit::AuditEvent
        [`Entity`]: crate::entity::Entity
      type: number
      format: float
    TimeSpan:
      description: |-
        Half-open `[start, end)` stream interval, measured in microseconds.

        The coordinate a time-addressed medium (audio, video) uses to locate a
        region: a transcribed segment, a redacted span. Microsecond precision
        is finer than both word-level speech timings and per-sample audio
        resolution, so a span never loses precision being carried as a
        `TimeSpan`; the endpoints are non-negative offsets by construction.

        Half-open like a byte range: `[start, end)`, so two intervals that
        merely touch (`a.end == b.start`) do not [`overlap`].

        [`from_millis`] and [`as_millis`] bridge the millisecond-based APIs
        that surround it (audio durations, provider timings reported in ms).

        [`overlap`]: Self::overlaps
        [`from_millis`]: Self::from_millis
        [`as_millis`]: Self::start_millis
      type: object
      properties:
        end_us:
          description: |-
            Microseconds from the start of the stream where the interval ends
            (exclusive).
          type: integer
          format: uint64
          minimum: 0
        start_us:
          description: Microseconds from the start of the stream where the interval begins.
          type: integer
          format: uint64
          minimum: 0
      required:
        - start_us
        - end_us
    TranscriptWord:
      description: One word within a [`TranscriptSegment`], with its own time span.
      type: object
      properties:
        confidence:
          $ref: '#/components/schemas/Confidence'
          description: Per-word confidence, when reported.
        span:
          description: Time span the word covers within the stream.
          allOf:
            - $ref: '#/components/schemas/TimeSpan'
        text:
          description: The word text, as it appears in the segment text.
          type: string
      required:
        - span
        - text
    BoundingBox:
      description: |-
        Axis-aligned rectangle, given by its minimum and maximum corners.

        The location type for the image and document modalities: where a
        detected entity sits within a rendered page. [`min`] is the top-left
        corner and [`max`] the bottom-right under the usual screen convention
        (y grows downward), though the box itself is agnostic to coordinate
        orientation.

        [`min`]: Self::min
        [`max`]: Self::max
      type: object
      properties:
        max:
          description: Maximum corner (bottom-right, conventionally).
          allOf:
            - $ref: '#/components/schemas/Point'
        min:
          description: Minimum corner (top-left, conventionally).
          allOf:
            - $ref: '#/components/schemas/Point'
      required:
        - min
        - max
    Polygon:
      description: |-
        Closed polygon, given by its ordered vertices.

        A richer location than a [`BoundingBox`] for detections whose extent
        is not rectangular: rotated text, a region traced by a vision model, a
        signature. The boundary is implicitly closed, so the last vertex
        connects back to the first.

        [`BoundingBox`]: super::BoundingBox
      type: array
      items:
        $ref: '#/components/schemas/Point'
    Point:
      description: |-
        Point in a 2-D coordinate space.

        The coordinate basis is left to the consumer: pixel coordinates for a
        raster image, normalized `0.0..=1.0` coordinates for a
        resolution-independent region, or page units for a document. The
        model only requires the two scalars.
      type: object
      properties:
        x:
          description: Horizontal coordinate.
          type: number
          format: double
        'y':
          description: Vertical coordinate.
          type: number
          format: double
      required:
        - x
        - 'y'

````