Skip to main content

Authentication

Authentication can be done in two different ways. Session tokens are useful for frontend calls, while API keys are useful for backend calls.
  1. API Key: Add your API key in the header x-ws-api-key
    -> { 'x-ws-api-key': '{apiKey}' }
  2. Session Token: Add the token in the header Authorization as: Bearer {sessionToken}
    -> { 'Authorization': 'Bearer {sessionToken}' }

How to Get a Session Token

Use this endpoint to get a session token (helpful for frontend calls): [POST] /v1/onboarding/session-token/generate


Onboarding Flow

WattShift separates discovery from evaluation:
  • DiscoveryPOST /v1/utility/get returns supported utilities and rate plans. No home is required.
  • Evaluation — Retrieve normalized pricing and impact outputs. This onboarding flow uses a Home as a lightweight evaluation context, not necessarily a real customer or installation; home-free impact routes are also available.

Steps to Onboard a Home

1. Fetch Utilities and Rate Plans

Fetch utilities and rate plans for a location, or look up plans for a known utility. [POST] /v1/utility/get Pass utilityId (EIA utility ID) when you already know the utility; use zipcode (or lat/long) to discover utilities for a location.
The response utilityId is the EIA utility ID. Choose the matching entry from ratePlans, then use that plan’s ratePlans[].id value as ratePlanId when calling the home endpoints. ratePlans[].udId repeats that WattShift plan ID; the companion ratePlans[].rateID field is the semantic normalized tariff identifier for reference and troubleshooting — not an EIA ID and not the value to send as ratePlanId.

2. Create a Home

Create Home with basic details, connecting to the utility, and select a rate plan. [POST] /v1/homes/create
The response field is named id; use that value as the homeId in later requests. For solar homes, the recommended fields are solarSystemSizeKw and isNonNetMetered. When both are present, WattShift creates solar info using standard defaults for module type, array type, efficiency, azimuth, and tilt. If you need to supply the full solar model yourself, use the advanced solarInfo object in the API reference.

3. Add or Update Solar Later (if needed)

If the home already exists, send the same solar fields to Update Home. [POST] /v1/homes/{homeId}/update
You can also continue to use the dedicated Create Solar endpoint. [POST] /v1/homes/solar/create

4. Get Price Signal Data

See the Price Signal documentation for more details.