Match 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.
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 |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
descriptionrequired | string | What the user wants to create, in their words, e.g. "Florida commercial lease" Length 2 <= length <= 500 |
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/wizards/match" \ -H "Content-Type: application/json" \ -d '{ "description": "string" }'{
"match": {
"wizard": {
"wizardId": "string",
"name": "string",
"description": "string",
"questionCount": 0,
"definitionVersion": "string"
},
"matchedOn": "type_word",
"score": 0
},
"alternatives": [
{
"wizardId": "string",
"name": "string",
"description": "string",
"questionCount": 0,
"definitionVersion": "string"
}
],
"templateAlternatives": [
{
"templateDealId": "string",
"name": "string",
"score": 0
}
],
"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"
}
}{
"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": {}
}
}GETList deal wizards
Lists the organization's offered deal wizards. Listing wizards are excluded. Use matchDealWizard to pick one from a description, then getNextWizardQuestion to walk it. Requires one of `api_deals_list` or `api_deals_create`.
POSTGet 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`.