---
title: "Define a form using AI assistance"
method: POST
path: "/api/agents/forms/define"
tags: ["Agents"]
---

# Define a form using AI assistance

`POST /api/agents/forms/define`

Uses AI to generate or refine a form definition based on the provided prompt.

## Request body

- DefineFormRequest — Request model for defining a form using AI assistance.
  - `prompt` string, required — The prompt to guide the AI in form definition.
  - `definition` string, nullable — Optional existing form definition to refine or modify.
  - `agentName` string — Optional assistant ID for continuing a conversation.
  - `threadId` integer, nullable — Optional thread ID for continuing a conversation.
  - `formId` integer, nullable — Optional form ID to associate the conversation with a specific form.

## Response `200`

Form definition generated successfully.

- DefineFormResponse — Response model for the AI-assisted form definition.
  - `agentResponse` string — The human-friendly response from the AI agent.
  - `definition` string, nullable — The AI-generated or refined form definition.
  - `agentId` string — The agent ID for continuing the conversation.
  - `threadId` string — The thread ID for continuing the conversation.

## Other responses

- `400` — Invalid input data.
- `401` — Unauthorized
- `403` — Forbidden

## Changes

- **2025-11-21** `50eff5014b78` — 1 info
  - endpoint added
- **2025-03-24** `fbc3fe6ecbf1` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/endatix/apis/endatix-platform-rest-api/changes/api/agents/forms/define/post.md)

---

[API](https://skmtc.dev/endatix/apis/endatix-platform-rest-api.md) · [All operations](https://skmtc.dev/endatix/apis/endatix-platform-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/endatix/endatix-platform-rest-api/revisions/50eff5014b78/schema)
