API reference

Billing

Usage, invoices and call records with their cost. Usage is available at any time, with the same line items as the invoice. You get one invoice a month, for the whole account or for each subaccount. Every call record shows its billed seconds and amount.

Guide: Billing and surcharges.

Endpoints

GET/v1/usageRetrieve usage
GET/v1/invoicesList invoices
GET/v1/invoices/{id}Retrieve an invoice
GET/v1/call_recordsList call records
GET/v1/call_records/{id}Retrieve a call record

The invoice object

FieldTypeDescription
id string Unique ID, starts with inv_.
account_id string The account billed. With billing per subaccount, the subaccount.
number string The invoice number printed on the PDF.
status string open, paid, past_due or void.
period_start string First day of the billed month.
period_end string Last day of the billed month.
currency string Always usd.
lines array One line per usage item with item, quantity, unit, unit_price and amount.
surcharges array Carrier surcharges passed through at cost, each with id and amount.
minimum_spend string The monthly minimum spend.
minimum_spend_balance string The difference when usage is under the minimum spend. 0.00 otherwise.
subtotal string Lines, surcharges and minimum spend balance, before taxes.
tax_lines array Taxes and the Universal Service Fund, each with item, description and amount.
taxes string Sum of tax_lines.
total string The amount due.
pdf_url string Link to the PDF. It works without an API key and expires after 1 hour. Retrieve the invoice again for a new link.
issued_at string When the invoice was issued, the first day of the next month. ISO 8601.
due_at string When payment is due, ISO 8601.
paid_at string | null When it was paid.

Retrieve usage

Returns usage and amounts for a date range. Usage counts toward the minimum spend of $2,000 a month. Amounts are before taxes.

GET/v1/usage

Query parametersTypeDescription
fromrequired string First day, YYYY-MM-DD.
torequired string Last day, YYYY-MM-DD. Included.
group_by string item, day or account. Default item.
account_id string One subaccount. Default the account the key belongs to, with all its subaccounts.
item string One line item, such as outbound_minutes or transcript.
GET/v1/usage
curl "https://api.liveleg.dev/v1/usage?from=2026-10-01&to=2026-10-31&group_by=item&account_id=acc_hollis_dental" \
  -H "Authorization: Bearer $LIVELEG_API_KEY"
Response
{
  "object": "usage",
  "from": "2026-10-01",
  "to": "2026-10-31",
  "account_id": "acc_hollis_dental",
  "data": [
    {
      "item": "outbound_minutes",
      "quantity": 21480.4,
      "unit": "minute",
      "amount": "2577.65"
    },
    {
      "item": "local_numbers",
      "quantity": 40,
      "unit": "number_month",
      "amount": "120.00"
    },
    {
      "item": "number_reputation",
      "quantity": 40,
      "unit": "number_month",
      "amount": "120.00"
    },
    {
      "item": "transcript",
      "quantity": 19870.6,
      "unit": "minute",
      "amount": "397.41"
    }
  ],
  "has_more": false
}

List invoices

Returns invoices, newest first. Invoices are issued on the first day of each month for the month before. A parent key sees the invoices of its subaccounts too. invoice.created, invoice.paid and invoice.payment_failed report changes.

GET/v1/invoices

Query parametersTypeDescription
account_id string Only invoices for this subaccount.
status string open, paid, past_due or void.
limit integer 1 to 100. Default 20.
starting_after string The last ID from the previous page.
GET/v1/invoices
curl "https://api.liveleg.dev/v1/invoices?account_id=acc_hollis_dental&limit=12" \
  -H "Authorization: Bearer $LIVELEG_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "id": "inv_4Rk82Ts",
      "object": "invoice",
      "account_id": "acc_hollis_dental",
      "number": "LL-2026-10-0412",
      "status": "open",
      "period_start": "2026-10-01",
      "period_end": "2026-10-31",
      "total": "3315.00",
      "due_at": "2026-11-15T00:00:00Z"
    }
  ],
  "has_more": true
}

Retrieve an invoice

Returns one invoice with all its lines.

GET/v1/invoices/{id}

GET/v1/invoices/{id}
curl https://api.liveleg.dev/v1/invoices/inv_4Rk82Ts \
  -H "Authorization: Bearer $LIVELEG_API_KEY"
