API Docs vs Frontend Audit Report
Date: 2026-09-08 Docs:/Users/mac/reactjs/qcall/documentation/api-reference/ (mdx stubs + openapi.json)
Frontend: /Users/mac/reactjs/qcall/qcallai-app/src/
Scope: All 36 documented endpoints across 7 categories, compared at 3 levels — doc schema → service layer → actual call-site payloads.
Note: the.mdxfiles are frontmatter-only stubs; the real parameter contracts live inapi-reference/openapi.json.
1. CRITICAL — Required params skipped or sent wrong (would break a docs-based client)
2. Systemic issues (affect nearly every endpoint)
2.1 Response envelope undocumented — everywhere
Docs declare bare arrays / bare objects /204 no-content. The real API returns { success, data, message } (sometimes totalPages, upgrade). Frontend branches on response.success at every call site.
- Most severe on the DELETE endpoints (
/dialer/delete,/inbound/delete,/tag/delete,/user/deleteassistant): documented as204with empty body — if true, every frontend success branch would be dead code.
2.2 id declared in: "path" but sent as query param
Every PUT/DELETE ...?id={id} endpoint in openapi.json declares id as "in": "path" while the path template itself writes ?id={id}. The frontend sends query strings. Generated clients from this spec would build wrong URLs.
2.3 List-endpoint pagination/filter params undocumented
page, perpage, sortBy, sortOrder, status, sentiment, favourite, search, optOut, fromDate, toDate are sent by:
GET /playground/list(7 params, zero documented)POST /campaign/audiences(10 params)GET /tag/list(3 params)GET /inbound/inbound-history(6 params — endpoint itself undocumented)
page/perpage = -1 is the “fetch all / export CSV” sentinel.
2.4 No TypeScript request types in frontend services
Every service function is(data: any, id: any) — payload truth lives only in modal/view components. Any doc↔code drift is invisible to the compiler.
3. MISMATCH — Field type/enum/required-status drift
4. DOCS-GAP — Frontend params/endpoints missing from docs
Undocumented request fields (documented endpoints)
POST /campaign/create: 13 of 19 body fields undocumented —filter_criteria,retry_count,retry_time,retry_neutral_short_calls,is_drip,action,batch_quantity,repeat_after_days,start_at,send_on_days,send_between_hours_start_from,send_between_hours_end_at,timezonePOST /user/createAssistant: 12 params —assistant_type,transfer_number,meeting_link,latency_fill_mode,latency_fill_volume,recorded_audio,turn_detector,remove_fillers,stt_service_type,order_script,utterance_seconds,fallback_tts; update also sendsstart_speech_wav,speechContextPOST /tag/create+/tag/update:color(hex, default#6366f1),is_duplicate_allowed(bool)POST /tag/contact/create:tag_ids(string[]),extension_numberPOST /dialer/create+/update:sip_channel_limit(number 1-5, sip-only)POST /playground/call:extension_number
Fully undocumented endpoints (~40)
Documented endpoints with ZERO frontend usage
PUT /tag/contact/update,DELETE /tag/contact/delete,POST /tag/contact/list,POST /tag/contact/bulk-upload— the app routes through/segment/contact/*instead (the live upload flow uses undocumentedPOST /segment/contact/uploadwith JSON batches, not multipart)PUT /knowledgeBase/chunks/update,DELETE /knowledgeBase/chunks/delete— service wrappers exist, never called from UI
5. Category scorecard
6. Recommended fix order
- Decide
segment_idvsfilter_criteriaon campaign create — then update docs (or fix the payload). - Fix
/tag/contact/create— pick one contract (query?id=vs bodytag_ids) across docs, code, and in-app ApiModal. - Rewrite
DELETE /dialer/deletedocs to match reality (JSON body with 5 fields) — or change the code to use?id=. - Add
opt_out_scriptto the assistant update payload inupdateAssistance/index.tsx(or drop it from required in docs). - Global spec fixes: response envelope
{success, data, message}on all endpoints;id→in: queryeverywhere; DELETE responses →200 + JSON. - Document list-endpoint pagination/filter params and the
-1fetch-all sentinel. - Loosen stale enums (
fillers,ai_model_id,language,opt_out_script,assistant_image) to match what’s actually sent. - Backfill undocumented endpoints — campaign lifecycle + manual-campaign module are the biggest gaps.
- Longer term: add TypeScript request interfaces to
src/services/*so drift fails at compile time.

