REST API v1

Automate the whole trunk business.

Provision accounts, issue SIP credentials, move balances, read rate cards and pull rated CDRs. Authenticate with a scoped key — no browser session required.

Authentication

Every request needs an API key. Create keys in Admin → API keys. A key belongs to either the platform (full access) or a single customer account (scoped to its own data).

Send the key as X-API-Key or as a bearer token:

curl https://sip.livevoip.online/api/v1/me \
  -H "X-API-Key: sk_live_your_key"
Keys are stored as SHA-256 hashes and shown only once at creation. Revoke a key at any time; revocation is immediate.

Scopes: account keys are created with read or read,write. Write access is required to create trunks or reset passwords. Balance top-ups always require an account-level key.

Quick start

  1. Sign in to the portal and open Admin → API keys.
  2. Create a key, copy it once, and store it in your secret manager.
  3. Create a customer with make_sip: true — the response contains the SIP username and one-time password.
  4. Top up the balance, then use the trunk credentials in the customer's PBX.
curl -X POST https://sip.livevoip.online/api/v1/customers \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Retail","make_sip":true}'

Endpoints

Base URL https://sip.livevoip.online/api/v1. All responses are JSON; timestamps are UTC ISO-8601.

MethodPathPurposeKey
GET/meKey scope and linked customerany
GET/statusAsterisk and API healthany
GET/customersList customers (search, paging)platform
POST/customersCreate customer + optional SIP trunkplatform
GET/customers/{code}Account details and balanceany*
PATCH/customers/{code}Status, credit limit, rate plan, contactplatform
GET/customers/{code}/balanceLive balance and available creditany*
POST/customers/{code}/topupCredit or adjust the balanceplatform
GET/customers/{code}/sip-accountsList trunk credentialsany*
POST/customers/{code}/sip-accountsCreate a SIP trunkwrite*
POST/customers/{code}/sip-accounts/{username}/resetRotate trunk passwordwrite*
GET/customers/{code}/cdrsRated call recordsany*
GET/customers/{code}/usageCall count, minutes, spendany*
GET/cdrsAll CDRs (platform) or own CDRsany
GET/didsInbound numbersany
GET/ratesLive sell rates for a planany
GET/rate-plansList rate plansplatform
POST/rate-plans/{id}/ratesCreate or update a prefix rateplatform
GET/trunksUpstream trunks (secrets hidden)platform
GET/ledgerBalance movementsany*
POST/config/applyRegenerate & reload Asterisk configplatform

* Account-scoped keys can only access their own customer code. Platform keys use the full path.

Examples

Top up a balance

curl -X POST https://sip.livevoip.online/api/v1/customers/DEMO1001/topup \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"reference":"INV-1042"}'

Fetch the rate deck

curl "https://sip.livevoip.online/api/v1/rates?q=44" \
  -H "X-API-Key: sk_live_your_key"

Read today's CDRs

curl "https://sip.livevoip.online/api/v1/cdrs?date_from=2026-01-01&limit=100" \
  -H "X-API-Key: sk_live_your_key"

Errors & limits

StatusMeaningAction
401Missing or invalid API keyCheck the key and header name
403Key scope does not allow this actionUse a platform key or add write scope
404Customer, DID or rate plan not foundVerify the account code
409Customer code already existsChoose a different code
429Rate limit exceeded120 requests per minute per key
500Asterisk reload or server errorCheck Admin → System

Timestamps are UTC. Monetary values are decimal JSON numbers in the account currency. List endpoints accept limit and offset.

SIP connection details

Retail trunks register to this platform over UDP with digest authentication. Give the customer:

SIP server
sip.livevoip.online
Port / transport
5060 · UDP
Username / auth ID
from the portal or API
Codecs
G.711 µ-law / A-law, G.722

The trunk accepts calls to any destination that matches an enabled outbound route and rate. Inbound DIDs are delivered to the assigned SIP account.