{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/employer-contacts/validate-format":{"post":{"tags":["Employer Contacts Validation"],"summary":"Validate employer contact format","description":"Accepts an employer's phone numbers and email addresses and validates their format. Phone numbers must include a country code (E.164). Returns a structured result with a per-field breakdown and an overall `valid` flag.","operationId":"validate_contact_employer_contacts_validate_format_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployerContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactValidationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/employer-contacts/search":{"post":{"tags":["Employer Contacts Search"],"summary":"Search employer contact details","description":"Two modes depending on request content. Verify mode (phoneNumbers supplied): the LLM uses Google Search grounding to confirm whether each provided phone contact belongs to the employer — no new contacts are discovered. Discovery mode (no phoneNumbers supplied): the LLM searches for HR / employment verification phone contacts and returns every authoritative phone contact found. emailAddresses are accepted but ignored, and emails/faxNumbers are always returned empty. verified=true requires LLM confidence ≥ 0.70, address similarity ≥ 0.70, and valid format.","operationId":"lookup_contact_employer_contacts_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployerLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployerLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-agent/recordings/ingest":{"post":{"tags":["voice-agent-recordings"],"summary":"Ingest recording metadata","description":"Called by voice_agent_recording_runtime.publish_recording_and_transcript() after every call ends — on both WebRTC and Twilio paths, and for both LiteLLM and Vertex backends. Persists the recording index row so callers can later look up recordings by callSid or orderId.","operationId":"ingest_recording_voice_agent_recordings_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingIngestPayload"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-agent/recordings":{"get":{"tags":["voice-agent-recordings"],"summary":"List recordings","description":"Returns index rows matching the given callSid, orderId, or both. At least one query parameter is required. When both are supplied the result is the intersection. Audio bytes are served by Flowable Work via the playbackUrl in each row.","operationId":"list_recordings_voice_agent_recordings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"callSid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callsid"}},{"name":"orderId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orderid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-agent/recordings/{recording_id}":{"get":{"tags":["voice-agent-recordings"],"summary":"Get recording by recordingId","description":"Returns the full index row for a single recording. Use the playbackUrl in the response to stream audio from Flowable Work.","operationId":"get_recording_voice_agent_recordings__recording_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"recording_id","in":"path","required":true,"schema":{"type":"string","title":"Recording Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-agent/call-details":{"get":{"tags":["voice-agent-call-details"],"summary":"Get unified call details","description":"Returns recording + transcript + call metadata + lifecycle events for calls matching the given filter parameters. At least one of orderId, callSid, or sessionId is required. Combine orderId with callSid or sessionId to narrow. Use status and channel to further filter results.","operationId":"get_call_details_voice_agent_call_details_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"orderId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orderid"}},{"name":"callSid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callsid"}},{"name":"sessionId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sessionid"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-agent/call-status":{"get":{"tags":["voice-agent-call-status"],"summary":"Authoritative, idempotent call status by Order ID and/or Call SID","description":"Returns the authoritative status of a call keyed by orderId and/or callSid: the current call_status while in progress, or the terminal disposition token once resolved. Idempotent — repeated reads return identical results and a terminal status never changes once set. At least one of orderId or callSid is required.","operationId":"get_call_status_voice_agent_call_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"orderId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orderid"}},{"name":"callSid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callsid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Health Check","description":"Health check endpoint for Cloud Run","operationId":"health_check__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/test":{"get":{"summary":"Test Endpoint","description":"Test endpoint to verify service is accessible","operationId":"test_endpoint_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Ready","description":"Readiness/liveness probe endpoint (standard `/health` path).\n\nAlways returns HTTP 200 when the process can serve requests. Reports whether\nthe LiteLLM realtime backend is configured, but does NOT gate liveness on it\nand performs no external calls (safe for frequent probing).","operationId":"health_ready_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twilio/voiceoutbound":{"post":{"summary":"Twilio Voice Outbound Webhook","description":"Twilio voice webhook endpoint (returns TwiML)","operationId":"twilio_voice_outbound_webhook_twilio_voiceoutbound_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twilio/amd-status":{"post":{"summary":"Twilio Amd Status Webhook","description":"Asynchronous AMD verdict callback (014-async-amd-detection).\n\nUnder the asynchronous AMD mode (``TWILIO_AMD_ASYNC_ENABLED``) the call connects and Aly's\ngreeting begins immediately (see ``/twilio/voiceoutbound``); Twilio delivers the human/machine\nverdict later, decoupled in time, on this dedicated status-callback URL. A machine/voicemail\nverdict latches the same terminal `machine-voice-detected` outcome as the synchronous mode and\nends the call via the Twilio REST API (the call is already connected, so there is no TwiML\nresponse to withhold). A late verdict (call already ended) or a redelivered/duplicate verdict\nis a safe no-op — this endpoint never raises back to Twilio.","operationId":"twilio_amd_status_webhook_twilio_amd_status_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twilio/transfer":{"get":{"summary":"Twilio Transfer Endpoint","description":"Endpoint that returns TwiML to dial the transfer destination.\n\nCalled by Twilio when we update a call's URL to redirect to this endpoint.\nThe bot closes the WebSocket, and Twilio fetches new instructions from here.","operationId":"twilio_transfer_endpoint_twilio_transfer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Twilio Transfer Endpoint","description":"Endpoint that returns TwiML to dial the transfer destination.\n\nCalled by Twilio when we update a call's URL to redirect to this endpoint.\nThe bot closes the WebSocket, and Twilio fetches new instructions from here.","operationId":"twilio_transfer_endpoint_twilio_transfer_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twilio/make-call":{"post":{"summary":"Make Outbound Call","description":"Legacy endpoint to trigger outbound call (no verification context required).","operationId":"make_outbound_call_twilio_make_call_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/twilio/make-call/aly":{"post":{"summary":"Make Outbound Call Aly","description":"Testing endpoint: trigger outbound call using Aly runtime.","operationId":"make_outbound_call_aly_twilio_make_call_aly_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/makecall":{"post":{"summary":"Make Outbound Call V1","description":"Flowable integration endpoint: outbound call with verification context payload.\n\n`/v1/makecall` is preserved as a backward-compatible alias.","operationId":"make_outbound_call_v1_v1_makecall_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agentic/voe-voice-call":{"post":{"summary":"Make Outbound Call V1","description":"Flowable integration endpoint: outbound call with verification context payload.\n\n`/v1/makecall` is preserved as a backward-compatible alias.","operationId":"make_outbound_call_v1_v1_agentic_voe_voice_call_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-agent/voe/calls":{"post":{"summary":"Voice Agent Voe Call","description":"VIQ outbound call initiation endpoint (single call payload).","operationId":"voice_agent_voe_call_voice_agent_voe_calls_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-agent/voe/calls/{order_id}/snapshot":{"get":{"summary":"Get Voice Agent Voe Snapshot","description":"Fetch persisted call session + event history by order id.","operationId":"get_voice_agent_voe_snapshot_voice_agent_voe_calls__order_id__snapshot_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"includeCallRecordings","in":"query","required":false,"schema":{"type":"boolean","description":"Attach recordings[] to each session","default":false,"title":"Includecallrecordings"},"description":"Attach recordings[] to each session"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twilio/call-status":{"post":{"summary":"Call Status Webhook","description":"Webhook to receive call status updates from Twilio (optional).\n\nTwilio posts to this URL with call status information.","operationId":"call_status_webhook_twilio_call_status_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twilio/recordings/{recording_sid}/stream":{"get":{"summary":"Stream Twilio Recording","description":"Recording playback endpoint backed by storage service, not Twilio.","operationId":"stream_twilio_recording_twilio_recordings__recording_sid__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"recording_sid","in":"path","required":true,"schema":{"type":"string","title":"Recording Sid"}},{"name":"proxy","in":"query","required":false,"schema":{"type":"boolean","description":"Stream through voice-agent proxy instead of redirect","default":false,"title":"Proxy"},"description":"Stream through voice-agent proxy instead of redirect"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AlternativeMethod":{"properties":{"methodType":{"type":"string","title":"Methodtype"},"provider":{"type":"string","title":"Provider"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"employerCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employercode"},"instructions":{"type":"string","title":"Instructions"},"sources":{"items":{"$ref":"#/components/schemas/ContactSource"},"type":"array","title":"Sources"}},"type":"object","required":["methodType","provider","instructions"],"title":"AlternativeMethod"},"ContactFieldResult":{"properties":{"value":{"type":"string","title":"Value"},"valid":{"type":"boolean","title":"Valid"},"message":{"type":"string","title":"Message"}},"type":"object","required":["value","valid","message"],"title":"ContactFieldResult","description":"Validation result for a single phone number or email address."},"ContactSource":{"properties":{"link":{"type":"string","title":"Link"},"websiteName":{"type":"string","title":"Websitename"}},"type":"object","required":["link","websiteName"],"title":"ContactSource"},"ContactValidationDetails":{"properties":{"phoneNumbers":{"items":{"$ref":"#/components/schemas/ContactFieldResult"},"type":"array","title":"Phonenumbers"},"emailAddresses":{"items":{"$ref":"#/components/schemas/ContactFieldResult"},"type":"array","title":"Emailaddresses"}},"type":"object","title":"ContactValidationDetails","description":"Per-field validation results broken down by contact type."},"ContactValidationResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"message":{"type":"string","title":"Message"},"details":{"$ref":"#/components/schemas/ContactValidationDetails"}},"type":"object","required":["valid","message","details"],"title":"ContactValidationResponse","description":"Response returned by POST /employer-contacts/validate-format."},"EmployerContactRequest":{"properties":{"employerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employername"},"phoneNumbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Phonenumbers"},"emailAddresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Emailaddresses"}},"type":"object","title":"EmployerContactRequest","description":"Incoming request body for contact validation.\n\nAccepts camelCase field names to align with the rest of the API\n(e.g. employerName, phoneNumbers, emailAddresses)."},"EmployerInfo":{"properties":{"employerName":{"type":"string","title":"Employername"},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Addressline1"},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Addressline2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zipcode"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},"type":"object","required":["employerName"],"title":"EmployerInfo"},"EmployerLookupRequest":{"properties":{"orderId":{"type":"string","title":"Orderid"},"employerName":{"type":"string","title":"Employername"},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Addressline1"},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Addressline2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zipcode"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"phoneNumbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Phonenumbers"},"emailAddresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Emailaddresses"},"mockValidationStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mockvalidationstatus"}},"type":"object","required":["orderId","employerName"],"title":"EmployerLookupRequest","description":"Request body for the employer contact lookup endpoint.\n\nIf phoneNumbers are provided the endpoint enters verify mode: the LLM\nconfirms whether those specific contacts belong to the named employer via\nweb search. Email input is accepted but ignored. If no phone numbers are\nprovided the endpoint enters discovery mode and searches for HR /\nemployment verification phone contacts."},"EmployerLookupResponse":{"properties":{"orderId":{"type":"string","title":"Orderid"},"validationStatus":{"type":"string","title":"Validationstatus"},"statusMessage":{"type":"string","title":"Statusmessage"},"aiConfidence":{"type":"number","title":"Aiconfidence"},"employer":{"$ref":"#/components/schemas/EmployerInfo"},"verificationMethods":{"$ref":"#/components/schemas/VerificationMethods"},"alternativeMethods":{"items":{"$ref":"#/components/schemas/AlternativeMethod"},"type":"array","title":"Alternativemethods"}},"type":"object","required":["orderId","validationStatus","statusMessage","aiConfidence","employer","verificationMethods"],"title":"EmployerLookupResponse","description":"Response returned by POST /employer-contacts/search."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RecordingIngestPayload":{"properties":{"recordingId":{"type":"string","title":"Recordingid"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sessionid"},"callSid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callsid"},"orderId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orderid"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requestid"},"recordingStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordingstatus"},"recordingSource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordingsource"},"recordingScope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordingscope"},"recordingStartTime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordingstarttime"},"recordingCompletedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordingcompletedat"},"recordingDurationSeconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recordingdurationseconds"},"recordingChannels":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recordingchannels"},"fileFormat":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fileformat"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"sourceSystem":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcesystem"},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errorcode"},"storageProvider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storageprovider"},"storageService":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storageservice"},"storageObjectKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storageobjectkey"},"storageBucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storagebucket"},"storageFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storagefileid"},"playbackUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbackurl"},"fileSizeBytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filesizebytes"},"transcriptText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcripttext"},"transcriptJson":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Transcriptjson"},"confidenceLevel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidencelevel"},"confidenceRationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidencerationale"},"confidenceStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidencestatus"},"verbatimTranscript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verbatimtranscript"}},"additionalProperties":true,"type":"object","required":["recordingId"],"title":"RecordingIngestPayload","description":"Full recording metadata emitted by voice_agent_recording_runtime.py."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerificationContact":{"properties":{"value":{"type":"string","title":"Value"},"extension":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extension"},"primary":{"type":"boolean","title":"Primary","default":false},"verified":{"type":"boolean","title":"Verified","default":false},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"contactName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contactname"},"preferredTimeWindow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferredtimewindow"},"timeZone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"sources":{"items":{"$ref":"#/components/schemas/ContactSource"},"type":"array","title":"Sources"}},"type":"object","required":["value"],"title":"VerificationContact"},"VerificationMethods":{"properties":{"emails":{"items":{"$ref":"#/components/schemas/VerificationContact"},"type":"array","title":"Emails"},"faxNumbers":{"items":{"$ref":"#/components/schemas/VerificationContact"},"type":"array","title":"Faxnumbers"},"phoneNumbers":{"items":{"$ref":"#/components/schemas/VerificationContact"},"type":"array","title":"Phonenumbers"}},"type":"object","title":"VerificationMethods"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}