{ "openapi": "3.1.0", "info": { "title": "Lev API", "version": "2026-03", "description": "Build on Lev with AI-friendly API docs, agent guides, and production integration recipes." }, "servers": [ { "url": "https://api.lev.com", "description": "Production API" } ], "paths": { "/api/external/v2/me": { "get": { "operationId": "getMe", "summary": "Get the authenticated user's profile, account, and platform details", "description": "Get the authenticated user's profile, account, and platform details\n\nDocs page: https://www.lev.com/docs/build/account", "tags": [ "Account & Team" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/CurrentUserResponse" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/account", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/me/accounts": { "get": { "operationId": "getMeAccounts", "summary": "List every account the authenticated user has an active membership on", "description": "List every account the authenticated user has an active membership on\n\nDocs page: https://www.lev.com/docs/build/account", "tags": [ "Account & Team" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/account", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/me/active-account": { "patch": { "operationId": "patchMeActiveAccount", "summary": "Persist the authenticated user's active-account preference on the server", "description": "Persist the authenticated user's active-account preference on the server\n\nDocs page: https://www.lev.com/docs/build/account", "tags": [ "Account & Team" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "slug" ], "type": "object", "properties": { "slug": { "type": "string", "description": "Account slug returned by GET /me (unscoped) or GET /me/accounts. Must match an account the authenticated user has an active membership on." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "400": { "description": "slug is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Account not found or user is not a member", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/account", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/account/team": { "get": { "operationId": "getAccountTeam", "summary": "List team members in your account", "description": "List team members in your account\n\nDocs page: https://www.lev.com/docs/build/account", "tags": [ "Account & Team" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/AccountTeamMember" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/account", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/api-keys": { "post": { "operationId": "postApiKeys", "summary": "Create a new API key for the authenticated user", "description": "Create a new API key for the authenticated user\n\nDocs page: https://www.lev.com/docs/build/api-keys", "tags": [ "API Keys" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "label" ], "type": "object", "properties": { "label": { "type": "string", "description": "Human-readable label for the key (1–255 characters)" } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/ApiKey" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/api-keys", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] }, "get": { "operationId": "getApiKeys", "summary": "List all API keys for the authenticated user", "description": "List all API keys for the authenticated user\n\nDocs page: https://www.lev.com/docs/build/api-keys", "tags": [ "API Keys" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "required": false, "description": "Number of results to skip (default 0)", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/ApiKey" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/api-keys", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/api-keys/{key_id}": { "delete": { "operationId": "deleteApiKeysKeyId", "summary": "Permanently revoke an API key", "description": "Permanently revoke an API key\n\nDocs page: https://www.lev.com/docs/build/api-keys", "tags": [ "API Keys" ], "parameters": [ { "name": "key_id", "in": "path", "required": true, "description": "The ID of the API key to revoke", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/api-keys", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/health": { "get": { "operationId": "getHealth", "summary": "Public liveness endpoint — no authentication required", "description": "Public liveness endpoint — no authentication required\n\nDocs page: https://www.lev.com/docs/build/api-overview", "tags": [ "Lev API Documentation" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [], "x-lev-docs-page": "https://www.lev.com/docs/build/api-overview", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/auth/validate-api-key": { "post": { "operationId": "postAuthValidateApiKey", "summary": "Validate an API key and receive authentication details", "description": "Validate an API key and receive authentication details\n\nDocs page: https://www.lev.com/docs/build/getting-started", "tags": [ "Quickstart" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [], "x-lev-docs-page": "https://www.lev.com/docs/build/getting-started", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/billing/summary": { "get": { "operationId": "getBillingSummary", "summary": "Get subscription metadata and credit balance for the active account", "description": "Get subscription metadata and credit balance for the active account\n\nDocs page: https://www.lev.com/docs/build/billing", "tags": [ "Billing" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BillingSummary" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: billing:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/billing", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/billing/credits/balance": { "get": { "operationId": "getBillingCreditsBalance", "summary": "Get the credit balance for the active account", "description": "Get the credit balance for the active account\n\nDocs page: https://www.lev.com/docs/build/billing", "tags": [ "Billing" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Credits" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: billing:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/billing", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/companies": { "get": { "operationId": "getCompanies", "summary": "List companies in your account", "description": "List companies in your account\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Company" } }, "pagination": { "type": "object" } } } } } }, "400": { "description": "cursor and sort cannot be combined; use offset pagination when sorting", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postCompanies", "summary": "Create a new company", "description": "Create a new company\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "name", "company_type" ], "type": "object", "properties": { "name": { "type": "string", "description": "Company name (1–255 characters)" }, "company_type": { "type": "string", "description": "Company type: \"lender\" or \"sponsor\" (required)" }, "website": { "type": "string", "description": "Company website URL" }, "address": { "type": "string", "description": "Street address" }, "city": { "type": "string", "description": "City" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "ZIP code" }, "org_id": { "type": "integer", "description": "Link to a global organization record" }, "linkedin_url": { "type": "string", "description": "LinkedIn URL" } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Company" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "User not authorized to create company", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "name is required; company_type is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/companies/{company_id}": { "get": { "operationId": "getCompaniesCompanyId", "summary": "Get a single company by ID", "description": "Get a single company by ID\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Company" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "patch": { "operationId": "patchCompaniesCompanyId", "summary": "Update a company", "description": "Update a company\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Company" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/companies/{company_id}/notes": { "get": { "operationId": "getCompaniesCompanyIdNotes", "summary": "List notes logged on a company", "description": "List notes logged on a company\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Note" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postCompaniesCompanyIdNotes", "summary": "Add a note to a company", "description": "Add a note to a company\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Note text. Must be non-empty." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/companies/{company_id}/notes/{note_id}": { "patch": { "operationId": "patchCompaniesCompanyIdNotesNoteId", "summary": "Edit a company note", "description": "Edit a company note\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Replacement note text. Must be non-empty." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "400": { "description": "text cannot be empty", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deleteCompaniesCompanyIdNotesNoteId", "summary": "Permanently delete a company note", "description": "Permanently delete a company note\n\nDocs page: https://www.lev.com/docs/build/companies", "tags": [ "Companies" ], "parameters": [ { "name": "company_id", "in": "path", "required": true, "description": "The company ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Company or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/companies", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/contacts": { "get": { "operationId": "getContacts", "summary": "List contacts with pagination", "description": "List contacts with pagination\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Contact" } }, "pagination": { "type": "object" } } } } } }, "400": { "description": "cursor and sort cannot be combined; use offset pagination when sorting", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postContacts", "summary": "Create a new contact", "description": "Create a new contact\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "contact_type", "company_id" ], "type": "object", "properties": { "contact_type": { "type": "string", "description": "Contact type: lender_contact or sponsor" }, "company_id": { "type": "integer", "description": "Associated company ID" }, "first_name": { "type": "string", "description": "First name" }, "last_name": { "type": "string", "description": "Last name" }, "email": { "type": "string", "description": "Email address" }, "title": { "type": "string", "description": "Job title" }, "department": { "type": "string", "description": "Department" }, "address": { "type": "string", "description": "Street address" }, "address2": { "type": "string", "description": "Apartment, suite, or unit line" }, "city": { "type": "string", "description": "City" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "ZIP code" }, "linkedin_url": { "type": "string", "description": "LinkedIn profile URL" }, "photo_url": { "type": "string", "description": "URL to a profile photo" }, "phones": { "type": "array", "items": { "$ref": "#/components/schemas/PhoneIn" }, "description": "Phone numbers. Each object: { raw, type?, country?, extension? }. raw accepts any common format and is normalized to E.164 server-side (unparseable numbers return 422). type is mobile, office, or fax (default mobile). country is a 2-letter ISO region used to parse numbers without a + prefix (default US)." }, "is_primary": { "type": "boolean", "description": "Whether this is the primary contact at the company" } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Contact" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "User not authorized to create contact", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "contact_type is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/contacts/{contact_id}": { "get": { "operationId": "getContactsContactId", "summary": "Get a single contact by ID", "description": "Get a single contact by ID\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Contact" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "patch": { "operationId": "patchContactsContactId", "summary": "Update a contact", "description": "Update a contact\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "first_name": { "type": "string", "description": "First name" }, "last_name": { "type": "string", "description": "Last name" }, "email": { "type": "string", "description": "Email address" }, "title": { "type": "string", "description": "Job title" }, "department": { "type": "string", "description": "Department" }, "address": { "type": "string", "description": "Street address" }, "address2": { "type": "string", "description": "Apartment, suite, or unit line" }, "city": { "type": "string", "description": "City" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "ZIP code" }, "linkedin_url": { "type": "string", "description": "LinkedIn profile URL" }, "photo_url": { "type": "string", "description": "URL to a profile photo" }, "phones": { "type": "array", "items": { "$ref": "#/components/schemas/PhoneIn" }, "description": "Replaces the contact's entire phone list — send [] to clear all numbers. Same object shape as Create Contact." }, "is_primary": { "type": "boolean", "description": "Set to true to make this the primary contact at the company. Promoting one contact demotes the previous primary." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Contact" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "409": { "description": "Changing a contact's email is not supported yet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/contacts/{contact_id}/actions/unlock": { "post": { "operationId": "postContactsContactIdActionsUnlock", "summary": "Reveal an AI-recommended lender contact — charges credits; requires the ai:actions scope", "description": "Reveal an AI-recommended lender contact — charges credits; requires the ai:actions scope\n\nDocs page: https://www.lev.com/docs/build/contacts\n\nDocumented response: the revealed [Contact Object](#contact-object), now carrying the contact's name and other identity fields.", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact to reveal — the `contact_id` returned on the placement", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "the revealed [Contact Object](#contact-object), now carrying the contact's name and other identity fields.", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Contact" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "402": { "description": "Insufficient credits to unlock this contact", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: ai:actions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/contacts/{contact_id}/notes": { "get": { "operationId": "getContactsContactIdNotes", "summary": "List notes logged on a contact", "description": "List notes logged on a contact\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Note" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postContactsContactIdNotes", "summary": "Add a note to a contact", "description": "Add a note to a contact\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Note text. Must be non-empty." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/contacts/{contact_id}/notes/{note_id}": { "patch": { "operationId": "patchContactsContactIdNotesNoteId", "summary": "Edit a contact note", "description": "Edit a contact note\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Replacement note text. Must be non-empty." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "400": { "description": "text cannot be empty", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deleteContactsContactIdNotesNoteId", "summary": "Permanently delete a contact note", "description": "Permanently delete a contact note\n\nDocs page: https://www.lev.com/docs/build/contacts", "tags": [ "Contacts" ], "parameters": [ { "name": "contact_id", "in": "path", "required": true, "description": "The contact ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Contact or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/contacts", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/financials": { "get": { "operationId": "getDealsDealIdFinancials", "summary": "Get financial details for a deal", "description": "Get financial details for a deal\n\nDocs page: https://www.lev.com/docs/build/deal-financials", "tags": [ "Deal Financials" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealFinancials" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deal-financials", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/properties": { "get": { "operationId": "getDealsDealIdProperties", "summary": "List properties associated with a deal", "description": "List properties associated with a deal\n\nDocs page: https://www.lev.com/docs/build/deal-properties", "tags": [ "Deal Properties" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealProperty" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deal-properties", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/team": { "get": { "operationId": "getDealsDealIdTeam", "summary": "List all team members assigned to a deal", "description": "List all team members assigned to a deal\n\nDocs page: https://www.lev.com/docs/build/deal-team", "tags": [ "Deal Team" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealTeamMember" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deal-team", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals": { "get": { "operationId": "getDeals", "summary": "List deals with pagination, filtering, and sorting", "description": "List deals with pagination, filtering, and sorting\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page (mutually exclusive with sort)", "schema": { "type": "string" } }, { "name": "offset", "in": "query", "required": false, "description": "Offset for pagination (requires sort)", "schema": { "type": "integer" } }, { "name": "sort", "in": "query", "required": false, "description": "Sort fields: title, loan_amount, created_at, updated_at. Prefix with - for descending", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include (id always included)", "schema": { "type": "string" } }, { "name": "include", "in": "query", "required": false, "description": "Sub-resources to embed: financials, properties, team, pipelines", "schema": { "type": "string" } }, { "name": "filter[loan_type]", "in": "query", "required": false, "description": "Filter by loan type enum name, such as heavy_bridge or permanent", "schema": { "$ref": "#/components/schemas/LoanType" } }, { "name": "filter[transaction_type]", "in": "query", "required": false, "description": "Filter by transaction type enum name, such as acquisition or refinance", "schema": { "$ref": "#/components/schemas/TransactionType" } }, { "name": "filter[business_plan]", "in": "query", "required": false, "description": "Filter by business plan enum name", "schema": { "$ref": "#/components/schemas/BusinessPlanType" } }, { "name": "filter[archived]", "in": "query", "required": false, "description": "Filter by archived state. Omit to return both active and archived deals; pass true for only archived, false for only active", "schema": { "type": "boolean" } }, { "name": "filter[loan_amount][gte]", "in": "query", "required": false, "description": "Minimum loan amount", "schema": { "type": "number" } }, { "name": "filter[loan_amount][lte]", "in": "query", "required": false, "description": "Maximum loan amount", "schema": { "type": "number" } }, { "name": "filter[created_at][gte]", "in": "query", "required": false, "description": "Created after (ISO 8601)", "schema": { "type": "string" } }, { "name": "filter[created_at][lte]", "in": "query", "required": false, "description": "Created before (ISO 8601)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Deal" } }, "pagination": { "type": "object" } } } } } }, "400": { "description": "cursor and sort cannot be combined; use offset pagination when sorting", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postDeals", "summary": "Create a new deal", "description": "Create a new deal\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "title" ], "type": "object", "properties": { "title": { "type": "string", "description": "Deal title (1–255 characters)" }, "loan_amount": { "type": "number", "description": "Requested loan amount" }, "loan_type": { "$ref": "#/components/schemas/LoanType", "description": "Loan type enum name, such as construction, heavy_bridge, or permanent" }, "transaction_type": { "$ref": "#/components/schemas/TransactionType", "description": "Transaction type enum name, such as acquisition, refinance, or new_construction" }, "business_plan": { "$ref": "#/components/schemas/BusinessPlanType", "description": "Business plan enum name: stabilized, value_add, construction, or land" }, "description": { "type": "string", "description": "Deal description" }, "estimated_close_date": { "type": "string", "description": "Estimated close date (ISO 8601)" }, "pipeline_ids": { "type": "array", "items": { "type": "integer" }, "description": "Pipeline IDs to add the deal to" }, "deal_financials": { "$ref": "#/components/schemas/DealFinancialsWrite", "description": "Deal-level financial fields to create with the deal" } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Deal" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "title is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/deals/{deal_id}": { "get": { "operationId": "getDealsDealId", "summary": "Get a single deal by ID", "description": "Get a single deal by ID\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "include", "in": "query", "required": false, "description": "Sub-resources to embed: financials, properties, team, pipelines", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Deal" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "patch": { "operationId": "patchDealsDealId", "summary": "Update a deal (partial update)", "description": "Update a deal (partial update)\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Deal title (min 1 character)" }, "loan_amount": { "type": "number", "description": "Requested loan amount" }, "loan_type": { "$ref": "#/components/schemas/LoanType", "description": "Loan type enum name" }, "transaction_type": { "$ref": "#/components/schemas/TransactionType", "description": "Transaction type enum name" }, "business_plan": { "$ref": "#/components/schemas/BusinessPlanType", "description": "Business plan enum name" }, "description": { "type": "string", "description": "Deal description" }, "estimated_close_date": { "type": "string", "description": "Estimated close date (ISO 8601)" }, "deal_financials": { "$ref": "#/components/schemas/DealFinancialsWrite", "description": "Deal-level financial fields to update" } }, "minProperties": 1 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Deal" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] }, "delete": { "operationId": "deleteDealsDealId", "summary": "Archive (soft-delete) a deal", "description": "Archive (soft-delete) a deal\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/index/search": { "post": { "operationId": "postDealsDealIdIndexSearch", "summary": "Search canonical indexed deal facts by natural-language context", "description": "Search canonical indexed deal facts by natural-language context\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "context" ], "type": "object", "properties": { "context": { "type": "string", "minLength": 1, "maxLength": 4000, "description": "Natural-language search context. Be specific about the metric or topic you want." }, "min_score": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.3, "description": "Minimum similarity threshold from 0 to 1." }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 20, "description": "Maximum ranked facts to return. Values are clamped to 1-200." }, "include_signed_urls": { "type": "boolean", "default": false, "description": "When true, document-backed source records may include short-lived signed URLs." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealIndexSearchResult" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "context must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal data search is temporarily unavailable. Try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/index/observations": { "post": { "operationId": "postDealsDealIdIndexObservations", "summary": "List per-document candidate values behind a deal fact", "description": "List per-document candidate values behind a deal fact\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "anyOf": [ { "required": [ "sot_id" ] }, { "required": [ "metric_id" ] } ], "properties": { "sot_id": { "type": "string", "pattern": "^[A-Za-z]+:[A-Za-z0-9:_-]+$", "description": "Prefixed SOT id from a prior /index/search result (e.g. 'd:5362', 'a:123:property:690'). At least one of sot_id or metric_id is required." }, "metric_id": { "type": "integer", "minimum": 1, "description": "Numeric metric definition id. Use to fetch every observation for a metric across entities." }, "entity_ref": { "type": "string", "description": "Optional entity scoping (e.g. property:690). Intended for use with metric_id; combining with sot_id has no additional effect." }, "page": { "type": "integer", "minimum": 1, "default": 1, "description": "1-based page number." }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 20, "description": "Observations per page. Values are clamped to 1-200." }, "include_signed_urls": { "type": "boolean", "default": false, "description": "When true, document-backed source records may include short-lived signed URLs." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealIndexObservation" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "Provide at least one of sot_id or metric_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal observations are temporarily unavailable. Please try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/index/facts": { "patch": { "operationId": "patchDealsDealIdIndexFacts", "summary": "Update a single canonical deal fact value", "description": "Update a single canonical deal fact value\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "sot_id" ], "type": "object", "oneOf": [ { "required": [ "value" ] }, { "required": [ "observation_id" ] } ], "properties": { "sot_id": { "type": "string", "pattern": "^[A-Za-z]+:[A-Za-z0-9:_-]+$", "description": "Prefixed SOT id from a prior /index/search result (e.g. 'd:5362', 'a:123:property:690'). Identifies the fact to update." }, "value": { "type": "string", "description": "Free-text replacement value. Provide exactly one of value or observation_id." }, "observation_id": { "type": "integer", "minimum": 1, "description": "Observation id to promote as the new canonical value. Returned by /index/observations and preserves source document, page range, and confidence." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealIndexFact" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "Provide exactly one of value or observation_id; Metric is not editable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal fact update is temporarily unavailable. Please try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] }, "post": { "operationId": "postDealsDealIdIndexFacts", "summary": "Record one or more user-supplied metric values on a deal", "description": "Record one or more user-supplied metric values on a deal\n\nDocs page: https://www.lev.com/docs/build/deals\n\nDocumented response: `results` reports the outcome of each submitted value in request order; `metric_sot_values` aggregates the SOTs that were written. Each `results[].sot` has the same shape as a `metric_sot_values` entry.", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "values" ], "properties": { "values": { "type": "array", "minItems": 1, "description": "One or more metric values to record. Must contain at least one item.", "items": { "type": "object", "required": [ "metric_id", "value" ], "properties": { "metric_id": { "type": "integer", "minimum": 1, "description": "Metric definition id from /index/metric-definitions." }, "value": { "type": "string", "minLength": 1, "description": "User-supplied value to record. Must not be blank." }, "entity_ref": { "type": "string", "nullable": true, "description": "Entity to attach the value to, from /index/entities (e.g. 'property:690'). Must match the metric's entity type." }, "group_ref": { "type": "string", "nullable": true, "description": "Groups several submitted values under the same not-yet-created entity. Use only when no entity_ref is available." } } } } } } } } }, "responses": { "200": { "description": "`results` reports the outcome of each submitted value in request order; `metric_sot_values` aggregates the SOTs that were written. Each `results[].sot` has the same shape as a `metric_sot_values` entry.", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealIndexFactInsertResponse" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "values must contain at least one item; value must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal fact insert is temporarily unavailable. Please try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/index/metric-definitions": { "get": { "operationId": "getDealsDealIdIndexMetricDefinitions", "summary": "List the metric definitions that can be recorded on a deal", "description": "List the metric definitions that can be recorded on a deal\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "metric_label", "in": "query", "required": false, "description": "Case-insensitive search term to filter by metric label (for example, noi).", "schema": { "type": "string" } }, { "name": "category_id", "in": "query", "required": false, "description": "Filter to a single metric category id (greater than 0).", "schema": { "type": "integer" } }, { "name": "page", "in": "query", "required": false, "description": "1-based page number. Defaults to 1.", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Metric definitions per page. Defaults to 100 and is clamped to 1-200.", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealIndexMetricDefinition" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "limit must be an integer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal metric definitions are temporarily unavailable. Please try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/index/entities": { "get": { "operationId": "getDealsDealIdIndexEntities", "summary": "List the entities you can attach recorded facts to", "description": "List the entities you can attach recorded facts to\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealIndexEntity" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "503": { "description": "Deal entities are temporarily unavailable. Please try again shortly.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/vaults": { "get": { "operationId": "getDealsDealIdVaults", "summary": "List a deal's vaults — its private Resources area and any shared Deal Rooms", "description": "List a deal's vaults — its private Resources area and any shared Deal Rooms\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Vault" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: documents:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/documents": { "get": { "operationId": "getDealsDealIdDocuments", "summary": "List a deal's uploaded documents across all of its vaults", "description": "List a deal's uploaded documents across all of its vaults\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Documents per page. Defaults to 50 and is clamped to 1-200.", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for the next page.", "schema": { "type": "string" } }, { "name": "search", "in": "query", "required": false, "description": "Case-insensitive substring match on the document file name.", "schema": { "type": "string" } }, { "name": "extension", "in": "query", "required": false, "description": "Filter to one file extension, e.g. `pdf` or `xlsx`. Omit the leading dot.", "schema": { "type": "string" } }, { "name": "folder_id", "in": "query", "required": false, "description": "Only documents directly inside this folder. Omit to span the whole vault.", "schema": { "type": "integer" } }, { "name": "vault_id", "in": "query", "required": false, "description": "Only documents in this vault (a Deal Room or Resources). Get ids from [List Vaults](#list-vaults). Omit to span every vault on the deal.", "schema": { "type": "integer" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include. `id` and `vault` are always included.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealDocument" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: documents:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found; Vault not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "This endpoint does not accept filter parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/documents/{document_id}": { "get": { "operationId": "getDealsDealIdDocumentsDocumentId", "summary": "Fetch metadata for one uploaded document", "description": "Fetch metadata for one uploaded document\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "document_id", "in": "path", "required": true, "description": "The document ID from the list endpoint", "schema": { "type": "integer" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields to include. `id` is always included.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealDocument" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: documents:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Document not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/documents/{document_id}/download": { "get": { "operationId": "getDealsDealIdDocumentsDocumentIdDownload", "summary": "Fetch a short-lived signed download link for one uploaded document", "description": "Fetch a short-lived signed download link for one uploaded document\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "document_id", "in": "path", "required": true, "description": "The document ID from the list endpoint", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealDocumentDownload" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: documents:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Document not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/checklists": { "get": { "operationId": "getDealsDealIdChecklists", "summary": "List a deal's checklists — one per shared Deal Room, with sections, tasks, document types, and task-linked files", "description": "List a deal's checklists — one per shared Deal Room, with sections, tasks, document types, and task-linked files\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "vault_id", "in": "query", "required": false, "description": "Only return the checklist for one shared Deal Room. Omit to return every Deal Room checklist on the deal.", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealChecklist" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: checklists:read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/memos": { "get": { "operationId": "getDealsDealIdMemos", "summary": "List a deal's generated memos (deal books)", "description": "List a deal's generated memos (deal books)\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Memos per page. Defaults to 50 and is clamped to 1-200.", "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "required": false, "description": "0-based index of the first memo to return. Defaults to 0.", "schema": { "type": "integer" } }, { "name": "search", "in": "query", "required": false, "description": "Case-insensitive substring match on the memo title.", "schema": { "type": "string" } }, { "name": "filter[title]", "in": "query", "required": false, "description": "Exact match on the full memo title. Use search for a substring match instead.", "schema": { "type": "string" } }, { "name": "filter[status]", "in": "query", "required": false, "description": "Filter by publish state: draft or published.", "schema": { "type": "string" } }, { "name": "filter[memo_type]", "in": "query", "required": false, "description": "Filter by memo type: debt_financing_om, credit_memo, investment_sales, debt_brokerage, equity_raise, broker_opinion_of_value, investment_committee, invoice, or other.", "schema": { "type": "string" } }, { "name": "filter[pdf_ready]", "in": "query", "required": false, "description": "Filter to memos whose downloadable PDF has rendered (true) or not yet (false).", "schema": { "type": "boolean" } }, { "name": "vault_id", "in": "query", "required": false, "description": "Only memos in this vault (a Deal Room or Resources). Get ids from [List Vaults](#list-vaults). Omit to span every vault on the deal.", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DealMemo" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/memos/{memo_uuid}": { "get": { "operationId": "getDealsDealIdMemosMemoUuid", "summary": "Fetch one memo with signed PDF download links", "description": "Fetch one memo with signed PDF download links\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "memo_uuid", "in": "path", "required": true, "description": "The memo's UUID, from the `uuid` field on a List Memos row.", "schema": { "type": "string" } }, { "name": "quality", "in": "query", "required": false, "description": "Which rendered variant `pdf_url` points at: `original` (default), `high`, `medium`, or `low`. An unknown value returns 400.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/DealMemoDetail" } } } } } }, "400": { "description": "Invalid quality: bogus. Allowed: original, high, medium, low", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Memo not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/notes": { "get": { "operationId": "getDealsDealIdNotes", "summary": "List notes logged on a deal", "description": "List notes logged on a deal\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Note" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postDealsDealIdNotes", "summary": "Add a note to a deal", "description": "Add a note to a deal\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Note text. Must be non-empty." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/deals/{deal_id}/notes/{note_id}": { "patch": { "operationId": "patchDealsDealIdNotesNoteId", "summary": "Edit a deal note", "description": "Edit a deal note\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Replacement note text. Must be non-empty." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "400": { "description": "text cannot be empty", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deleteDealsDealIdNotesNoteId", "summary": "Permanently delete a deal note", "description": "Permanently delete a deal note\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/checklist-tasks/{task_id}/notes": { "get": { "operationId": "getChecklistTasksTaskIdNotes", "summary": "List comments on a checklist task", "description": "List comments on a checklist task\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Note" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postChecklistTasksTaskIdNotes", "summary": "Add a comment to a checklist task", "description": "Add a comment to a checklist task\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Comment text. Must be non-empty." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/checklist-tasks/{task_id}/notes/{note_id}": { "patch": { "operationId": "patchChecklistTasksTaskIdNotesNoteId", "summary": "Edit a checklist task comment", "description": "Edit a checklist task comment\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Replacement comment text. Must be non-empty." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "400": { "description": "text cannot be empty", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deleteChecklistTasksTaskIdNotesNoteId", "summary": "Permanently delete a checklist task comment", "description": "Permanently delete a checklist task comment\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/checklist-tasks": { "post": { "operationId": "postChecklistTasks", "summary": "Add a task to a deal's checklist", "description": "Add a task to a deal's checklist\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "title" ], "oneOf": [ { "required": [ "section_id" ] }, { "required": [ "checklist_id" ] }, { "required": [ "parent_task_id" ] } ], "properties": { "title": { "type": "string", "minLength": 1, "description": "Task title. Must be non-empty." }, "section_id": { "type": "integer", "description": "Add the task inside this checklist section. Provide exactly one of section_id, checklist_id, or parent_task_id." }, "checklist_id": { "type": "integer", "description": "Add the task at the checklist root, outside any section. Provide exactly one of section_id, checklist_id, or parent_task_id." }, "parent_task_id": { "type": "integer", "description": "Add the task as a subtask of this task (one level deep). Provide exactly one of section_id, checklist_id, or parent_task_id." }, "description": { "type": "string", "description": "Optional longer detail." }, "status": { "type": "string", "enum": [ "to_do", "requested", "reviewing", "updates_needed", "approved", "cancelled" ], "default": "to_do", "description": "Initial review state. Defaults to to_do." }, "assigned_user_id": { "type": "integer", "description": "Lev user id to assign. Must be an active teammate in your account." }, "due_date": { "type": "string", "format": "date", "description": "Due date, YYYY-MM-DD." }, "document_type_ids": { "type": "array", "items": { "type": "integer" }, "description": "Expected document type ids for the request." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/ChecklistTask" } } } } } }, "400": { "description": "assigned_user_id must belong to an active user in your account", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: checklists:write", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Section, checklist, or parent task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "Provide exactly one of section_id, checklist_id, or parent_task_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/checklist-tasks/{task_id}": { "patch": { "operationId": "patchChecklistTasksTaskId", "summary": "Change a checklist task's fields", "description": "Change a checklist task's fields\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "New title. Must be non-empty if provided." }, "description": { "type": "string", "nullable": true, "description": "New description. Send null to clear." }, "status": { "type": "string", "enum": [ "to_do", "requested", "reviewing", "updates_needed", "approved", "cancelled" ], "description": "New review state." }, "assigned_user_id": { "type": "integer", "nullable": true, "description": "New assignee. Send null to unassign. Must be an active teammate in your account." }, "due_date": { "type": "string", "format": "date", "nullable": true, "description": "New due date, YYYY-MM-DD. Send null to clear." }, "is_completed": { "type": "boolean", "enum": [ false ], "description": "Pass false to reopen a completed task. To mark a task complete use POST /checklist-tasks/{task_id}/complete." }, "document_type_ids": { "type": "array", "items": { "type": "integer" }, "nullable": true, "description": "Replace the expected document type ids. Send null to clear." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/ChecklistTask" } } } } } }, "400": { "description": "assigned_user_id must belong to an active user in your account", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: checklists:write", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "is_completed accepts false only; to mark a task complete use the complete endpoint", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/checklist-tasks/{task_id}/complete": { "post": { "operationId": "postChecklistTasksTaskIdComplete", "summary": "Mark a checklist task complete", "description": "Mark a checklist task complete\n\nDocs page: https://www.lev.com/docs/build/deals", "tags": [ "Deals" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "description": "The checklist task ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/ChecklistTask" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Missing required scope: checklists:write", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Checklist task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/deals", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/lenders/directory": { "get": { "operationId": "getLendersDirectory", "summary": "Browse the lender directory", "description": "Browse the lender directory\n\nDocs page: https://www.lev.com/docs/build/lender-directory", "tags": [ "Lender Directory" ], "parameters": [ { "name": "name", "in": "query", "required": false, "description": "Search by lender name (case-insensitive)", "schema": { "type": "string" } }, { "name": "filter[state]", "in": "query", "required": false, "description": "Filter by state", "schema": { "type": "string" } }, { "name": "sort", "in": "query", "required": false, "description": "Sort by: name", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Comma-separated fields", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/LenderDirectoryLender" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/lender-directory", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/lenders/{org_id}": { "get": { "operationId": "getLendersOrgId", "summary": "Get detailed lender information including programs", "description": "Get detailed lender information including programs\n\nDocs page: https://www.lev.com/docs/build/lender-directory", "tags": [ "Lender Directory" ], "parameters": [ { "name": "org_id", "in": "path", "required": true, "description": "Organization ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/LenderDirectoryLender" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Lender not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/lender-directory", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/lenders/{org_id}/programs": { "get": { "operationId": "getLendersOrgIdPrograms", "summary": "List lending programs for a lender", "description": "List lending programs for a lender\n\nDocs page: https://www.lev.com/docs/build/lender-directory", "tags": [ "Lender Directory" ], "parameters": [ { "name": "org_id", "in": "path", "required": true, "description": "Organization ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/LenderProgram" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Lender not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/lender-directory", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/market/base-rates": { "get": { "operationId": "getMarketBaseRates", "summary": "Get current base rates (SOFR, CMT, Prime, etc.)", "description": "Get current base rates (SOFR, CMT, Prime, etc.)\n\nDocs page: https://www.lev.com/docs/build/market-data", "tags": [ "Market Data" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/market-data", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/market/asset-types": { "get": { "operationId": "getMarketAssetTypes", "summary": "Get available asset type definitions", "description": "Get available asset type definitions\n\nDocs page: https://www.lev.com/docs/build/market-data", "tags": [ "Market Data" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/market-data", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/pipelines": { "get": { "operationId": "getPipelines", "summary": "List all pipelines available to your account", "description": "List all pipelines available to your account\n\nDocs page: https://www.lev.com/docs/build/pipelines", "tags": [ "Pipelines" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "400": { "description": "cursor and sort cannot be combined; use offset pagination when sorting", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/pipelines", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/pipelines/{pipeline_id}": { "get": { "operationId": "getPipelinesPipelineId", "summary": "Get a single pipeline with its statuses", "description": "Get a single pipeline with its statuses\n\nDocs page: https://www.lev.com/docs/build/pipelines", "tags": [ "Pipelines" ], "parameters": [ { "name": "pipeline_id", "in": "path", "required": true, "description": "The pipeline ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Pipeline not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/pipelines", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] } }, "/api/external/v2/deals/{deal_id}/pipeline": { "post": { "operationId": "postDealsDealIdPipeline", "summary": "Move a deal to a pipeline stage", "description": "Move a deal to a pipeline stage\n\nDocs page: https://www.lev.com/docs/build/pipelines", "tags": [ "Pipelines" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "pipeline_id" ], "type": "object", "properties": { "pipeline_id": { "type": "integer", "description": "Target pipeline ID" }, "pipeline_status_id": { "type": "integer", "description": "Target status within the pipeline. Defaults to the first status in the pipeline." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "object" } } } } } }, "400": { "description": "Pipeline not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/pipelines", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/placements": { "get": { "operationId": "getPlacements", "summary": "List placements with pagination", "description": "List placements with pagination\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Placement" } }, "pagination": { "type": "object" } } } } } }, "400": { "description": "cursor and sort cannot be combined; use offset pagination when sorting", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postPlacements", "summary": "Create a placement against a deal", "description": "Create a placement against a deal\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "deal_id", "private_company_id" ], "type": "object", "properties": { "deal_id": { "type": "integer", "description": "ID of the deal this placement belongs to" }, "private_company_id": { "type": "integer", "description": "ID of the lender private company (use `GET /companies` to find candidates)" }, "contact_id": { "type": "integer", "description": "ID of the lender contact for this outreach. Must belong to the lender at `private_company_id`. Omit it and Lev runs an async AI match to recommend a contact at that lender; the recommended contact's name stays masked until you unlock it" }, "status": { "type": "string", "description": "Placement status enum name. Defaults to `new`. Cannot be `archived` on create" }, "visibility": { "type": "string", "description": "Placement visibility (`hidden`, `masked`, `shared`)" }, "description": { "type": "string", "description": "Free-text note (e.g. lender-specific feedback)" }, "score": { "type": "number", "description": "Manual relevance score (0–100)" }, "outreach_date": { "type": "string", "description": "ISO 8601 timestamp the lender was first contacted" }, "lender_status": { "type": "string", "description": "Lender-side status enum name" } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Placement" } } } } } }, "400": { "description": "Cannot create a placement with status='archived'; create an active placement and PATCH to archive; A placement already exists for this deal, contact, and lender; use PATCH to update it", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found; Private company not found; Contact not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "status: input is not a valid enum member", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/placements/{placement_id}": { "get": { "operationId": "getPlacementsPlacementId", "summary": "Get a single placement by ID", "description": "Get a single placement by ID\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Placement" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "patch": { "operationId": "patchPlacementsPlacementId", "summary": "Update a placement (partial update)", "description": "Update a placement (partial update)\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "Placement status enum name. Use `archived` to remove the placement" }, "visibility": { "type": "string", "description": "Placement visibility (`hidden`, `masked`, `shared`)" }, "description": { "type": "string", "description": "Free-text note. Changing it also appends a note to the placement's notes (List Placement Notes)" }, "score": { "type": "number", "description": "Manual relevance score (0–100)" }, "outreach_date": { "type": "string", "description": "ISO 8601 timestamp the lender was first contacted" }, "lender_status": { "type": "string", "description": "Lender-side status enum name" } }, "minProperties": 1 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Placement" } } } } } }, "400": { "description": "Request body must contain at least one field to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "status: input is not a valid enum member", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/placements/{placement_id}/notes": { "get": { "operationId": "getPlacementsPlacementIdNotes", "summary": "List notes logged on a placement", "description": "List notes logged on a placement\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Note" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postPlacementsPlacementIdNotes", "summary": "Add a note to a placement", "description": "Add a note to a placement\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Note text. Must be non-empty." } } } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/placements/{placement_id}/notes/{note_id}": { "patch": { "operationId": "patchPlacementsPlacementIdNotesNoteId", "summary": "Edit a placement note", "description": "Edit a placement note\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string", "description": "Replacement note text. Must be non-empty." } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/Note" } } } } } }, "400": { "description": "text cannot be empty", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "text must not be blank", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deletePlacementsPlacementIdNotesNoteId", "summary": "Permanently delete a placement note", "description": "Permanently delete a placement note\n\nDocs page: https://www.lev.com/docs/build/placements", "tags": [ "Placements" ], "parameters": [ { "name": "placement_id", "in": "path", "required": true, "description": "The placement ID", "schema": { "type": "integer" } }, { "name": "note_id", "in": "path", "required": true, "description": "The note ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement or note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/placements", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } }, "/api/external/v2/deals/{deal_id}/term-sheets": { "get": { "operationId": "getDealsDealIdTermSheets", "summary": "List term sheets for a deal", "description": "List term sheets for a deal\n\nDocs page: https://www.lev.com/docs/build/term-sheets", "tags": [ "Term Sheets" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Results per page (1–200, default 50)", "schema": { "type": "integer" } }, { "name": "cursor", "in": "query", "required": false, "description": "Cursor for next page", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/TermSheet" } }, "pagination": { "type": "object" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/term-sheets", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "post": { "operationId": "postDealsDealIdTermSheets", "summary": "Create a new term sheet against a placement", "description": "Create a new term sheet against a placement\n\nDocs page: https://www.lev.com/docs/build/term-sheets\n\nDocumented response: returns the full term-sheet detail object (see [Term Sheet Object](#term-sheet-object)).", "tags": [ "Term Sheets" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "placement_id", "total_rate", "initial_funding", "quote_type", "rate_type" ], "type": "object", "properties": { "placement_id": { "type": "integer", "description": "ID of the placement (lender outreach) this quote belongs to. Must be a placement on this deal" }, "total_rate": { "type": "number", "description": "Rate as a percent. Send the spread when `base_rate` is set, and send the all-in fixed rate when `base_rate` is omitted or `none-fixed`" }, "initial_funding": { "type": "integer", "description": "Provided loan amount (whole dollars)" }, "quote_type": { "type": "string", "description": "Quote type enum (see [Enums](#enums))" }, "rate_type": { "type": "string", "description": "Rate type enum (`fixed` or `floating`)" }, "title": { "type": "string", "description": "Free-text title" }, "winning": { "type": "boolean", "description": "Mark as the winning quote on the deal. Defaults to `false`" }, "is_visible_to_borrower": { "type": "boolean", "description": "Whether the term sheet is visible to the borrower. Defaults to `true`" }, "base_rate": { "type": "string", "description": "Base-rate identifier — accepts either an enum key (e.g. `treasury_y5`, `sofr_m1`, `prime_rate`) or the display value returned by [`GET /market/base-rates`](/build/market-data#base-rates) (e.g. `Treasury 5-Yr`, `SOFR 30-Day Avg`, `Prime Rate`). Use `none-fixed` for fixed-rate quotes with no underlying benchmark. When this is a real base-rate identifier, send `total_rate` as the spread over that base rate" }, "max_ltv": { "type": "number", "description": "Maximum loan-to-value as a decimal ratio (e.g. `0.70` for 70%)" }, "max_ltc": { "type": "number", "description": "Maximum loan-to-cost as a decimal ratio (e.g. `0.65` for 65%)" }, "additional_funding": { "type": "integer", "description": "Additional funding amount" }, "floor": { "type": "number", "description": "Rate floor as a percent (e.g. `5.00` for 5%)" }, "floor_type": { "type": "string", "description": "Floor type (`base_rate` or `total_rate`)" }, "term": { "type": "integer", "description": "Term length in months" }, "amortization": { "type": "integer", "description": "Amortization period in months" }, "io_period": { "type": "integer", "description": "Interest-only period in months" }, "extension_one": { "type": "integer", "description": "First extension period in months" }, "extension_two": { "type": "integer", "description": "Second extension period in months" }, "extension_three": { "type": "integer", "description": "Third extension period in months" }, "recourse": { "type": "string", "description": "Recourse category enum" }, "recourse_type": { "type": "string", "description": "Recourse type enum" }, "prepayment_penalty": { "type": "string", "description": "Prepayment penalty enum" }, "prepayment_penalty_details": { "type": "string", "description": "Free-text prepayment penalty details" }, "min_dscr": { "type": "number", "description": "Minimum debt-service coverage ratio (e.g. `1.25`)" }, "min_debt_yield": { "type": "number", "description": "Minimum debt yield as a decimal ratio (e.g. `0.08` for 8%)" }, "origination_fee": { "type": "number", "description": "Origination fee as a decimal ratio (e.g. `0.01` for 1%)" }, "extension_fee": { "type": "number", "description": "Extension fee as a decimal ratio (e.g. `0.0025` for 0.25%)" }, "exit_fee": { "type": "number", "description": "Exit fee as a decimal ratio (e.g. `0.005` for 0.5%)" }, "good_faith_deposit": { "type": "number", "description": "Good-faith deposit amount" }, "notes": { "type": "string", "description": "Free-text notes" }, "ir_details": { "type": "string", "description": "Free-text interest reserve details" }, "payment_method": { "type": "string", "description": "Payment method enum" }, "capital_source_type": { "type": "string", "description": "Capital source type enum (lender program classification)" } } } } } }, "responses": { "201": { "description": "returns the full term-sheet detail object (see [Term Sheet Object](#term-sheet-object)).", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/TermSheet" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Placement not found; Deal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "quote_type: input is not a valid enum member; base_rate: not a valid BaseRateNames member", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/term-sheets", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] } }, "/api/external/v2/deals/{deal_id}/term-sheets/{term_sheet_id}": { "get": { "operationId": "getDealsDealIdTermSheetsTermSheetId", "summary": "Get a single term sheet", "description": "Get a single term sheet\n\nDocs page: https://www.lev.com/docs/build/term-sheets", "tags": [ "Term Sheets" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "term_sheet_id", "in": "path", "required": true, "description": "The term sheet ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/TermSheet" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Term sheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/term-sheets", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: " ] }, "patch": { "operationId": "patchDealsDealIdTermSheetsTermSheetId", "summary": "Update a term sheet (partial update)", "description": "Update a term sheet (partial update)\n\nDocs page: https://www.lev.com/docs/build/term-sheets\n\nDocumented response: returns the updated term-sheet detail object.", "tags": [ "Term Sheets" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "term_sheet_id", "in": "path", "required": true, "description": "The term sheet ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Free-text title" }, "winning": { "type": "boolean", "description": "Mark or unmark as the winning quote on the deal" }, "total_rate": { "type": "number", "description": "Rate as a percent. Interpreted against the resulting `base_rate`: spread when `base_rate` is set, all-in fixed rate when `base_rate` is `null` or `none-fixed`. Omitting `base_rate` leaves the existing base-rate setting unchanged" }, "initial_funding": { "type": "integer", "description": "Provided loan amount (whole dollars)" }, "quote_type": { "type": "string", "description": "Quote type enum (see [Enums](#enums))" }, "rate_type": { "type": "string", "description": "Rate type enum (`fixed` or `floating`)" }, "base_rate": { "type": "string", "nullable": true, "description": "Base-rate identifier — enum key (e.g. `treasury_y5`) or display value (e.g. `Treasury 5-Yr`). Omit to leave unchanged. Send `null` or `none-fixed` for fixed-rate quotes with no benchmark; see special handling below" }, "max_ltv": { "type": "number", "description": "Maximum loan-to-value as a decimal ratio (e.g. `0.70` for 70%)" }, "max_ltc": { "type": "number", "description": "Maximum loan-to-cost as a decimal ratio" }, "additional_funding": { "type": "integer", "description": "Additional funding amount" }, "floor": { "type": "number", "description": "Rate floor as a percent" }, "floor_type": { "type": "string", "description": "Floor type (`base_rate` or `total_rate`)" }, "term": { "type": "integer", "description": "Term length in months" }, "amortization": { "type": "integer", "description": "Amortization period in months" }, "io_period": { "type": "integer", "description": "Interest-only period in months" }, "extension_one": { "type": "integer", "description": "First extension period in months" }, "extension_two": { "type": "integer", "description": "Second extension period in months" }, "extension_three": { "type": "integer", "description": "Third extension period in months" }, "recourse": { "type": "string", "description": "Recourse category enum" }, "recourse_type": { "type": "string", "description": "Recourse type enum" }, "prepayment_penalty": { "type": "string", "description": "Prepayment penalty enum" }, "prepayment_penalty_details": { "type": "string", "description": "Free-text prepayment penalty details" }, "min_dscr": { "type": "number", "description": "Minimum debt-service coverage ratio (e.g. `1.25`)" }, "min_debt_yield": { "type": "number", "description": "Minimum debt yield as a decimal ratio" }, "origination_fee": { "type": "number", "description": "Origination fee as a decimal ratio (e.g. `0.01` for 1%)" }, "extension_fee": { "type": "number", "description": "Extension fee as a decimal ratio" }, "exit_fee": { "type": "number", "description": "Exit fee as a decimal ratio" }, "good_faith_deposit": { "type": "number", "description": "Good-faith deposit amount" }, "notes": { "type": "string", "description": "Free-text notes" }, "ir_details": { "type": "string", "description": "Free-text interest reserve details" }, "is_visible_to_borrower": { "type": "boolean", "description": "Whether the term sheet is visible to the borrower" }, "payment_method": { "type": "string", "description": "Payment method enum" }, "capital_source_type": { "type": "string", "description": "Capital source type enum" } }, "minProperties": 1 } } } }, "responses": { "200": { "description": "returns the updated term-sheet detail object.", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/TermSheet" } } } } } }, "400": { "description": "Request body must contain at least one field to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Term sheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "422": { "description": "winning cannot be null. Send true or false to update it, or omit the field to leave it unchanged.; base_rate: not a valid BaseRateNames member", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/term-sheets", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json", "Idempotency-Key: " ] }, "delete": { "operationId": "deleteDealsDealIdTermSheetsTermSheetId", "summary": "Soft-delete a term sheet", "description": "Soft-delete a term sheet\n\nDocs page: https://www.lev.com/docs/build/term-sheets", "tags": [ "Term Sheets" ], "parameters": [ { "name": "deal_id", "in": "path", "required": true, "description": "The deal ID", "schema": { "type": "integer" } }, { "name": "term_sheet_id", "in": "path", "required": true, "description": "The term sheet ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "data": { "$ref": "#/components/schemas/BooleanDeleteResult" } } } } } }, "401": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } }, "404": { "description": "Term sheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorEnvelope" } } } } }, "security": [ { "bearerAuth": [] } ], "x-lev-docs-page": "https://www.lev.com/docs/build/term-sheets", "x-lev-headers": [ "Authorization: Bearer ", "X-Origin-App: ", "Content-Type: application/json" ] } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API Key or JWT" } }, "schemas": { "LoanType": { "type": "string", "enum": [ "construction", "heavy_bridge", "light_bridge", "permanent", "land", "predevelopment", "tbd" ], "description": "Deal loan_type enum name." }, "TransactionType": { "type": "string", "enum": [ "tbd", "acquisition", "refinance", "new_construction" ], "description": "Deal transaction_type enum name." }, "BusinessPlanType": { "type": "string", "enum": [ "stabilized", "value_add", "construction", "land" ], "description": "Deal business_plan enum name." }, "PhoneIn": { "type": "object", "description": "Phone number input. e164 is always computed server-side from raw — caller-supplied values are ignored, so normalization cannot be bypassed.", "required": [ "raw" ], "properties": { "raw": { "type": "string", "description": "Phone number in any common format; normalized to E.164 server-side. Unparseable numbers return 422." }, "type": { "type": "string", "enum": [ "mobile", "office", "fax" ], "default": "mobile", "description": "Phone type." }, "country": { "type": "string", "default": "US", "description": "2-letter ISO region used to parse numbers without a + prefix." }, "extension": { "type": "string", "description": "Extension digits." } } }, "Phone": { "type": "object", "description": "Phone number as stored on a contact. e164 is the normalized canonical number (always server-computed from raw). Fields may be null on records created before phone support.", "properties": { "id": { "type": "string", "nullable": true }, "type": { "type": "string", "nullable": true, "description": "mobile, office, or fax." }, "raw": { "type": "string", "nullable": true, "description": "The number as originally entered." }, "country": { "type": "string", "nullable": true }, "e164": { "type": "string", "nullable": true, "description": "Normalized E.164 number." }, "extension": { "type": "string", "nullable": true } } }, "ChecklistVaultRef": { "type": "object", "description": "The shared Deal Room vault a checklist belongs to.", "properties": { "id": { "type": "integer", "description": "Vault id. Pass as vault_id on the checklist endpoint to read one room." }, "type": { "type": "string", "description": "Vault type. Always shared for checklist responses." }, "title": { "type": "string", "nullable": true, "description": "Human-readable Deal Room name." } } }, "ChecklistAssignee": { "type": "object", "description": "The Lev user assigned to a checklist task.", "properties": { "id": { "type": "integer" }, "first_name": { "type": "string", "nullable": true }, "last_name": { "type": "string", "nullable": true }, "email": { "type": "string", "nullable": true } } }, "ChecklistAssignedTeam": { "type": "object", "description": "The account, lender, or borrower team assigned to a checklist task.", "properties": { "id": { "type": "integer" }, "type": { "type": "string", "enum": [ "account", "private_company" ] }, "name": { "type": "string", "nullable": true, "description": "Human-readable team name. Null when the reference is stale or outside the active account." } } }, "ChecklistCollaborator": { "type": "object", "description": "A person looped into a checklist task. id is null for external parties without a Lev account.", "properties": { "id": { "type": "integer", "nullable": true }, "email": { "type": "string", "nullable": true } } }, "ChecklistDocumentType": { "type": "object", "description": "Expected document type for a checklist task.", "properties": { "id": { "type": "integer" }, "name": { "type": "string", "nullable": true } } }, "ChecklistTaskFile": { "type": "object", "description": "Uploaded file already linked to a checklist task.", "properties": { "vault_resource_id": { "type": "integer", "description": "Vault-resource id for the linked file inside the Deal Room." }, "document_id": { "type": "integer", "nullable": true, "description": "Deal document id for the linked file." }, "name": { "type": "string", "nullable": true }, "origin": { "type": "string", "enum": [ "auto_match", "manually_added" ], "description": "How the file was linked to the task." } } }, "DealDocumentDownload": { "type": "object", "description": "Short-lived signed download link for one uploaded deal document.", "properties": { "file_name": { "type": "string", "nullable": true }, "download_url": { "type": "string" }, "expires_in": { "type": "integer", "description": "Signed URL lifetime in seconds." } } }, "VaultTag": { "type": "object", "description": "A compact reference to one vault — the `id`, `type`, and `title` subset of the full [Vault Object](#vault-object), embedded to tag a memo with a vault it lives in.", "properties": { "id": { "type": "integer" }, "type": { "type": "string", "description": "Structural category: `resources` (the deal's private working vault) or `shared` (a Deal Room)." }, "title": { "type": "string", "nullable": true } } }, "DocumentVaultRef": { "type": "object", "description": "The vault a document lives in, embedded on each document. The compact subset of the Vault object — intentionally omits the list-only is_default and document_count fields returned by the enumerate endpoint.", "properties": { "id": { "type": "integer", "description": "Vault id. Pass as vault_id on the documents list to drill into this vault." }, "type": { "type": "string", "description": "Structural category: resources (the private vault) or shared (a Deal Room)." }, "title": { "type": "string", "nullable": true, "description": "Human-readable vault name, e.g. Deal Resources or Deal Room." } } }, "DealFinancialsWrite": { "type": "object", "minProperties": 1, "additionalProperties": false, "description": "Writable deal-level financial fields for POST /deals and PATCH /deals/{deal_id}. Send at least one supported field. Omitted fields are unchanged on PATCH; null clears an existing value but cannot create a financials record by itself.", "properties": { "purchase_price": { "type": "number", "minimum": 0, "nullable": true, "description": "Purchase price." }, "estimated_value": { "type": "number", "minimum": 0, "nullable": true, "description": "Estimated value." }, "total_cost": { "type": "number", "minimum": 0, "nullable": true, "description": "Total cost." }, "total_cost_basis": { "type": "number", "minimum": 0, "nullable": true, "description": "Total cost basis." }, "land_cost": { "type": "number", "minimum": 0, "nullable": true, "description": "Land cost." } } }, "CurrentUser": { "type": "object", "properties": { "id": { "type": "integer", "description": "Account identifier" }, "name": { "type": "string", "description": "Account display name" }, "slug": { "type": "string", "description": "URL-safe identifier; pass as `X-Active-Account" }, "account_type": { "type": "string", "nullable": true, "description": "Account classification. One of `brokerage`, `borrower`, `lender`, `credit` (or `lev_internal` for Lev-internal accounts, which external callers are unlikely to see)." } } }, "AccountTeam": { "type": "object", "properties": { "id": { "type": "integer", "description": "User identifier" }, "first_name": { "type": "string", "nullable": true, "description": "First name" }, "last_name": { "type": "string", "nullable": true, "description": "Last name" }, "email": { "type": "string", "nullable": true, "description": "Email address" }, "role": { "type": "string", "nullable": true, "description": "Account role (admin, member, etc.)" }, "title": { "type": "string", "nullable": true, "description": "Job title" }, "photo_url": { "type": "string", "nullable": true, "description": "Profile photo URL" } } }, "BillingObjects": { "type": "object", "properties": { "type": { "type": "string", "nullable": true, "description": "Subscription type for the active account" }, "status": { "type": "string", "nullable": true, "description": "Current subscription status" }, "billing_cycle": { "type": "string", "nullable": true, "description": "Billing cadence, such as `monthly` or `annual" }, "end_date": { "type": "string", "nullable": true, "description": "Subscription end date as an ISO 8601 date" }, "enabled": { "type": "boolean", "description": "Whether the active account is provisioned for credit-based billing" }, "balance": { "type": "integer", "nullable": true, "description": "Current credit balance, or `null` when credits are not enabled" }, "unit": { "type": "string", "description": "Balance unit. Current value is `credits" } } }, "Company": { "type": "object", "properties": { "id": { "type": "integer", "description": "Company identifier" }, "name": { "type": "string", "nullable": true, "description": "Company name" }, "website": { "type": "string", "nullable": true, "description": "Website URL" }, "address": { "type": "string", "nullable": true, "description": "Street address" }, "city": { "type": "string", "nullable": true, "description": "City" }, "state": { "type": "string", "nullable": true, "description": "State" }, "zip": { "type": "string", "nullable": true, "description": "ZIP code" }, "org_id": { "type": "integer", "nullable": true, "description": "Linked global organization ID" }, "owner_account_id": { "type": "integer", "nullable": true, "description": "Owning account ID" }, "is_connected": { "type": "boolean", "description": "Whether this is a connected company" }, "linkedin_url": { "type": "string", "nullable": true, "description": "LinkedIn URL" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" } } }, "Contact": { "type": "object", "properties": { "id": { "type": "integer", "description": "Contact identifier" }, "contact_type": { "type": "string", "nullable": true, "description": "First entry from `contact_types`, kept as a string for backwards compatibility. `lender_contact` or `sponsor`." }, "contact_types": { "type": "array", "items": { "type": "string" }, "description": "All contact types assigned to the contact (a contact can be both a lender and a sponsor contact). Values: `lender_contact`, `sponsor`." }, "first_name": { "type": "string", "nullable": true, "description": "First name" }, "last_name": { "type": "string", "nullable": true, "description": "Last name" }, "email": { "type": "string", "nullable": true, "description": "Email address" }, "title": { "type": "string", "nullable": true, "description": "Job title" }, "department": { "type": "string", "nullable": true, "description": "Department" }, "address": { "type": "string", "nullable": true, "description": "Street address" }, "address2": { "type": "string", "nullable": true, "description": "Apartment, suite, or unit line" }, "city": { "type": "string", "nullable": true, "description": "City" }, "state": { "type": "string", "nullable": true, "description": "State" }, "zip": { "type": "string", "nullable": true, "description": "ZIP code" }, "linkedin_url": { "type": "string", "nullable": true, "description": "LinkedIn profile URL" }, "photo_url": { "type": "string", "nullable": true, "description": "URL to a profile photo" }, "phones": { "type": "array", "items": { "$ref": "#/components/schemas/Phone" }, "description": "Phone numbers (`[]` when none). Each: `{id, type, raw, country, e164, extension}` — `e164` is the normalized canonical number (always server-computed from `raw`); `type` is `mobile`, `office`, or `fax`; fields may be null on records created before phone support." }, "is_primary": { "type": "boolean", "description": "Whether this is the primary contact" }, "owner_account_id": { "type": "integer", "nullable": true, "description": "Owning account ID" }, "is_connected": { "type": "boolean", "description": "Whether this is a connected contact" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" } } }, "DealFinancials": { "type": "object", "properties": { "id": { "type": "integer", "description": "Financials record identifier" }, "deal_id": { "type": "integer", "nullable": true, "description": "Associated deal ID" }, "purchase_price": { "type": "number", "nullable": true, "description": "Purchase price" }, "asking_price": { "type": "number", "nullable": true, "description": "Asking price" }, "estimated_value": { "type": "number", "nullable": true, "description": "Estimated value" }, "in_place_noi": { "type": "number", "nullable": true, "description": "In-place Net Operating Income" }, "stabilized_noi": { "type": "number", "nullable": true, "description": "Stabilized NOI" }, "stabilized_value": { "type": "number", "nullable": true, "description": "Stabilized value" }, "stabilized_occupancy": { "type": "number", "nullable": true, "description": "Stabilized occupancy rate" }, "going_in_cap_rate": { "type": "number", "nullable": true, "description": "Going-in cap rate" }, "going_in_cap_rate_as_of_date": { "type": "string", "nullable": true, "description": "As-of date for going-in cap rate" }, "capex": { "type": "number", "nullable": true, "description": "Capital expenditures" }, "historical_capex": { "type": "number", "nullable": true, "description": "Historical capital expenditures" }, "land_cost": { "type": "number", "nullable": true, "description": "Land cost" }, "total_cost": { "type": "number", "nullable": true, "description": "Total cost" }, "total_cost_basis": { "type": "number", "nullable": true, "description": "Total cost basis" }, "cost_basis_to_date": { "type": "number", "nullable": true, "description": "Cost basis to date" }, "imputed_land_value": { "type": "number", "nullable": true, "description": "Imputed land value" }, "existing_debt": { "type": "number", "nullable": true, "description": "Existing debt amount" }, "estimated_cost_basis_if_refinance": { "type": "number", "nullable": true, "description": "Estimated cost basis if refinance" }, "exchange_amount": { "type": "number", "nullable": true, "description": "1031 exchange amount" }, "exchange_required_closing_date": { "type": "string", "nullable": true, "description": "Exchange required closing date" }, "outstanding_loan_amount_at_closing": { "type": "number", "nullable": true, "description": "Outstanding loan amount at closing" }, "investment_sales_brokerage_fee": { "type": "number", "nullable": true, "description": "Investment sales brokerage fee" }, "debt_placement_brokerage_fee": { "type": "number", "nullable": true, "description": "Debt placement brokerage fee" }, "environmental_cost": { "type": "number", "nullable": true, "description": "Environmental report cost" }, "appraisal_cost": { "type": "number", "nullable": true, "description": "Appraisal cost" }, "survey_cost": { "type": "number", "nullable": true, "description": "Survey cost" }, "snda_and_estoppel_cost": { "type": "number", "nullable": true, "description": "SNDA and estoppel cost" }, "estimated_borrower_counsel_cost": { "type": "number", "nullable": true, "description": "Estimated borrower counsel cost" }, "estimated_lender_counsel_cost": { "type": "number", "nullable": true, "description": "Estimated lender counsel cost" }, "other_closing_costs": { "type": "integer", "nullable": true, "description": "Other closing costs" }, "date_of_purchase_if_refinance": { "type": "string", "nullable": true, "description": "Date of purchase (if refinance)" }, "construction_start_date": { "type": "string", "nullable": true, "description": "Construction start date" }, "construction_completion_date": { "type": "string", "nullable": true, "description": "Construction completion date" }, "debt_maturity_date": { "type": "string", "nullable": true, "description": "Debt maturity date" }, "cash_out": { "type": "boolean", "nullable": true, "description": "Whether this is a cash-out transaction" }, "recent_phase_available": { "type": "boolean", "nullable": true, "description": "Whether a recent phase report is available" }, "recent_appraisal_available": { "type": "boolean", "nullable": true, "description": "Whether a recent appraisal is available" }, "survey_available": { "type": "boolean", "nullable": true, "description": "Whether a survey is available" }, "borrower_counsel_engaged": { "type": "boolean", "nullable": true, "description": "Whether borrower counsel has been engaged" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" } } }, "DealProperty": { "type": "object", "properties": { "id": { "type": "integer", "description": "Property identifier" }, "name": { "type": "string", "nullable": true, "description": "Property name" }, "address": { "type": "string", "nullable": true, "description": "Street address" }, "city": { "type": "string", "nullable": true, "description": "City" }, "state": { "type": "string", "nullable": true, "description": "State (2-letter code)" }, "zip": { "type": "string", "nullable": true, "description": "ZIP code" }, "asset_type_id": { "type": "integer", "nullable": true, "description": "Asset type ID" }, "units": { "type": "integer", "nullable": true, "description": "Number of units" }, "square_footage": { "type": "number", "nullable": true, "description": "Total square footage" }, "year_built": { "type": "integer", "nullable": true, "description": "Year the property was built" } } }, "DealTeamMember": { "type": "object", "properties": { "id": { "type": "integer", "description": "Team assignment identifier" }, "user_id": { "type": "integer", "nullable": true, "description": "User ID" }, "first_name": { "type": "string", "nullable": true, "description": "First name" }, "last_name": { "type": "string", "nullable": true, "description": "Last name" }, "email": { "type": "string", "nullable": true, "description": "Email address" }, "deal_role": { "type": "string", "nullable": true, "description": "Team role (deal_lead, originator, closer, etc.)" }, "is_primary": { "type": "boolean", "description": "Whether this is the primary team member" }, "permission": { "type": "string", "nullable": true, "description": "Permission level" }, "photo_url": { "type": "string", "nullable": true, "description": "Profile photo URL" } } }, "DealDocument": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique document identifier. Use this value in the document detail and download endpoints." }, "file_name": { "type": "string", "nullable": true, "description": "Original file name." }, "extension": { "type": "string", "nullable": true, "description": "File extension without the leading dot." }, "size_bytes": { "type": "integer", "nullable": true, "description": "File size in bytes. May be null for older records whose size was not stored." }, "folder_path": { "type": "string", "nullable": true, "description": "Slash-delimited path inside the vault, or null for files at the vault root." }, "uploaded_at": { "type": "string", "nullable": true, "description": "Upload timestamp (ISO 8601)." }, "vault": { "$ref": "#/components/schemas/DocumentVaultRef", "description": "The vault this document lives in — the compact `id`, `type`, `title` subset of the [Vault Object](#vault-object) (omits the list-only `is_default` and `document_count`). Always present, even under a sparse `fields` request." } } }, "Vault": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique vault identifier. Pass as `vault_id` on [List Documents](#list-documents) to browse just this vault." }, "type": { "type": "string", "description": "Structural category: `resources` (the deal's single private working vault) or `shared` (a vault the borrower can share with other parties). Present the `title` to users, not this raw value." }, "title": { "type": "string", "nullable": true, "description": "Human-readable vault name — `Deal Resources` for the private vault; shared vaults carry names like `Deal Room`, `Closing`, or a per-lender room." }, "is_default": { "type": "boolean", "description": "true` for the deal's primary Deal Room (its default shared vault). Returned by [List Vaults](#list-vaults); omitted from the embedded document `vault` tag." }, "document_count": { "type": "integer", "description": "Number of documents in the vault. Returned by [List Vaults](#list-vaults); omitted from the embedded document `vault` tag." } } }, "DealChecklist": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique checklist identifier" }, "vault": { "$ref": "#/components/schemas/ChecklistVaultRef", "description": "The Deal Room this checklist belongs to: `id`, `type`, and `title`. `type` is always `shared`; checklists do not live on the private Resources vault." }, "sections": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistSection" }, "description": "Ordered sections, each carrying its own tasks. See the [Checklist Section Object](#checklist-section-object)." }, "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistTask" }, "description": "Root-level tasks that sit outside any section, in display order. See the [Checklist Task Object](#checklist-task-object)." } } }, "ChecklistSection": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique section identifier" }, "name": { "type": "string", "description": "Section name" }, "position": { "type": "integer", "description": "Display order inside the checklist" }, "start_date": { "type": "string", "nullable": true, "description": "Optional section start date (ISO 8601)" }, "end_date": { "type": "string", "nullable": true, "description": "Optional section end date (ISO 8601)" }, "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistTask" }, "description": "The section's tasks in display order. See the [Checklist Task Object](#checklist-task-object)." } } }, "ChecklistTask": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique task identifier" }, "title": { "type": "string", "description": "Task title" }, "description": { "type": "string", "nullable": true, "description": "Task description" }, "status": { "type": "string", "description": "Review state: `to_do`, `requested`, `reviewing`, `updates_needed`, `approved`, or `cancelled`." }, "is_completed": { "type": "boolean", "description": "Separate done flag. A task can be approved but not marked complete." }, "position": { "type": "integer", "description": "Display order inside its section or root task list" }, "due_date": { "type": "string", "nullable": true, "description": "Due date (ISO 8601)" }, "role": { "type": "string", "nullable": true, "description": "Role responsible for the task, such as borrower or lender" }, "assignee": { "$ref": "#/components/schemas/ChecklistAssignee", "nullable": true, "description": "The Lev user assigned to the task, or null when unassigned." }, "assigned_team": { "$ref": "#/components/schemas/ChecklistAssignedTeam", "nullable": true, "description": "The account, lender, or borrower team assigned to the task. `name` can be null for stale or out-of-scope team references." }, "collaborators": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistCollaborator" }, "description": "People looped into the task. Each carries `id` and `email`; `id` is null for external parties without a Lev account." }, "document_types": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistDocumentType" }, "description": "Expected document types for the request, such as Appraisal or Rent roll." }, "files": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistTaskFile" }, "description": "Uploaded files already linked to this task. Each file includes `document_id`, `vault_resource_id`, `name`, and `origin`." }, "subtasks": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistTask" }, "description": "Nested subtasks, one level deep, in the same task shape." } } }, "Deal": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique deal identifier" }, "title": { "type": "string", "nullable": true, "description": "Deal title" }, "loan_amount": { "type": "number", "nullable": true, "description": "Requested loan amount" }, "loan_type": { "$ref": "#/components/schemas/LoanType", "nullable": true, "description": "Loan type enum name" }, "transaction_type": { "$ref": "#/components/schemas/TransactionType", "nullable": true, "description": "Transaction type enum name" }, "business_plan": { "$ref": "#/components/schemas/BusinessPlanType", "nullable": true, "description": "Business plan enum name" }, "description": { "type": "string", "nullable": true, "description": "Deal description" }, "estimated_close_date": { "type": "string", "nullable": true, "description": "Estimated close date (ISO 8601)" }, "close_date": { "type": "string", "nullable": true, "description": "Actual close date (ISO 8601)" }, "owner_account_id": { "type": "integer", "nullable": true, "description": "Owning account ID" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp (ISO 8601)" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp (ISO 8601)" }, "archived": { "type": "boolean", "description": "Whether the deal has been archived. Archiving is separate from pipeline status, so an archived deal keeps its last stage" }, "archived_at": { "type": "string", "nullable": true, "description": "When the deal was archived (ISO 8601), or null when active" }, "financials": { "type": "object", "nullable": true, "description": "Included when `?include=financials` (see [Deal Financials](/build/deal-financials))" }, "properties": { "type": "string", "nullable": true, "description": "Included when `?include=properties` (see [Deal Properties](/build/deal-properties))" }, "team": { "type": "string", "nullable": true, "description": "Included when `?include=team` (see [Deal Team](/build/deal-team))" }, "pipelines": { "type": "string", "nullable": true, "description": "Included when `?include=pipelines`. Up to 10 current pipeline rows per deal, each with `pipeline_id`, `status_name`, `updated_at` (see [Pipelines](/build/pipelines))" } } }, "ErrorFormat": { "type": "object", "properties": { "status": { "type": "integer", "description": "HTTP status code mirrored in the envelope for convenience" }, "type": { "type": "string", "description": "Short machine-readable error type (see [Status Codes](#status-codes) below)" }, "message": { "type": "string", "description": "Human-readable description" }, "details": { "type": "object", "description": "Additional context; always present but may be empty" }, "prerequisites": { "type": "string", "description": "*(optional)* Actions required before the request can succeed" }, "upgrade_url": { "type": "string", "description": "*(optional)* URL to upgrade the account when the error is tier-gated" } } }, "LenderDirectoryLender": { "type": "object", "properties": { "id": { "type": "integer", "description": "Organization ID" }, "name": { "type": "string", "nullable": true, "description": "Lender name" }, "website": { "type": "string", "nullable": true, "description": "Website URL" }, "logo_url": { "type": "string", "nullable": true, "description": "Logo image URL" }, "address": { "type": "string", "nullable": true, "description": "Street address" }, "city": { "type": "string", "nullable": true, "description": "City" }, "state": { "type": "string", "nullable": true, "description": "State" }, "zip": { "type": "string", "nullable": true, "description": "ZIP code" }, "about": { "type": "string", "nullable": true, "description": "Description" }, "lender_type": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Lender types (e.g., bank, life company, CMBS)" }, "category": { "type": "string", "nullable": true, "description": "Category" }, "linkedin_url": { "type": "string", "nullable": true, "description": "LinkedIn URL (**detail only** — not included in list responses)" }, "aliases": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Known aliases (**detail only**)" }, "domains": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Email domains (**detail only**)" }, "square_logo_url": { "type": "string", "nullable": true, "description": "Square logo image URL (**detail only**)" }, "programs": { "type": "string", "nullable": true, "description": "Lending programs (**detail only** — see Program Object below)" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" } } }, "LenderProgram": { "type": "object", "properties": { "id": { "type": "integer", "description": "Program ID" }, "title": { "type": "string", "nullable": true, "description": "Program name" }, "loan_types": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Supported loan types" }, "recourse_types": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Recourse types" }, "min_loan_amount": { "type": "number", "nullable": true, "description": "Minimum loan amount" }, "max_loan_amount": { "type": "number", "nullable": true, "description": "Maximum loan amount" }, "capital_source_type": { "type": "string", "nullable": true, "description": "Capital source type" }, "positions": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Loan positions" }, "sponsor_states": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Geographic coverage" }, "status": { "type": "string", "nullable": true, "description": "Program status" } } }, "BaseRates": { "type": "object", "properties": { "code": { "type": "string", "description": "Display name of the rate (e.g. `SOFR 30-Day Avg`, `Treasury 5-Yr`). For term-sheet write requests, the `base_rate` field also accepts the underlying enum key (e.g. `sofr_m1`, `treasury_y5`) — see [Term Sheets](/build/term-sheets#enums)" }, "name": { "type": "string", "description": "Display name" }, "rate": { "type": "number", "nullable": true, "description": "Current rate value" } } }, "AssetTypes": { "type": "object", "properties": { "id": { "type": "integer", "description": "Asset type identifier" }, "description": { "type": "string", "nullable": true, "description": "Asset type name/description" }, "property_sub_types": { "type": "string", "nullable": true, "description": "Sub-type classifications" } } }, "Pipeline": { "type": "object", "properties": { "id": { "type": "integer", "description": "Pipeline identifier" }, "pipeline_type": { "type": "string", "nullable": true, "description": "Pipeline type (financing, acquisition, etc.)" }, "pipeline_name": { "type": "string", "nullable": true, "description": "Pipeline display name" }, "description": { "type": "string", "nullable": true, "description": "Pipeline description" }, "owner_account_id": { "type": "integer", "nullable": true, "description": "Owning account ID" }, "order": { "type": "integer", "nullable": true, "description": "Display order" }, "statuses": { "type": "string", "description": "Pipeline statuses (see Pipeline Status Object)" } } }, "PipelineStatus": { "type": "object", "properties": { "id": { "type": "integer", "description": "Status identifier" }, "status": { "type": "string", "description": "Status key name" }, "custom_status_name": { "type": "string", "nullable": true, "description": "Custom display name" }, "description": { "type": "string", "nullable": true, "description": "Status description" }, "order": { "type": "integer", "nullable": true, "description": "Display order within the pipeline" }, "icon": { "type": "string", "nullable": true, "description": "Icon identifier" } } }, "Placement": { "type": "object", "properties": { "id": { "type": "integer", "description": "Placement identifier" }, "deal_id": { "type": "integer", "description": "Associated deal ID" }, "private_company_id": { "type": "integer", "nullable": true, "description": "Lender private company ID. Null on masked non-owner reads" }, "lender_name": { "type": "string", "nullable": true, "description": "Display lender name. Masked non-owner reads use borrower-portal labels such as Lender A" }, "contact_id": { "type": "integer", "nullable": true, "description": "Lender contact ID. Null on masked non-owner reads" }, "contact_name": { "type": "string", "nullable": true, "description": "Lender contact name. Null on masked non-owner reads, and null for an AI-recommended contact until you reveal it via [Unlock Contact](/build/contacts#unlock-contact) — `contact_id` is still present so you can unlock it" }, "status": { "type": "string", "nullable": true, "description": "Current placement status" }, "lender_status": { "type": "string", "nullable": true, "description": "Lender-side status" }, "description": { "type": "string", "nullable": true, "description": "Placement description" }, "lev_score": { "type": "number", "nullable": true, "description": "AI-generated match score" }, "score": { "type": "number", "nullable": true, "description": "Manual score" }, "outreach_date": { "type": "string", "nullable": true, "description": "Date of initial outreach" }, "outreach_source": { "type": "string", "nullable": true, "description": "Source of outreach" }, "last_communication_date": { "type": "string", "nullable": true, "description": "Date of last communication" }, "lender_first_response_date": { "type": "string", "nullable": true, "description": "Date of lender's first response" }, "visibility": { "type": "string", "nullable": true, "description": "Placement visibility" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" } } }, "TermSheet": { "type": "object", "properties": { "id": { "type": "integer", "description": "Term sheet identifier" }, "deal_id": { "type": "integer", "nullable": true, "description": "Deal this term sheet belongs to" }, "title": { "type": "string", "nullable": true, "description": "Term sheet title" }, "lender_name": { "type": "string", "nullable": true, "description": "Display lender name. Masked non-owner reads use borrower-portal labels such as Lender A" }, "quote_type": { "type": "string", "nullable": true, "description": "Quote type (`guidance`, `indication`, `soft_quote`, `hard_quote`, `term_sheet`)" }, "initial_funding": { "type": "integer", "nullable": true, "description": "Initial funding amount" }, "total_rate": { "type": "number", "nullable": true, "description": "Conditional rate value. Spread over `base_rate` when a benchmark is set; all-in fixed rate when `base_rate` is null or `none-fixed`." }, "base_rate": { "type": "string", "nullable": true, "description": "Display value of the base rate (e.g. `Treasury 5-Yr`, `SOFR 30-Day Avg`) or `none-fixed" }, "base_rate_value": { "type": "number", "nullable": true, "description": "Base-rate snapshot as a percent. For base-rate quotes, display all-in rate as `base_rate_value + total_rate` when both values are known" }, "effective_spread": { "type": "number", "nullable": true, "description": "Effective spread as a percent for underwriting and comparison. For base-rate quotes, this normally equals `total_rate`." }, "rate_type": { "type": "string", "nullable": true, "description": "Rate type (`fixed`, `floating`)" }, "term": { "type": "integer", "nullable": true, "description": "Loan term in months" }, "io_period": { "type": "integer", "nullable": true, "description": "Interest-only period in months" }, "recourse": { "type": "string", "nullable": true, "description": "Recourse type" }, "max_ltv": { "type": "number", "nullable": true, "description": "Maximum Loan-to-Value ratio" }, "max_ltc": { "type": "number", "nullable": true, "description": "Maximum Loan-to-Cost ratio" }, "origination_fee": { "type": "number", "nullable": true, "description": "Origination fee as a decimal ratio" }, "exit_fee": { "type": "number", "nullable": true, "description": "Exit fee as a decimal ratio" }, "org_id": { "type": "integer", "nullable": true, "description": "Lender organization ID. Null on masked non-owner reads" }, "placement_id": { "type": "integer", "nullable": true, "description": "Associated placement ID" }, "winning": { "type": "boolean", "nullable": true, "description": "Whether this is the winning term sheet" }, "is_visible_to_borrower": { "type": "boolean", "description": "Whether the term sheet is visible to the borrower" }, "notes": { "type": "string", "nullable": true, "description": "Free-form notes on the term sheet" }, "created_at": { "type": "string", "nullable": true, "description": "Creation timestamp" }, "updated_at": { "type": "string", "nullable": true, "description": "Last update timestamp" }, "capital_source_type": { "type": "string", "nullable": true, "description": "Capital source type" }, "recourse_type": { "type": "string", "nullable": true, "description": "Recourse type detail" }, "payment_method": { "type": "string", "nullable": true, "description": "Payment method" }, "prepayment_penalty": { "type": "string", "nullable": true, "description": "Prepayment penalty type" }, "prepayment_penalty_details": { "type": "string", "nullable": true, "description": "Prepayment penalty details" }, "amortization": { "type": "integer", "nullable": true, "description": "Amortization period in months" }, "extension_one": { "type": "integer", "nullable": true, "description": "First extension option (months)" }, "extension_two": { "type": "integer", "nullable": true, "description": "Second extension option (months)" }, "extension_three": { "type": "integer", "nullable": true, "description": "Third extension option (months)" }, "floor": { "type": "number", "nullable": true, "description": "Rate floor" }, "floor_type": { "type": "string", "nullable": true, "description": "Floor type" }, "good_faith_deposit": { "type": "number", "nullable": true, "description": "Good faith deposit amount" }, "min_dscr": { "type": "number", "nullable": true, "description": "Minimum DSCR requirement" }, "min_debt_yield": { "type": "number", "nullable": true, "description": "Minimum debt yield requirement" }, "ir_details": { "type": "string", "nullable": true, "description": "Interest reserve details" } } }, "ApiError": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "ApiErrorEnvelope": { "type": "object", "properties": { "request_id": { "type": "string" }, "error": { "$ref": "#/components/schemas/ApiError" } } }, "ApiKeyValidationResponse": { "type": "object", "properties": { "valid": { "type": "boolean" }, "user_id": { "type": "integer", "nullable": true }, "account_id": { "type": "integer", "nullable": true }, "scopes": { "type": "array", "items": { "type": "string" } }, "tier": { "type": "string", "nullable": true } } }, "ApiKey": { "type": "object", "properties": { "id": { "type": "integer" }, "label": { "type": "string" }, "key_prefix": { "type": "string" }, "api_key": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "last_used_at": { "type": "string", "format": "date-time", "nullable": true } } }, "BooleanDeleteResult": { "type": "object", "properties": { "deleted": { "type": "boolean" } } }, "CurrentUserResponse": { "type": "object", "properties": { "user": { "type": "object" }, "account": { "type": "object" }, "profile": { "type": "object" }, "subscription": { "type": "object" }, "platform": { "type": "object" } } }, "AccountTeamMember": { "type": "object", "properties": { "user_id": { "type": "integer" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string" }, "photo_url": { "type": "string", "nullable": true } } }, "Subscription": { "type": "object", "properties": { "type": { "type": "string", "nullable": true }, "status": { "type": "string", "nullable": true }, "billing_cycle": { "type": "string", "nullable": true }, "end_date": { "type": "string", "nullable": true } } }, "Credits": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "balance": { "type": "integer", "nullable": true }, "unit": { "type": "string" } } }, "BillingSummary": { "type": "object", "properties": { "subscription": { "$ref": "#/components/schemas/Subscription" }, "credits": { "$ref": "#/components/schemas/Credits" } } }, "DealIndexSearchSource": { "type": "object", "properties": { "type": { "type": "string", "nullable": true }, "document_id": { "type": "integer", "nullable": true }, "document_type": { "type": "string", "nullable": true }, "file_name": { "type": "string", "nullable": true }, "file_extension": { "type": "string", "nullable": true }, "pages": { "type": "array", "items": { "type": "integer" }, "nullable": true }, "observation_count": { "type": "integer", "nullable": true }, "signed_url": { "type": "string", "nullable": true }, "signed_url_error": { "type": "string", "nullable": true } } }, "DealIndexSearchResult": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "sot_id": { "type": "integer", "nullable": true }, "metric_key": { "type": "string", "nullable": true }, "metric_id": { "type": "integer", "nullable": true }, "metric_label": { "type": "string", "nullable": true }, "value_text": { "type": "string", "nullable": true }, "value_type": { "type": "string", "nullable": true }, "context": { "type": "string", "nullable": true }, "summary": { "type": "string", "nullable": true }, "period_type": { "type": "string", "nullable": true }, "period_value": { "type": "string", "nullable": true }, "entity_type": { "type": "string", "nullable": true }, "entity_id": { "type": "integer", "nullable": true }, "entity_ref": { "type": "string", "nullable": true }, "group_ref": { "type": "string", "nullable": true }, "category_id": { "type": "integer", "nullable": true }, "category_label": { "type": "string", "nullable": true }, "needs_review": { "type": "boolean", "nullable": true }, "score": { "type": "number", "nullable": true }, "source": { "$ref": "#/components/schemas/DealIndexSearchSource" } } }, "DealIndexObservation": { "type": "object", "properties": { "id": { "type": "integer", "nullable": true }, "metric_key": { "type": "string", "nullable": true }, "metric_id": { "type": "integer", "nullable": true }, "value_text": { "type": "string", "nullable": true }, "value_type": { "type": "string", "nullable": true }, "original_text": { "type": "string", "nullable": true }, "context": { "type": "string", "nullable": true }, "summary": { "type": "string", "nullable": true }, "period_type": { "type": "string", "nullable": true }, "period_value": { "type": "string", "nullable": true }, "entity_type": { "type": "string", "nullable": true }, "entity_id": { "type": "integer", "nullable": true }, "entity_ref": { "type": "string", "nullable": true }, "group_ref": { "type": "string", "nullable": true }, "category_id": { "type": "integer", "nullable": true }, "confidence": { "type": "number", "nullable": true }, "weight": { "type": "integer", "nullable": true }, "source": { "$ref": "#/components/schemas/DealIndexSearchSource" } } }, "DealIndexFact": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "sot_id": { "type": "integer", "nullable": true }, "metric_key": { "type": "string", "nullable": true }, "metric_id": { "type": "integer", "nullable": true }, "value_text": { "type": "string", "nullable": true }, "value_type": { "type": "string", "nullable": true }, "period_type": { "type": "string", "nullable": true }, "period_value": { "type": "string", "nullable": true }, "entity_type": { "type": "string", "nullable": true }, "entity_id": { "type": "integer", "nullable": true }, "entity_ref": { "type": "string", "nullable": true }, "group_ref": { "type": "string", "nullable": true }, "category_id": { "type": "integer", "nullable": true }, "source_type": { "type": "string", "nullable": true }, "source_id": { "type": "string", "nullable": true }, "observation_id": { "type": "integer", "nullable": true }, "weight": { "type": "integer", "nullable": true }, "origin": { "type": "string", "nullable": true }, "editable": { "type": "boolean", "nullable": true } } }, "DealIndexMetricDefinition": { "type": "object", "properties": { "id": { "type": "integer", "nullable": true }, "metric_key": { "type": "string", "nullable": true }, "metric_label": { "type": "string", "nullable": true }, "value_type": { "type": "string", "nullable": true }, "category_id": { "type": "integer", "nullable": true } } }, "DealIndexEntity": { "type": "object", "properties": { "entity_ref": { "type": "string", "nullable": true }, "entity_type": { "type": "string", "nullable": true }, "entity_id": { "type": "integer", "nullable": true }, "group_ref": { "type": "string", "nullable": true }, "identifying_metrics": { "type": "array", "items": { "type": "object", "properties": { "metric_key": { "type": "string", "nullable": true }, "metric_label": { "type": "string", "nullable": true }, "value_text": { "type": "string", "nullable": true }, "support_multiple_values": { "type": "boolean", "nullable": true } } } } } }, "DealIndexFactInsertResponse": { "type": "object", "properties": { "success": { "type": "boolean", "nullable": true }, "error": { "type": "string", "nullable": true }, "metric_sot_values": { "type": "array", "items": { "$ref": "#/components/schemas/DealIndexFact" } }, "results": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer", "nullable": true }, "metric_id": { "type": "integer", "nullable": true }, "success": { "type": "boolean", "nullable": true }, "sot": { "allOf": [ { "$ref": "#/components/schemas/DealIndexFact" } ], "nullable": true }, "error": { "type": "string", "nullable": true } } } } } }, "DealMemo": { "type": "object", "properties": { "uuid": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "memo_type": { "type": "string", "nullable": true }, "status": { "type": "string", "nullable": true }, "published_at": { "type": "string", "nullable": true }, "updated_at": { "type": "string", "nullable": true }, "created_by": { "type": "object", "nullable": true, "properties": { "id": { "type": "integer", "nullable": true }, "name": { "type": "string", "nullable": true } } }, "pdf_generation_status": { "type": "string", "nullable": true }, "pdf_ready": { "type": "boolean", "nullable": true }, "memo_url": { "type": "string", "nullable": true }, "vaults": { "type": "array", "description": "The vaults this memo lives in — each a `VaultTag` (`id`, `type`, `title`), the embedded subset of the [Vault Object](#vault-object). Scoped to the vaults the caller can see; empty when the memo is in no vault you can see.", "items": { "$ref": "#/components/schemas/VaultTag" } } } }, "DealMemoDetail": { "type": "object", "properties": { "uuid": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "memo_type": { "type": "string", "nullable": true }, "status": { "type": "string", "nullable": true }, "published_at": { "type": "string", "nullable": true }, "updated_at": { "type": "string", "nullable": true }, "created_by": { "type": "object", "nullable": true, "properties": { "id": { "type": "integer", "nullable": true }, "name": { "type": "string", "nullable": true } } }, "pdf_generation_status": { "type": "string", "nullable": true }, "pdf_ready": { "type": "boolean", "nullable": true }, "memo_url": { "type": "string", "nullable": true }, "vaults": { "type": "array", "description": "The vaults this memo lives in — each a `VaultTag` (`id`, `type`, `title`), the embedded subset of the [Vault Object](#vault-object). Scoped to the vaults the caller can see; empty when the memo is in no vault you can see.", "items": { "$ref": "#/components/schemas/VaultTag" } }, "pdf_url": { "type": "string", "nullable": true }, "pdf_versions": { "type": "array", "items": { "type": "object", "properties": { "quality": { "type": "string", "nullable": true }, "status": { "type": "string", "nullable": true }, "pdf_url": { "type": "string", "nullable": true } } } } } }, "Note": { "type": "object", "properties": { "id": { "type": "integer" }, "text": { "type": "string", "nullable": true }, "created_by": { "type": "object", "nullable": true, "properties": { "id": { "type": "integer" }, "name": { "type": "string", "nullable": true } } }, "created_at": { "type": "string", "nullable": true }, "updated_at": { "type": "string", "nullable": true } } } } } }