Create a deal
Creates a deal in the specified organization for the API key bound user. Send deal fields with name, or templateDealIds alone (from listDeals with isTemplate=true): one id copies the template, several merge their documents into one package. Send isTemplate=true with name to create a reusable template instead of a deal; the template is personal to the bound user, needs a plan that includes templates, and the response adds isTemplate and prepareUrl. isTemplate cannot be combined with templateDealIds. Set sale vs lease and pricing on the deal here (transactionType, amount, deposit, startDate, financingType); updatePackage only renames a package (name). Denied fields such as teamId and templateDealId are rejected before Zod validation. Idempotency-Key is required and enforced server-side for safe retries.
Requires the api_deals_create scope.
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 |
Header Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyrequired | string | Client-supplied idempotency key; reuse the same value when retrying after a lost response so the server does not create a duplicate deal Length 1 <= length |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
name | string | Deal name. Required unless templateDealIds is sent. Length 1 <= length |
file | object | Optional PDF to upload after deal creation |
namerequired | string | Length 1 <= length <= 255 |
sizerequired | integer | Range 0 < value <= 52428800 |
contentTyperequired | "application/pdf" | |
sha256 | string | Pattern ^[a-f0-9]{64}$ |
description | string | Deal description |
transactionType | string | Transaction type: sale or lease Allowed "sale""lease" |
tags | array<string> | Deal tags |
dataSource | object | Data source from lookup_property. Pass through as-is. |
namerequired | string | Allowed "rentcast""attom""idx_broker""zillow""redfin""manual" |
propertyIdrequired | string | |
metadata | object | |
[key: string] | any | |
formattedAddress | string | Formatted address string |
address | object | Property address components |
line1 | string | |
line2 | string | |
unitNumber | string | |
city | string | |
state | string | |
zipCode | string | |
county | string | |
country | string | |
propertyType | string | Property type (e.g., Single Family, Condo) |
bedrooms | number | Number of bedrooms |
bathrooms | number | Number of bathrooms |
squareFootage | number | Total interior square footage |
lotSize | number | Lot size in square feet |
yearBuilt | number | Year the property was built |
owner | object | Property owner / seller / landlord |
names | array<string> | |
type | string | |
email | string | |
phone | string | |
counterparty | object | Buyer or tenant |
names | array<string> | |
type | string | |
email | string | |
phone | string | |
listingAgent | object | Listing agent |
name | string | |
phone | string | |
email | string | |
licenseNumber | string | |
buyerAgent | object | Buyer/tenant agent |
name | string | |
phone | string | |
email | string | |
licenseNumber | string | |
amount | number | Purchase price (sales) or monthly rent (leases) |
deposit | number | Earnest money (sales) or security deposit (leases) |
startDate | string | Closing date (sales) or lease begin date |
endDate | string | Lease end date |
leaseTermMonths | number | Lease term in months |
financingType | string | Financing type (sales only) Allowed "cash""financing" |
saleType | string | Sale type Allowed "standard""1031_exchange""short_sale" |
features | object | Property features |
pool | boolean | |
garage | boolean | |
hoaAssociation | boolean | |
condoAssociation | boolean | |
cddAssociation | boolean | |
waterfront | boolean | |
customInterior | array<string> | |
customExterior | array<string> | |
listing | object | MLS listing data |
status | string | Allowed "active""inactive" |
type | string | Allowed "sale""rental""both""none" |
[key: string] | any | |
notes | string | Additional notes |
templateDealIds | array<string> | Template dealIds from list_deals with isTemplate=true. One id copies the template; several merge their documents. Items 1 <= items <= 10 |
isTemplate | boolean | Set true to create a reusable template instead of a deal. The template is personal to the API key user. Not allowed with templateDealIds. |
Response Body
application/json
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/deals" \ -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ -H "Content-Type: application/json" \ -d '{}'{
"dealId": "f480fdfe-5c44-458b-b537-f3d9f40f9678",
"name": "string",
"packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
"dealUrl": "http://example.com",
"documentsUrl": "http://example.com",
"isTemplate": true,
"prepareUrl": "http://example.com"
}{
"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": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}GETList deals
Returns a cursor-paginated list of deals for the API key bound user in the specified organization. Optionally filter by name or address with the search query parameter, or by catalog tag labels with the tags query parameter. Pass isTemplate=true to list deal templates; each item then carries templateSource. Requires one of `api_deals_list` or `api_deals_create`.
POSTAdd templates to a package
Merges the document flows of one or more deal templates (from listDeals with isTemplate=true) into an existing package. Requires the `api_deals_create` scope and the bound user's edit access to the deal. Idempotency-Key is required and enforced server-side for safe retries.