API ReferenceDeal Wizards

Match a deal wizard

POST
/api/v1/orgs/{orgId}/wizards/match

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
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
description
required
string

What the user wants to create, in their words, e.g. "Florida commercial lease"

Length2 <= 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": {}
  }
}