---
title: "Evaluate an AI assertion"
method: POST
path: "/analysis/{workspace_id}/assertion/evaluate"
tags: ["Analysis"]
---

# Evaluate an AI assertion

`POST /analysis/{workspace_id}/assertion/evaluate`

(deprecated - use /agent/assertion?workspaceId={workspace_id}) Evaluate an AI assertion

## Path parameters

- `workspace_id` string, required

## Request body

- AnalysisEvaluateAssertionRequest
  - `test_run_id` string, required — The test run ID for which this assertion is being evaluated
  - `assertion_prompt` string, required — The assertion prompt text to use in evaluating the assertion
  - `assertion_criteria` string[] — The assertion criteria to use in evaluating the assertion
  - `regenerate_criteria` boolean — Whether to regenerate the assertion criteria for the assertion (if no criteria are specified, they will always be generated regardless of this setting)
  - `screenshot` string, required — Base64-encoded screenshot of the element to use in evaluating the assertion
  - `screenshot_mime_type` string — The MIME type of the Base64-encoded screenshot data (optional; defaults to image/png if not provided)
  - `files` GenAiFileAttachment[] — Files in the assertion context
    - `data` string — Base64 encoded file data. Mutually exclusive with file_uri - provide exactly one.
    - `file_name` string — Name of the file
    - `file_uri` string — GCS URI of the file (gs://bucket/path format). Mutually exclusive with data - provide exactly one.
    - `mime_type` string — MIME type of the file (required for both data and file_uri)
  - `session_id` string — The ID of the current editing session for the assertion, if applicable
  - `test_invariant_id` string — The ID of the test in which this assertion is being evaluated
  - `test_type` 'api' | 'browser' | 'performance' | 'mobile' — Type of test
  - `training_session_id` string — The ID of the current training session for the assertion, if applicable
  - `url` string — The URL on which this assertion is being evaluated
  - `variables` Variable[]
    - `name` string — The variable name
    - `value` string — The value associated with the variable defined in the "name" field
  - `override` GenAiOverrideOptions
    - `model_id` string — The model ID to use instead of the default model used by the endpoint
    - `meta_prompt` string — The meta-prompt to use instead of the default used by the endpoint
    - `temperature` number, float — The temperature to use instead of the default used by the endpoint

## Response `default`

Unknown error

- ErrorResponseGeneric
  - `id` string
  - `code` integer
  - `message` string

## Other responses

- `301` — Permanent redirect to agent assertion endpoint
- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
