MMetiss AI|Docs

API Reference

All Metiss AI backend services are deployed on GCP Cloud Run and routed through the API Gateway. This page lists every available endpoint across all services.

Base URL

https://api.metiss.ai/v1/{service-name}/{endpoint}

Authentication

All endpoints (except /health) require a valid bearer token issued by the authenticator service. Pass it in the Authorization header:

Authorization: Bearer <id_token>

Obtain an ID token by exchanging your Firebase refresh token via POST /v1/authenticator-service/refresh-token. Tokens are short-lived; refresh as needed. The API Gateway validates the token and rejects requests with 401 if it is missing or expired.

Widget token flow: The Lead Widget receives a Firebase refresh token as the ?token= URL parameter, exchanges it for an ID token on load, and uses that ID token for all subsequent API calls within the session.

Authenticator Service

Handles token issuance and refresh. Base path: /v1/authenticator-service

Method & pathDescriptionAuth required
POST /get-tokenExchange Firebase credentials for an ID token.No
POST /refresh-tokenExchange a Firebase refresh token for a short-lived ID token. Used by the widget on load.No

Utility Bill Service

AI-powered extraction of structured data from electricity bills. Base path: /v1/utility-bill-service

Method & pathDescriptionMode
POST /process-billUpload a bill file (PDF/PNG/JPG/JPEG) and extract structured data synchronously. Returns customer info, billing amounts, meter readings, and up to 12 months of usage history.Sync
POST /process-utility-billProcess a bill already stored in GCS. Triggers background extraction — poll for status.Async
POST /poll-utility-bill-statusPoll the status of an async extraction job using transactionId. Returns status, percentage, and message.
GET /healthHealth check. Returns {'status':'ok'}.

See Utility Bill AI for full request/response schemas and retry logic.

Savings Insight Service

Generates personalised solar savings reports combining Google Solar API data with Gemini. Base path: /v1/savings-insight-service

Method & pathDescriptionReturns
POST /savings-insight-reportFull pipeline — geocodes address, fetches roof data, calculates financials, generates Gemini report, and triggers email + PDF delivery.Report JSON + transaction ID
POST /generate-savings-insightsLLM report generation only. Caller supplies pre-computed usage and financial data; Gemini generates the report sections.Validated report sections JSON
POST /generate-pdf-reportRenders an existing LLM report response to PDF.PDF binary stream
GET /healthHealth check.{'status':'ok'}

See Savings Insight for the full calculation model and report schema.

Widget Service

Serves the Lead Widget's configuration and orchestrates lead creation into external systems. Base path: /v1/widget-service

Method & pathDescriptionNotes
GET /widget-infoReturns the partner's widget configuration — logo URL, serving states, roof types, and custom widget info content.Called on widget load
GET /energy-providersReturns the list of electricity providers available for a given address/state.Called after address entry
GET /roof-analysisAnalyses a property's roof type from satellite imagery using the Google Solar API.
POST /create-leadCreates a qualified lead in the partner's Salesforce CRM.Called after contact details step
POST /create-opportunityCreates a Salesforce opportunity linked to an existing lead.
POST /contactCreates a contact record in the Metiss platform.
POST /propertyCreates a property record linked to a contact.
PUT /property/{property_uuid}Updates an existing property record.
POST /property/{property_uuid}/uploadAttaches documents or details to a property record.
POST /process-widget-savings-infoProcesses utility bill data from the widget flow and triggers the savings insight pipeline.
GET /healthHealth check.

Appointment Handling Service

Manages field service appointment scheduling via Skedulo. Base path: /v1/appointment-handling-service

Method & pathDescriptionNotes
GET /available-slots/{organization_uuid}Returns available appointment time slots for the given partner organisation from Skedulo.
POST /create-appointmentBooks a field service appointment in Skedulo for a given time slot and property.
GET /healthHealth check.

Contract Approval Service

Handles partner contract upload, AI-powered analysis, and approval workflows. Base path: /v1/contract-approval-service

Method & pathDescriptionMode
POST /analyze-contractUploads and analyses a contract document. Returns a structured summary and approval status.Async
POST /analyze-contract-billAnalyses a contract that includes billing information.Async
POST /poll-contract-approval-statusPolls the processing status of a contract analysis job using transactionId.
GET /healthHealth check.

Email Agent

Handles outbound customer communications and billing email tracking. Base path: /v1/email-agent

Method & pathDescriptionNotes
POST /check-inboxChecks the configured email inbox for incoming messages.
POST /track-billing-email-messagesTracks and logs billing-related email message activity.
GET /healthHealth check.

PDF Generator Service

Renders HTML content and templates to PDF. Base path: /v1/pdf-generator-service

Method & pathDescriptionReturns
POST /generate-pdf-from-htmlAccepts raw HTML and returns a rendered PDF.PDF binary stream
POST /generate-pdf-from-templateRenders a named template with provided data variables to PDF.PDF binary stream
POST /generate-savings-reportRenders a savings insight report (from the savings-insight-service output) to a formatted PDF.PDF binary stream

Common response codes

CodeMeaningCommon cause
200SuccessRequest processed successfully.
400Bad requestInvalid input, missing required fields, unsupported file type, or inactive subscription.
401UnauthorisedMissing, expired, or invalid bearer token.
403ForbiddenToken valid but caller lacks permission for the requested resource.
500Internal server errorUnexpected processing failure — check logs via GCP Cloud Logging.