LendWorksLendWorksDocs

Dialer

Submit call events, manage agent presence, record dispositions, and view agent availability.

The dialer API integrates with power dialer systems (Augutech / Vicidial) to track call events, agent presence, and dispositions. This enables real-time call tracking within your LendWorks pipeline.

Submit a Call Event

POST /v1/dialer/events

Record a call event from your dialer system. Supports idempotency keys.

Request Body

All fields accept both camelCase and snake_case aliases (e.g., externalCallId or call_id).

FieldTypeRequiredDescription
externalCallIdstringYesUnique call ID from the dialer system
userIdUUIDYesLendWorks user ID of the agent
leadIdUUIDNoAssociated lead ID
eventTypeenumYescall_started, call_answered, call_ended, disposition, transfer, hold, resume
directionenumNoinbound or outbound
durationSecondsintegerNoCall duration (>= 0)
dispositionstringNoDisposition code
metadataobjectNoAdditional event data
occurredAtISO 8601YesWhen the event happened

Example Request

curl -X POST https://api.lend.works/v1/dialer/events \
  -H "Authorization: Bearer lw_live_xxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: call-evt-12345-ended" \
  -d '{
    "externalCallId": "augutech-call-12345",
    "userId": "e5f6g7h8-1234-5678-9abc-def012345678",
    "leadId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "eventType": "call_ended",
    "direction": "outbound",
    "durationSeconds": 180,
    "disposition": "interested",
    "occurredAt": "2025-01-15T14:35:00Z"
  }'

Response — 201 Created

{
  "data": {
    "id": "evt_a1b2c3d4-...",
    "type": "call_event",
    "attributes": {
      "externalCallId": "augutech-call-12345",
      "userId": "e5f6g7h8-...",
      "leadId": "d290f1ee-...",
      "eventType": "call_ended",
      "direction": "outbound",
      "durationSeconds": 180,
      "disposition": "interested",
      "metadata": {},
      "occurredAt": "2025-01-15T14:35:00Z",
      "createdAt": "2025-01-15T14:35:01Z",
      "updatedAt": "2025-01-15T14:35:01Z"
    }
  },
  "meta": {
    "requestId": "a76b86c9-d0e1-4f23-4567-890123456012"
  }
}

Update Agent Presence

POST /v1/dialer/presence

Update an agent's availability status in the dialer system.

Request Body

FieldTypeRequiredDescription
userIdUUIDYesLendWorks user ID
statusenumYesonline, on_call, break, offline
currentCallIdstringNoActive call ID
currentLeadIdUUIDNoLead currently being worked
metadataobjectNoAdditional presence data

Example Request

curl -X POST https://api.lend.works/v1/dialer/presence \
  -H "Authorization: Bearer lw_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "e5f6g7h8-1234-5678-9abc-def012345678",
    "status": "on_call",
    "currentCallId": "augutech-call-12345",
    "currentLeadId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
  }'

Response — 200 OK

Returns the updated agent presence record with enriched data (agent name, lead name, call statistics).

Submit a Disposition

POST /v1/dialer/disposition

Record a call disposition. Supports idempotency keys.

Request Body

FieldTypeRequiredDescription
externalCallIdstringYesCall ID from the dialer
userIdUUIDYesAgent's LendWorks user ID
leadIdUUIDNoAssociated lead ID
dispositionstringYesDisposition code (e.g., interested, callback, not_interested, no_answer)
notesstringNoAgent notes
occurredAtISO 8601YesWhen the disposition was recorded

Example Request

curl -X POST https://api.lend.works/v1/dialer/disposition \
  -H "Authorization: Bearer lw_live_xxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: disp-12345" \
  -d '{
    "externalCallId": "augutech-call-12345",
    "userId": "e5f6g7h8-1234-5678-9abc-def012345678",
    "leadId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "disposition": "interested",
    "notes": "Wants to discuss term loan options. Callback scheduled.",
    "occurredAt": "2025-01-15T14:38:00Z"
  }'

Response — 201 Created

Returns the created call event record.

List Agent Availability

GET /v1/dialer/agents

Returns the current presence status of all dialer agents.

Query Parameters

ParameterTypeDescription
teamIdUUIDFilter by team (optional)

Example Request

curl -H "Authorization: Bearer lw_live_xxxx" \
     "https://api.lend.works/v1/dialer/agents?teamId=t1e2a3m4-..."

Example Response

{
  "data": [
    {
      "id": "pres_a1b2c3d4-...",
      "type": "agent_presence",
      "attributes": {
        "userId": "e5f6g7h8-...",
        "firstName": "Mike",
        "lastName": "Johnson",
        "email": "mike@company.com",
        "status": "on_call",
        "currentCallId": "augutech-call-12345",
        "currentLeadId": "d290f1ee-...",
        "currentLeadName": "Acme Corp",
        "callStartedAt": "2025-01-15T14:32:00Z",
        "statusChangedAt": "2025-01-15T14:32:00Z",
        "callsToday": 28,
        "dispositionCount": 24,
        "campaignName": "Q1 Outreach",
        "statusTimeSec": 180
      }
    }
  ],
  "meta": {
    "total": 8,
    "page": 1,
    "limit": 20,
    "hasMore": false,
    "requestId": "b87c97d0-e1f2-4a34-5678-901234567123"
  }
}

Errors

StatusCodeDescription
400BAD_REQUESTInvalid event payload
403FORBIDDENAPI key lacks permission
422VALIDATION_ERRORRequest body failed validation