Skip to main content

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 .mdx files are frontmatter-only stubs; the real parameter contracts live in api-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 as 204 with 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)
Convention worth documenting: 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, timezone
  • POST /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 sends start_speech_wav, speechContext
  • POST /tag/create + /tag/update: color (hex, default #6366f1), is_duplicate_allowed (bool)
  • POST /tag/contact/create: tag_ids (string[]), extension_number
  • POST /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 undocumented POST /segment/contact/upload with JSON batches, not multipart)
  • PUT /knowledgeBase/chunks/update, DELETE /knowledgeBase/chunks/delete — service wrappers exist, never called from UI

5. Category scorecard


  1. Decide segment_id vs filter_criteria on campaign create — then update docs (or fix the payload).
  2. Fix /tag/contact/create — pick one contract (query ?id= vs body tag_ids) across docs, code, and in-app ApiModal.
  3. Rewrite DELETE /dialer/delete docs to match reality (JSON body with 5 fields) — or change the code to use ?id=.
  4. Add opt_out_script to the assistant update payload in updateAssistance/index.tsx (or drop it from required in docs).
  5. Global spec fixes: response envelope {success, data, message} on all endpoints; idin: query everywhere; DELETE responses → 200 + JSON.
  6. Document list-endpoint pagination/filter params and the -1 fetch-all sentinel.
  7. Loosen stale enums (fillers, ai_model_id, language, opt_out_script, assistant_image) to match what’s actually sent.
  8. Backfill undocumented endpoints — campaign lifecycle + manual-campaign module are the biggest gaps.
  9. Longer term: add TypeScript request interfaces to src/services/* so drift fails at compile time.