Response
{
  "id": "inv_4Rk82Ts",
  "object": "invoice",
  "account_id": "acc_hollis_dental",
  "number": "LL-2026-10-0412",
  "status": "open",
  "period_start": "2026-10-01",
  "period_end": "2026-10-31",
  "currency": "usd",
  "lines": [
    {
      "item": "outbound_minutes",
      "quantity": 21480.4,
      "unit": "minute",
      "unit_price": "0.12",
      "amount": "2577.65"
    },
    {
      "item": "local_numbers",
      "quantity": 40,
      "unit": "number_month",
      "unit_price": "3.00",
      "amount": "120.00"
    },
    {
      "item": "number_reputation",
      "quantity": 40,
      "unit": "number_month",
      "unit_price": "3.00",
      "amount": "120.00"
    },
    {
      "item": "transcript",
      "quantity": 19870.6,
      "unit": "minute",
      "unit_price": "0.02",
      "amount": "397.41"
    }
  ],
  "surcharges": [],
  "minimum_spend": "2000.00",
  "minimum_spend_balance": "0.00",
  "subtotal": "3215.06",
  "tax_lines": [
    {
      "item": "usf",
      "description": "Universal Service Fund",
      "amount": "61.74"
    },
    {
      "item": "state_tax",
      "description": "Colorado telecom tax",
      "amount": "38.20"
    }
  ],
  "taxes": "99.94",
  "total": "3315.00",
  "pdf_url": "https://files.liveleg.dev/invoices/inv_4Rk82Ts.pdf?token=f81Kq0Zt",
  "issued_at": "2026-11-01T06:00:00Z",
  "due_at": "2026-11-15T00:00:00Z",
  "paid_at": null
}

List call records

Returns call records, newest first. Each record lists every leg placed for the call, with timings, the detection result, billed seconds and cost.

GET/v1/call_records

Query parametersTypeDescription
dial_session_id string Only calls from this dial session.
agent_id string Only calls taken by this agent.
lead_id string Only calls to this lead.
from string ISO 8601. Calls that started at or after this time.
to string ISO 8601. Calls that started before this time.
limit integer 1 to 100. Default 20.
starting_after string The last ID from the previous page.
GET/v1/call_records
curl "https://api.liveleg.dev/v1/call_records?agent_id=agt_114&from=2026-11-03T00%3A00%3A00Z&limit=50" \
  -H "Authorization: Bearer $LIVELEG_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "id": "cal_8Jq2mT4x",
      "object": "call",
      "to": "+15125550147",
      "agent_id": "agt_114",
      "status": "completed",
      "billed_seconds": 264,
      "amount": "0.528",
      "total": "0.616",
      "ended_at": "2026-11-03T15:46:29.903Z"
    }
  ],
  "has_more": true
}

Retrieve a call record

Returns one call record with its legs and cost. amount is the talk time at the per-minute rate. charges lists every charge for the call, including that one and add-ons such as transcripts. surcharges are listed apart, and total is the sum of charges and surcharges. Unanswered legs have no charge.

GET/v1/call_records/{id}

GET/v1/call_records/{id}
curl https://api.liveleg.dev/v1/call_records/cal_8Jq2mT4x \
  -H "Authorization: Bearer $LIVELEG_API_KEY"
Response
{
  "id": "cal_8Jq2mT4x",
  "object": "call",
  "dial_session_id": "dls_31Ka9",
  "account_id": "acc_ridgeline",
  "direction": "outbound",
  "from": "+15125550199",
  "to": "+15125550147",
  "agent_id": "agt_114",
  "lead_id": "led_7Tn40",
  "status": "completed",
  "legs": [
    {
      "id": "leg_a1",
      "to": "+15125550147",
      "result": "bridged",
      "rang_ms": 4120
    },
    {
      "id": "leg_a2",
      "to": "+15125550163",
      "result": "canceled",
      "rang_ms": 15400
    },
    {
      "id": "leg_a3",
      "to": "+15125550108",
      "result": "machine_voicemail",
      "rang_ms": 9800
    }
  ],
  "answered_at": "2026-11-03T15:42:03.542Z",
  "bridged_at": "2026-11-03T15:42:07.412Z",
  "ended_at": "2026-11-03T15:46:29.903Z",
  "amd_result": "human",
  "speech_ended_to_bridge_ms": 980,
  "billed_seconds": 264,
  "hangup_by": "prospect",
  "disposition": "callback_requested",
  "rate_per_minute": "0.12",
  "amount": "0.528",
  "charges": [
    {
      "item": "outbound_minutes",
      "quantity": 4.4,
      "amount": "0.528"
    },
    {
      "item": "transcript",
      "quantity": 4.4,
      "amount": "0.088"
    }
  ],
  "surcharges": [],
  "total": "0.616"
}