Create a deal

POST
/api/v1/orgs/{orgId}/deals

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

Header Parameters

NameTypeDescription
Idempotency-Key
required
string

Client-supplied idempotency key; reuse the same value when retrying after a lost response so the server does not create a duplicate deal

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
namestring

Deal name. Required unless templateDealIds is sent.

Length1 <= length
fileobject

Optional PDF to upload after deal creation

name
required
string
Length1 <= length <= 255
size
required
integer
Range0 < value <= 52428800
contentType
required
"application/pdf"
sha256string
Pattern^[a-f0-9]{64}$
descriptionstring

Deal description

transactionTypestring

Transaction type: sale or lease

Allowed"sale""lease"
tagsarray<string>

Deal tags

dataSourceobject

Data source from lookup_property. Pass through as-is.

name
required
string
Allowed"rentcast""attom""idx_broker""zillow""redfin""manual"
propertyId
required
string
metadataobject
[key: string]any
formattedAddressstring

Formatted address string

addressobject

Property address components

line1string
line2string
unitNumberstring
citystring
statestring
zipCodestring
countystring
countrystring
propertyTypestring

Property type (e.g., Single Family, Condo)

bedroomsnumber

Number of bedrooms

bathroomsnumber

Number of bathrooms

squareFootagenumber

Total interior square footage

lotSizenumber

Lot size in square feet

yearBuiltnumber

Year the property was built

ownerobject

Property owner / seller / landlord

namesarray<string>
typestring
emailstring
phonestring
counterpartyobject

Buyer or tenant

namesarray<string>
typestring
emailstring
phonestring
listingAgentobject

Listing agent

namestring
phonestring
emailstring
licenseNumberstring
buyerAgentobject

Buyer/tenant agent

namestring
phonestring
emailstring
licenseNumberstring
amountnumber

Purchase price (sales) or monthly rent (leases)

depositnumber

Earnest money (sales) or security deposit (leases)

startDatestring

Closing date (sales) or lease begin date

endDatestring

Lease end date

leaseTermMonthsnumber

Lease term in months

financingTypestring

Financing type (sales only)

Allowed"cash""financing"
saleTypestring

Sale type

Allowed"standard""1031_exchange""short_sale"
featuresobject

Property features

poolboolean
garageboolean
hoaAssociationboolean
condoAssociationboolean
cddAssociationboolean
waterfrontboolean
customInteriorarray<string>
customExteriorarray<string>
listingobject

MLS listing data

statusstring
Allowed"active""inactive"
typestring
Allowed"sale""rental""both""none"
[key: string]any
notesstring

Additional notes

templateDealIdsarray<string>

Template dealIds from list_deals with isTemplate=true. One id copies the template; several merge their documents.

Items1 <= items <= 10
isTemplateboolean

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