Skip to content

REST API & MCP integrations

REST API overview and authentication

Connect to the current ExCoil REST API: access, real routes, request bodies, units, responses and operational limits.

Reviewed

1. Access and the REST/MCP boundary

REST access requires an Enterprise or Manufacturer subscription with status active or trialing. The server checks the key owner's current subscription on every request; holding an old key does not preserve access after a downgrade or loss of eligible status.

REST uses /api/v1 and API keys beginning with exk_. MCP is a separate Streamable HTTP interface at /api/mcp, restricted to Manufacturer, with dedicated manually configured Bearer tokens. Neither credential substitutes for the other. These REST routes do not implement an OAuth authorization flow.

The routes below expose six finned-coil calculation engines and a refrigerant list. They do not provide REST project CRUD, Shell & Tube, fabrication files, CAD or PDF export. A projects:read permission on a REST key does not create a project endpoint. Detailed fabrication remains Manufacturer-only; this guide does not grant it through REST.

2. Base URL and authentication

Use the origin of the ExCoil environment where the API is actually deployed, followed by /api/v1. For the production domain the base URL is https://excoil.net/api/v1. A preview deployment is a different environment; code in a preview does not prove that it is published on the production domain.

Generate a key on the API Keys page and save its full value immediately: it is shown only once. Send Authorization: Bearer followed by the REST key on every request, including GET /health and GET /refrigerants. Keep the capitalized Bearer prefix and a space. A browser login cookie alone does not authenticate these routes.

Send Content-Type: application/json on calculation POST requests. Keep keys in server-side secret storage, not browser bundles, URLs, prompts, source control or shared logs. If a key is lost or exposed, revoke it and replace it; old keys can still be managed after a downgrade.

bash

BASE_URL='https://excoil.net/api/v1'
EXCOIL_API_KEY='exk_REPLACE_WITH_YOUR_REST_KEY'
curl --include "$BASE_URL/health" \
  -H "Authorization: Bearer $EXCOIL_API_KEY"

3. Implemented routes

All paths in this table are relative to /api/v1. All require authentication and eligible subscription status. Calculation POST routes and /refrigerants also require calc:read. /health does not add that permission check.

MethodPathPurpose
GET/healthAPI status, version and timestamp
GET/refrigerantsAvailable refrigerant identifiers
POST/calculate/chilled-waterChilled-water coil
POST/calculate/hot-waterHot-water coil
POST/calculate/steam-coilSteam coil
POST/calculate/dry-coolerDry cooler
POST/calculate/dx-evaporatorDX evaporator
POST/calculate/dx-evaporator/balancedDX evaporator with balance solver
POST/calculate/dx-condenserDX condenser
POST/calculate/dx-condenser/balancedDX condenser with balance solver

4. Build the correct JSON body

Ordinary calculation routes accept the engine input object directly, not a data or inputs wrapper. CHW and hot-water inputs contain air, water, coil, hydraulic and calib; steam uses air, steam, coil, hydraulic and calib; dry cooler uses its own fluid, air, coil, hydraulic and calib fields. DX inputs use air, coil, ref and calib. Required fields differ by engine; do not copy a web-form display object or reuse one module's body for another.

The DX evaporator balanced route is the exception: send an object containing inputs and, optionally, options. Its inputs field contains the complete DX evaporator engine input. The DX condenser balanced route instead accepts the condenser input object directly, without the evaporator's inputs/options envelope.

For DX requests, use ref.fluid with an exact identifier returned by /refrigerants. The router also recognizes legacy ref.refrigerant or top-level refrigerant when choosing the table, but the canonical engine field remains ref.fluid. Matching a table alone does not replace the rest of the engine's required ref fields.

The REST wrapper performs limited body and refrigerant checks, not comprehensive schema validation. It does not automatically convert UI units or supply every missing engine field. Validate required values, physical ranges, geometry and calibration in your integration before sending a request.

5. Units are part of the contract

The API uses engine field names and units, independent of the display-unit settings in the web application. Numeric JSON values must already be converted; do not send localized number strings or unit labels inside numeric fields.

