---
title: "Stream job results in real-time"
method: POST
path: "/v1/jobs/stream"
tags: ["Create Jobs"]
---

# Stream job results in real-time

`POST /v1/jobs/stream`

## Request

- Base URL: `https://gateway.app.clavata.ai:8443`
- URL: `https://gateway.app.clavata.ai:8443/v1/jobs/stream`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/clavata/apis/clavata-public-api-v1/docs/v1/jobs/stream/post.ts> (a function with typed inputs; its response is checked against the schema)

Initiates a streaming job that processes content data and returns results as they become available. Useful for real-time content evaluation. Policy-first endpoint: requires a `policy_id`.

## Request body

- Clavatagatewayv1EvaluateRequest
  - `contentData` V1ContentData[], required: The content data to be evaluated. Only one content type should be set per entry.
    - `contentHash` string: The hashing algorithm used will appear at the front of the hash value in this field (i.e., 'md5::hash')
    - `text` string: A text string to process.
    - `image` string, base64: A binary image file to process.
    - `imageUrl` string: A publicly-accessible URL that points to an image.
    - `metadata` object
  - `policyId` string, required
  - `threshold` number, double: The threshold to use for truthyness. If not set a default value will be used.
  - `expedited` boolean: If set, the job will be evaluated in expedited mode, prioritizing speed over cost.
  - `options` V1EvaluateRequestOptions: Options for evaluation behavior.
    - `options` object: Map of option keys to values.

## Response `200`

A successful response.(streaming responses)

- object
  - `result` Clavatagatewayv1EvaluateResponse
    - `jobUuid` string
    - `contentHash` string
    - `policyEvaluationReport` V1PolicyEvaluationReport: A report on the result of evaluating a policy against a piece of content/input.
      - `policyId` string, uuidv4
      - `policyKey` string: This is the title of the policy as it appears in the policy editor. Do not use this to identify a policy. Use the policy_id instead.
      - `policyVersionId` string, uuidv4
      - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
      - `sectionEvaluationReports` PolicyEvaluationReportSectionEvaluationReport[]: Reports on the evaluation of each SECTION or LABEL block in the policy.
        - `name` string
        - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
        - `message` string
        - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[]: Each assertion in each section is evaluated
          - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
          - `message` string: The text of the assertion.
          - `score` number, double
        - `exceptionEvaluationReport` PolicyEvaluationReportExceptionEvaluationReport: Outcome of an EXCEPT WHEN or UNLESS block, if present.
          - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
          - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[]: Each assertion in the exception is evaluated
            - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
            - `message` string: The text of the assertion.
            - `score` number, double
          - `reviewResult` PolicyEvaluationReportReviewResult: Report on the result of a single assertion in a policy.
            - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
            - `score` number, double
        - `reviewResult` PolicyEvaluationReportReviewResult: Report on the result of a single assertion in a policy.
          - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
          - `score` number, double
      - `exceptionEvaluationReport` PolicyEvaluationReportExceptionEvaluationReport: Outcome of an EXCEPT WHEN or UNLESS block, if present.
        - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
        - `assertionEvaluationReports` PolicyEvaluationReportAssertionEvaluationReport[]: Each assertion in the exception is evaluated
          - `result` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
          - `message` string: The text of the assertion.
          - `score` number, double
        - `reviewResult` PolicyEvaluationReportReviewResult: Report on the result of a single assertion in a policy.
          - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
          - `score` number, double
      - `contentHash` string: The hashing algorithm used will appear at the front of the hash value in this field (i.e., 'fnv1a128::hash-value')
      - `contentMetadata` object: If metadata was attached to the content when the job was created, it will be attached to the evaluation report here.
      - `reviewResult` PolicyEvaluationReportReviewResult: Report on the result of a single assertion in a policy.
        - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_FALSE' | 'OUTCOME_TRUE' | 'OUTCOME_FAILED': Evaluation outcome. TRUE, FALSE or FAILED.
        - `score` number, double
      - `threshold` number, double
      - `labelMatches` object: Labels that matched the content. The keys of the map are the label names, and the values are the scores for each label. This field provides a simple way to identify which labels matched the content without the need to dig into each section report.
      - `tokenUsage` PolicyEvaluationReportTokenUsage: Usage related to this policy evaluation.
        - `inputTokens` integer: The number of tokens that were sent to the service in the form of content.
        - `billedTokens` integer: The number of tokens that Clavata billed for this evaluation.
        - `multiplier` number, float: The policy complexity multiplier that was used to calculate the final billed tokens.
      - `labelId` string, uuidv4: The ID of the published label evaluated for label-based evaluation flows.
      - `labelVersionId` string, uuidv4: The ID of the published label version evaluated for label-based evaluation flows.
  - `error` RpcStatus
    - `code` integer
    - `message` string
    - `details` ProtobufAny[]
      - `@type` string

## Other responses

- `400`: Bad Request
- `429`: Too Many Requests
- `499`: Precheck Failures (Canceled)
- `default`: An unexpected error response.

---

[API](https://skmtc.dev/clavata/apis/clavata-public-api-v1.md) - [All operations](https://skmtc.dev/clavata/apis/clavata-public-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/clavata/apis/clavata-public-api-v1/revisions/d7a854b0070f?raw)
