Get the next wizard question
Validates the answers so far and returns the next question to ask, required or optional. Send every answer on every call; the server keeps no run state. Answer null to skip an optional question. When the wizard binds to property data and the key holds api_deals_create, a complete address triggers a property lookup whose values come back in prefill.
Requires one of api_deals_list or api_deals_create.
Authorization
bearerAuth Bearer token using a Clai API key secret (clai_live_*).
In: header
Path Parameters
| Name | Type | Description |
|---|---|---|
orgIdrequired | string | Organization ID the key is operating in |
wizardIdrequired | string | Wizard ID from listDealWizards or matchDealWizard |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
answersrequired | object | Every answer so far, keyed by question id. Send null to skip an optional question. See each question answerFormat. |
[key: string] | any | |
definitionVersion | string |
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/wizards/starter-real-estate-deal/next" \ -H "Content-Type: application/json" \ -d '{ "answers": { "property1": null, "property2": null } }'{
"definitionVersion": "string",
"wizardName": "string",
"complete": true,
"question": {
"id": "string",
"label": "string",
"helpText": "string",
"kind": "string",
"required": true,
"answerFormat": "string",
"options": [
{
"value": "string",
"label": "string"
}
],
"min": 0,
"max": 0,
"suffix": "string",
"placeholder": "string",
"base": {
"questionId": "string"
},
"propertyLookup": true,
"folderTypeKey": "string",
"withinQuestionId": "string",
"groupId": "string",
"groupLabel": "string"
},
"prefill": {
"property1": null,
"property2": null
},
"lookup": "not_needed",
"progress": {
"position": 1,
"total": 1
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}POSTMatch a deal wizard
Picks the org's deal wizard that best fits a description, using the same matcher as the in-app search bar. Returns the match with its first question, up to two other wizards, and matching deal templates. Falls back to the real-estate starter wizard when nothing matches. Does not create anything. Requires one of `api_deals_list` or `api_deals_create`.
POSTSubmit a deal wizard
Creates a deal from a completed wizard run, the same deal the in-app wizard would create. Send every answer. Returns template suggestions from the wizard's rules without attaching them; attach with addTemplatesToPackage. Idempotency-Key is required. Requires the `api_deals_create` scope.