openapi: 3.2.0 info: title: FranklinWH Device Data API version: '1.0' summary: Partner API for the FranklinWH (Franklin Whole Home) residential energy storage platform. description: 'Machine-readable rendering of the FranklinWH partner API as published by FranklinWH''s own API portal at https://api.franklinwh.com/ (portal title `FWH-API-Service`, author `FWH`, version 1.0). The portal ships its complete operation catalogue - paths, HTTP methods, parameter names, locations, types, requirement flags and value notes - as a static, publicly retrievable JavaScript module; this OpenAPI document is a faithful format conversion of that catalogue. Nothing has been added that the portal does not publish. Response payload schemas are NOT published by the portal, so only the observed response envelope is modelled here. The API covers site and device inventory, telemetry and energy data, warnings and backup events, time-of-use profiles, smart-circuit and grid-event control, aPower battery start/stop, device grouping and an operation audit log, plus a Sunrun-specific namespace (`/api-sunrun/`). Authentication: POST /api-common/tokenizer with a `cp` / `ck` credential pair returns a token that is sent on every other operation in the `Authorization` header. Base URL: the only base URL FranklinWH publishes publicly is the free test environment, https://test-api.franklinwh.com. The production base URL is issued to authorised partners during onboarding and is not published.' contact: name: FranklinWH Support email: service@franklinwh.com url: https://www.franklinwh.com/support/contact/ x-provenance: method: derived source: https://api.franklinwh.com/js/apiList-eQeWKe2I.js source_portal: https://api.franklinwh.com/ derived: '2026-08-16' note: Converted from the FranklinWH API portal's own published operation catalogue. Operations, parameters and request examples are verbatim from that catalogue; no operation, parameter or schema was invented. servers: - url: https://test-api.franklinwh.com description: Free test environment - the only base URL FranklinWH publishes publicly (portal `host` / `basePath`). security: - AuthorizationToken: [] tags: - name: Device Data description: Power, energy, telemetry, inventory and historical load data. paths: /api-common/queryPowerData: get: tags: - Device Data summary: Query Power Data operationId: queryPowerData description: Get the latest data of the day or query all data on a specific date parameters: - name: deviceId in: query required: true schema: type: string description: Device id - name: type in: query required: true schema: type: integer description: 'Query type. 1: Running data (The latest data of the day) 2: Daily data (All 5 minutes data on the selected day, including today or history)' - name: queryDate in: query required: false schema: type: string description: Specific date. Only required when the query type is 2 responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/getMaxPowerData: post: tags: - Device Data summary: Query Maximum Power Data operationId: getMaxPowerData description: Query the maximum power within defined periods requestBody: required: true content: application/json: schema: type: object properties: deviceId: type: string description: Device id type: type: integer description: 'Query type: 1: Day, 2:Week, 3:Month, 4:Year, 5:Total' queryDate: type: integer description: 'Date. When type is 2, calculate the week boundaries based on the selected date Required: When type is 1-4; Not required: when type is 5' required: - deviceId - type responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/queryEnergyData: post: tags: - Device Data summary: Query Energy Data operationId: queryEnergyData description: Get the latest data or all energy data within defined periods requestBody: required: true content: application/json: schema: type: object properties: deviceId: type: string description: Device id type: type: integer description: 'Query type: 1: Day, 2:Week, 3:Month , 4:Year, 5:Total. Day: Data is returned at a time of 5 minutes. Week: Data is returned at a time for each day of the week. Month: Data is returned at a time for each day of the month.Year: Data is returned at a time for each month of the year. Total: Data is returned at a time for each year of the lifetime' queryDate: type: string description: 'Date. When type is 2, calculate the week boundaries based on the selected date Required: When type is 1-4; Not required: when type is 5' required: - deviceId - type responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/queryPowerSourceDetails: post: tags: - Device Data summary: Query Power Source Details operationId: queryPowerSourceDetails description: Get the latest data about FHP, grid, and solar, or the data on a specific date requestBody: required: true content: application/json: schema: type: object properties: deviceId: type: string description: Device ID type: type: integer description: 'Query type. 1: Running data (The latest data of the day) 2: Daily data (All 15 minutes data on the selected day, including today or history)' queryDate: type: string description: Query date. Only required when the query type is 2 required: - deviceId - type responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/queryDeviceDataPool: get: tags: - Device Data summary: Query Telemetry Grouping operationId: queryDeviceDataPool description: Query Telemetry Grouping parameters: - name: deviceId in: query required: false schema: type: string description: Device ID. deviceId and siteId can not both null - name: siteId in: query required: false schema: type: integer description: SiteID. deviceId and siteId can not both null responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/queryInventory: get: tags: - Device Data summary: Query Inventory operationId: queryInventory description: Query Inventory parameters: - name: deviceId in: query required: false schema: type: string description: Device id - name: siteId in: query required: false schema: type: integer description: Site ID - name: siteName in: query required: false schema: type: string description: Site name. Need to be unique - name: current in: query required: false schema: type: integer description: Current Page. Defaults to the first page if not posted - name: pageSize in: query required: false schema: type: integer description: Display quantity per page. The default number is 20 if not posted. Maximum is 50 responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' /api-common/historyDataLoad: get: tags: - Device Data summary: Query Historical Data Load operationId: historyDataLoad description: Query Historical Data Load, this API offers total 7 days running history data ( 5 min. Period ) parameters: - name: siteName in: query required: false schema: type: string description: Site Name. siteNameand siteId can not both null - name: siteId in: query required: false schema: type: integer description: Site ID. siteNameand siteId can not both null responses: '200': description: Envelope response. Non-zero `code` values (401 wrong token, 403 missing token or token param) are returned inside the envelope with HTTP 200. content: application/json: schema: $ref: '#/components/schemas/ApiEnvelope' '404': description: Unknown path. content: application/json: schema: $ref: '#/components/schemas/NotFoundError' components: schemas: NotFoundError: type: object description: Framework 404 body returned for unknown paths. properties: timestamp: type: string format: date-time path: type: string status: type: integer error: type: string message: type: - string - 'null' requestId: type: string examples: - timestamp: '2026-08-16T17:23:07.914+00:00' path: / status: 404 error: Not Found message: null requestId: 1748b892-1427296 ApiEnvelope: type: object description: Response envelope used by every operation. Observed live on https://test-api.franklinwh.com. properties: code: type: integer description: Result code. 401 = wrong token, 403 = missing token or token param. msg: type: string description: Human-readable result message. data: description: Operation payload. FranklinWH does not publish payload schemas; shape varies per operation. examples: - code: 401 msg: wrong token securitySchemes: AuthorizationToken: type: apiKey in: header name: Authorization description: Token returned by POST /api-common/tokenizer (exchange of a `cp` / `ck` credential pair).