LendWorksLendWorksDocs

Leads

Create, list, retrieve, and update leads in your lending pipeline.

Leads represent potential borrowers entering your pipeline. Each lead is scoped to your organization and can be assigned to advisors, tagged, and moved through pipeline stages.

List Leads

GET /v1/leads

Returns a paginated list of leads in your organization, sorted by creation date (newest first).

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max 100)
searchstringFull-text search across business name, contact name, and email

Example Request

curl -H "Authorization: Bearer lw_live_xxxx" \
     "https://api.lend.works/v1/leads?limit=10&search=acme"

Example Response

{
  "data": [
    {
      "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "type": "lead",
      "attributes": {
        "businessName": "Acme Corp",
        "contactFirstName": "Jane",
        "contactLastName": "Doe",
        "email": "jane@acme.com",
        "phone": "555-0100",
        "industry": "Technology",
        "monthlyRevenue": "85000",
        "requestedAmount": "250000",
        "source": "api",
        "priority": "high",
        "isDoNotCall": false,
        "tags": ["technology", "high-value"],
        "customFields": {},
        "externalIds": {},
        "leadScore": null,
        "stage": {
          "id": "a1b2c3d4-...",
          "stageKey": "new_lead",
          "stageLabel": "New Lead",
          "color": "#3b82f6",
          "semanticSlot": "new"
        },
        "primaryAdvisorId": "e5f6g7h8-...",
        "primaryAdvisorName": "Mike Johnson",
        "lastContactedAt": null,
        "stageChangedAt": "2025-01-15T10:30:00Z",
        "createdAt": "2025-01-15T10:30:00Z",
        "updatedAt": "2025-01-15T10:30:00Z"
      }
    }
  ],
  "meta": {
    "total": 42,
    "page": 1,
    "limit": 10,
    "hasMore": true,
    "requestId": "550e8400-e29b-41d4-a716-446655440000"
  }
}

The response includes all lead fields. Key fields are documented below; additional fields like dncReason, dncAt, convertedAt, convertedAccountId, convertedContactId, importJobId, and createdBy are included when applicable (otherwise null).

Get a Lead

GET /v1/leads/{id}

Retrieve a single lead by its UUID.

Path Parameters

ParameterTypeDescription
idUUIDLead ID

Example Request

curl -H "Authorization: Bearer lw_live_xxxx" \
     https://api.lend.works/v1/leads/d290f1ee-6c54-4b01-90e6-d701748f0851

Example Response

{
  "data": {
    "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "type": "lead",
    "attributes": {
      "businessName": "Acme Corp",
      "contactFirstName": "Jane",
      "contactLastName": "Doe",
      "email": "jane@acme.com",
      "phone": "555-0100",
      "industry": "Technology",
      "monthlyRevenue": "85000",
      "requestedAmount": "250000",
      "source": "api",
      "priority": "high",
      "isDoNotCall": false,
      "tags": ["technology", "high-value"],
      "customFields": {},
      "externalIds": {},
      "leadScore": null,
      "stage": {
        "id": "a1b2c3d4-...",
        "stageKey": "new_lead",
        "stageLabel": "New Lead",
        "color": "#3b82f6",
        "semanticSlot": "new"
      },
      "primaryAdvisorId": "e5f6g7h8-...",
      "primaryAdvisorName": "Mike Johnson",
      "lastContactedAt": null,
      "stageChangedAt": "2025-01-15T10:30:00Z",
      "createdAt": "2025-01-15T10:30:00Z",
      "updatedAt": "2025-01-15T14:20:00Z"
    }
  },
  "meta": {
    "requestId": "661f9511-a29b-42d5-b827-557766551111"
  }
}

Create a Lead

POST /v1/leads

Create a new lead in your pipeline. Supports idempotency keys for safe retries.

Request Body

FieldTypeRequiredDescription
businessNamestringNoBusiness name (1-255 chars, no HTML)
contactFirstNamestringNoContact first name (max 100 chars)
contactLastNamestringNoContact last name (max 100 chars)
emailstringNoValid email address
phonestringNoPhone number (max 20 chars)
industrystringNoIndustry classification (max 100 chars)
monthlyRevenuestringNoMonthly revenue amount (numeric string)
requestedAmountstringNoRequested funding amount (numeric string)
sourceenumNomanual, csv_import, api, web_form, referral, dialer. Default: manual
priorityenumNolow, normal, high, urgent. Default: normal
stageIdUUIDNoPipeline stage ID. Defaults to first stage
tagsstring[]NoArray of tag strings
customFieldsobjectNoKey-value pairs for custom fields
assignToAdvisorIdUUIDNoAssign to a specific advisor
contactIdUUIDNoLink to an existing contact

Example Request

curl -X POST https://api.lend.works/v1/leads \
  -H "Authorization: Bearer lw_live_xxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-lead-acme-001" \
  -d '{
    "businessName": "Acme Corp",
    "contactFirstName": "Jane",
    "contactLastName": "Doe",
    "email": "jane@acme.com",
    "phone": "555-0100",
    "industry": "Technology",
    "monthlyRevenue": "85000",
    "requestedAmount": "250000",
    "source": "api",
    "priority": "high",
    "tags": ["technology", "high-value"]
  }'

SDK Example

const lead = await client.leads.create({
  businessName: 'Acme Corp',
  contactFirstName: 'Jane',
  contactLastName: 'Doe',
  email: 'jane@acme.com',
  phone: '555-0100',
  industry: 'Technology',
  monthlyRevenue: '85000',
  requestedAmount: '250000',
  source: 'api',
  priority: 'high',
  tags: ['technology', 'high-value'],
}, {
  idempotencyKey: 'create-lead-acme-001',
})

Response — 201 Created

Returns the created lead in the standard response envelope.

Update a Lead

PATCH /v1/leads/{id}

Update an existing lead. Only include the fields you want to change.

Path Parameters

ParameterTypeDescription
idUUIDLead ID

Request Body

All fields from the create endpoint are accepted (except source, stageId, assignToAdvisorId, contactId). Only include fields you want to update.

Example Request

curl -X PATCH https://api.lend.works/v1/leads/d290f1ee-6c54-4b01-90e6-d701748f0851 \
  -H "Authorization: Bearer lw_live_xxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: update-lead-acme-priority" \
  -d '{
    "priority": "urgent",
    "requestedAmount": "500000"
  }'

Response — 200 OK

Returns the updated lead in the standard response envelope.

Errors

StatusCodeDescription
400BAD_REQUESTMalformed JSON body
403FORBIDDENAPI key lacks write permission
404NOT_FOUNDLead not found
422VALIDATION_ERRORRequest body failed validation

Webhook Events

EventDescription
lead.createdFired when a new lead is created
lead.status_changedFired when a lead moves to a new pipeline stage

See Webhook Events for payload details.