List 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.
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 |
Query Parameters
| Name | Type | Description |
|---|---|---|
search | string | Optional name/address filter. Non-empty values match deal name and property address; blank or whitespace-only values use the recents list. Without cursor, non-empty values try relevance ranking first: up to limit top matches (hasMore false, nextCursor null). If ranking finds nothing, falls back to substring matching with normal cursor pagination. |
orderBy | string | Sort column for the deal list Allowed "created_at""updated_at" |
ascending | string | When true, sort ascending instead of descending Allowed "true""false" |
limit | integer | Maximum number of deals to return (1-100) Range 1 <= value <= 100 |
cursor | string | Opaque pagination cursor from a previous response. With search, bypasses relevance ranking and paginates substring matches ordered by orderBy instead. |
tags | string | Comma-separated catalog labels, up to 20. A deal matches when its tags array contains any of them. Labels match the stored casing exactly. |
isTemplate | string | When true, list the org's deal templates (yours and the org library) instead of deals. Global templates are not included. Allowed "true""false" |
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://app.goclai.com/api/v1/orgs/org_2abc123/deals"{
"deals": [
{
"dealId": "f480fdfe-5c44-458b-b537-f3d9f40f9678",
"name": "string",
"status": "string",
"createdAt": "string",
"updatedAt": "string",
"packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
"authorName": "string",
"tags": [
"string"
],
"dealUrl": "string",
"templateSource": "personal"
}
],
"hasMore": true,
"nextCursor": "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 organizations the API key may call
Returns id and name for each organization on the authenticated API key allowlist. Omits organizations the bound user has left. Name is null when the organization row is missing or deleted.
POSTCreate 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.