Build

Deals

Full CRUD operations for deals in the Lev External API v2.

Updated March 2026

Overview

The deals endpoints support full CRUD operations with filtering, sorting, pagination, sparse fieldsets, and optional sub-resource includes.

EndpointDescription
GET /build/dealsList deals with filtering and pagination
GET /deals/{id}Get a single deal
POST /build/dealsCreate a new deal
PATCH /deals/{id}Update a deal
DELETE /deals/{id}Archive (soft-delete) a deal

List Deals

GET/api/external/v2/build/deals

List deals with pagination, filtering, and sorting

curl -X GET "https://api.levcapital.com/api/external/v2/build/deals?limit=10&include=financials&sort=-created_at" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200):

{
  "request_id": "...",
  "timestamp": "2026-03-20T15:30:45Z",
  "data": [
    {
      "id": 101,
      "title": "123 Main St Acquisition",
      "loan_amount": 5000000.0,
      "loan_type": "acquisition",
      "transaction_type": "purchase",
      "business_plan": "value_add",
      "description": "Mixed-use acquisition in downtown",
      "estimated_close_date": "2026-06-01",
      "close_date": null,
      "owner_account_id": 56,
      "created_at": "2026-01-15T10:00:00Z",
      "updated_at": "2026-03-10T14:30:00Z",
      "financials": {
        "id": 201,
        "noi": 450000.0,
        "purchase_price": 6500000.0,
        "appraised_value": 7000000.0,
        "ltv": 0.714,
        "dscr": 1.25
      }
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 10,
    "offset": 0,
    "has_more": true
  }
}
unauthorized
Authentication requiredMissing or invalid Authorization header
bad_request
cursor and sort cannot be combined; use offset pagination when sortingBoth cursor and sort query parameters are provided

Get Deal

GET/api/external/v2/deals/{deal_id}

Get a single deal by ID

Response (200):

{
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "timestamp": "2026-03-20T15:30:45Z",
  "data": {
    "id": 101,
    "title": "123 Main St Acquisition",
    "loan_amount": 5000000.0,
    "loan_type": "acquisition",
    "transaction_type": "purchase",
    "business_plan": "value_add",
    "description": "Mixed-use acquisition in downtown Chicago",
    "estimated_close_date": "2026-06-01",
    "close_date": null,
    "owner_account_id": 56,
    "created_at": "2026-01-15T10:00:00Z",
    "updated_at": "2026-03-10T14:30:00Z"
  }
}
unauthorized
Authentication requiredMissing or invalid Authorization header
not_found
Deal not foundThe deal_id doesn't exist or isn't accessible to the authenticated user

Create Deal

POST/api/external/v2/build/deals

Create a new deal

Supports the Idempotency-Key header to prevent duplicate creation.

curl -X POST "https://api.levcapital.com/api/external/v2/build/deals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "title": "456 Oak Ave Refinance",
    "loan_amount": 3500000,
    "loan_type": "refinance",
    "transaction_type": "refinance"
  }'

Response (201):

{
  "request_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "timestamp": "2026-03-20T15:30:45Z",
  "data": {
    "id": 205,
    "title": "456 Oak Ave Refinance",
    "loan_amount": 3500000.0,
    "loan_type": "refinance",
    "transaction_type": "refinance",
    "business_plan": null,
    "description": null,
    "estimated_close_date": null,
    "close_date": null,
    "owner_account_id": 56,
    "created_at": "2026-03-20T15:30:45Z",
    "updated_at": "2026-03-20T15:30:45Z"
  }
}
unauthorized
Authentication requiredMissing or invalid Authorization header
validation_error
title is requiredMissing the required title field in the request body

Update Deal

PATCH/api/external/v2/deals/{deal_id}

Update a deal (partial update)

All request body fields are optional. Only provided fields are updated.

Response (200):

{
  "request_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "timestamp": "2026-03-20T15:30:45Z",
  "data": {
    "id": 101,
    "title": "123 Main St Acquisition",
    "loan_amount": 7500000.0,
    "loan_type": "acquisition",
    "transaction_type": "purchase",
    "business_plan": "value_add",
    "description": "Mixed-use acquisition in downtown Chicago — updated loan amount",
    "estimated_close_date": "2026-07-15",
    "close_date": null,
    "owner_account_id": 56,
    "created_at": "2026-01-15T10:00:00Z",
    "updated_at": "2026-03-20T15:30:45Z"
  }
}
unauthorized
Authentication requiredMissing or invalid Authorization header
not_found
Deal not foundThe deal_id doesn't exist or isn't accessible to the authenticated user

Delete Deal

DELETE/api/external/v2/deals/{deal_id}

Archive (soft-delete) a deal

Response (200):

{
  "request_id": "...",
  "timestamp": "2026-03-20T15:30:45Z",
  "data": {
    "deleted": true
  }
}
unauthorized
Authentication requiredMissing or invalid Authorization header
not_found
Deal not foundThe deal_id doesn't exist or isn't accessible to the authenticated user

Deal Object

FieldTypeDescription
idintegerUnique deal identifier
titlestring|nullDeal title
loan_amountnumber|nullRequested loan amount
loan_typestring|nullLoan type (acquisition, refinance, construction, etc.)
transaction_typestring|nullTransaction type
business_planstring|nullBusiness plan
descriptionstring|nullDeal description
estimated_close_datestring|nullEstimated close date (ISO 8601)
close_datestring|nullActual close date (ISO 8601)
owner_account_idinteger|nullOwning account ID
created_atstring|nullCreation timestamp (ISO 8601)
updated_atstring|nullLast update timestamp (ISO 8601)
financialsobject|nullIncluded when ?include=financials (see Deal Financials)
propertiesarray|nullIncluded when ?include=properties (see Deal Properties)
teamarray|nullIncluded when ?include=team (see Deal Team)
More in this section