---
title: "Generate data check expression"
method: POST
path: "/workspaces/{workspace_id}/ai/check-expression"
tags: ["Workflow AI"]
---

# Generate data check expression

`POST /workspaces/{workspace_id}/ai/check-expression`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/ai/check-expression`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Accepts natural language intent and returns a DuckDB SQL boolean expression.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Request body

- CheckExpressionRequest
  - `intent` string, required: Natural language description of the data quality check

## Response `201`

Document created, URL follows

- CheckExpressionResponse
  - `expression` string, required: DuckDB SQL boolean expression
  - `explanation` string, required: Human-readable explanation

## Other responses

- `400`: Bad request syntax or unsupported method
- `422`: Server is not able to process the contained instructions

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