Field or suffixMeaning and unit
Vdot_m3_s; mdot_kg_sVolumetric flow in m³/s; mass flow in kg/s
T_in_C; Tevap_C; *_KTemperature in °C; temperature differences or superheat in K
height_m; width_m; Do_m; wall_mGeometry in metres, not millimetres
P_Pa; *_Pa; *_kPaPressure in Pa or kPa exactly as named
RH_in; freeAreaRatioFractions from 0 to 1, not percentages
glycol_pctWater-coil glycol percentage, not a 0–1 fraction
fpiFins per inch; not fins per metre
P_steam_kPaSteam pressure in kPa gauge, not absolute Pa
Q_total_W; h_outCapacity in W; CHW/DX evaporator outlet enthalpy in J/kg dry air

6. Read the response and engineering diagnostics

Calculation success uses {"success":true,"data":...}, where data is the engine's result object. GET /refrigerants uses the same envelope with an array of identifiers. GET /health is different: it returns status, version and timestamp directly, without success or data.

An HTTP 200 and success:true mean the solver returned a result, not that every engineering criterion passed. Inspect the module's flags, convergence state, notes and available performance diagnostics. Retain warnings alongside the input snapshot and result; do not silently discard a false convergence or feasibility flag.

Balanced endpoints return their own solver result inside data. Inspect the specific result contract rather than assuming every endpoint has identical perf or flags paths. A low energy-balance error is a numerical diagnostic, not independent validation, certification or permission to fabricate.

json

{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "<ISO-8601 timestamp>"
}

7. Request limits and retry behavior

The limiter is per REST key and server process. It uses the key's configured rateLimit, falling back to 100 requests per minute when that value is absent or zero. A 60-second window begins with the first admitted request; do not assume resets occur at the start of a calendar minute.

After authentication and plan checks, admitted requests consume the allowance before the route's permission check or calculation. Health checks, refrigerant lists, permission failures and calculation errors can therefore consume it too. Authentication and plan failures occur before this limiter.

Read X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Reset is a Unix timestamp in seconds, not milliseconds or a duration. A 429 response includes these headers and rate_limit_exceeded; this middleware does not set Retry-After. Wait until the reset, allow for clock differences and use bounded retries rather than a tight loop.

The limiter is in memory, resets on process restart and is not a shared global quota across replicas. It is not a throughput, concurrency or response-time guarantee. This REST router does not implement a per-request deadline or an asynchronous job/polling endpoint.

8. Diagnose HTTP and calculation errors

Router-generated failures return error and message without success:false. Inspect the HTTP status and error code, and retain a sanitized message for troubleshooting. Parser, proxy or infrastructure errors may have a different body; check the content type before assuming JSON.

HTTP / errorMeaningAction
400 / bad_requestMissing/non-object ordinary body, or missing/unknown DX refrigerant; missing balanced-evaporator inputsCorrect the body shape and refrigerant identifier
401 / unauthorizedMissing/wrong Bearer header, wrong key prefix or unrecognized keyCheck header and REST credential, not the MCP token
403 / forbiddenRevoked/expired key, ineligible plan/status or missing permissionCheck key state, owner subscription and calc:read
422 / calculation_errorAn exception occurred during the solver handlerReview message, inputs, units and operating range; do not retry unchanged indefinitely
429 / rate_limit_exceededThis key exhausted the current in-memory windowUse the rate-limit headers and delay the retry

json

{
  "error": "unauthorized",
  "message": "Invalid API key."
}

9. Practical integration checklist

  1. Confirm the target environment, eligible subscription and a dedicated REST key. Store the full key securely and keep only its prefix in routine diagnostics.
  2. Use authenticated /health to verify connectivity, then /refrigerants when using a DX engine. Include both calls in your request budget.
  3. Choose the exact route and engine input contract, convert units explicitly and validate required fields before the request. Use the calculator guide for module-specific details.
  4. For a calculation POST, add the Authorization and Content-Type headers and serialize the complete input object. Use the special inputs/options envelope only for balanced DX evaporator.
  5. Check status, response shape, rate headers and engineering diagnostics. Keep the submitted inputs, engine version when returned and all warnings with the result for later review.
  6. Correct 400/401/403/422 causes instead of retrying blindly; delay 429 retries. Revoke compromised keys. Obtain engineering review before selection, procurement or fabrication.

Documented features depend on your subscription and the data available in the calculation. A dimensional drawing is not a release for fabrication.

All guides