Voice and Phone Numbers
Endpoints
Voice and Phone Numbers
Business phone numbers, call forwarding, call logs, voicemail, and provider webhooks.
GET
Voice and Phone Numbers
These are dashboard-session endpoints for NearIQ business communication features. They use the signed-in app session, active business scoping, and plan limits. Provider webhooks are server-to-server endpoints and validate the provider signature.
Phone Numbers
GET /api/phone-numbers lists active business phone numbers. Add search=1 with country, type, areaCode, or contains to search available numbers.
POST /api/phone-numbers provisions a number and configures SMS plus voice webhooks.
DELETE /api/phone-numbers?id=<uuid> releases a number and soft-disables it in NearIQ.
Call Forwarding
GET /api/call-forwarding lists forwarding rules for the active business.
POST /api/call-forwarding creates a rule. PUT /api/call-forwarding updates a rule. DELETE /api/call-forwarding?id=<uuid> deletes a rule.
Call Logs
GET /api/call-logs returns recent calls for the active business. Optional filters: direction, status, from, to, and limit.
Rows include recordingPlaybackUrl when an authenticated recording proxy is available.
Voicemails
GET /api/voicemails returns voicemail rows with transcription text when available and an authenticated recordingPlaybackUrl.
PATCH /api/voicemails marks a voicemail read or unread.
DELETE /api/voicemails?id=<uuid> deletes a voicemail row.
Voice Webhooks
POST /api/voice/incoming receives inbound calls, logs the call, dials active forwarding rules, and falls back to voicemail recording when no forwarding rule is available.
POST /api/voice/status receives call status callbacks and updates call_logs, including voice minute usage for completed calls.
POST /api/voice/recording receives recording callbacks and stores call recording or voicemail metadata.
GET /api/voice/recording?callLogId=<uuid> or GET /api/voice/recording?voicemailId=<uuid> proxies recording playback for authenticated users without exposing provider recording URLs.
Errors
| Status | Meaning |
|---|---|
400 | Invalid phone number, rule, query, or request body |
401 | Missing dashboard session |
403 | Plan does not include the requested communication feature |
404 | Business, phone number, call log, rule, or voicemail not found |
502 | Phone provider request failed |
503 | Phone provider is not configured |