PG&E Share My Data OAuth 2.0 Authorization API

The OAuth 2.0 authorization server behind Share My Data, implemented to meet the NAESB ESPI authorization profile. Two token classes are issued separately: a client access token via the client_credentials grant for third-party-level resources, and a per-customer access/refresh token pair via the authorization_code grant after a PG&E customer authenticates on PG&E's site and selects what to share. Authorized scope is returned as an ESPI function-block string (for example FB=1_3_8_13_14_18_19_31_32_35_37_38_39_40_4_5_10_15_16_46_47 with AdditionalScope, IntervalDuration, BlockDuration, HistoryLength and AccountCollection parameters), documented in PG&E's supported function-block scope-string mapping. PG&E publishes both a production authorization server at /datacustodian/oauth/v2/ and a separate test authorization server at /datacustodian/test/oauth/v2/ used during mandatory registration testing. Verified live anonymously on 2026-07-27: GET on the token endpoint returns HTTP 405 {"error":"invalid_request","error_description":"GET not permitted"}, and an unparameterised request returns HTTP 400 {"error":"invalid_request","error_description":"Missing grant_type"} — real RFC 6749 error responses from a Mulesoft-API-Gateway. Except for the browser redirects in the authorization-code flow, every call must carry the third party's client SSL certificate over mutual TLS. No /.well-known/openid-configuration is served (HTTP 404 on both www.pge.com and api.pge.com); this is OAuth 2.0, not OpenID Connect.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pge-share-my-data-oauth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

API entry from apis.yml

apis.yml Raw ↑
aid: pge:pge-share-my-data-oauth-api
name: PG&E Share My Data OAuth 2.0 Authorization API
description: 'The OAuth 2.0 authorization server behind Share My Data, implemented to meet the NAESB ESPI
  authorization profile. Two token classes are issued separately: a client access token via the client_credentials
  grant for third-party-level resources, and a per-customer access/refresh token pair via the authorization_code
  grant after a PG&E customer authenticates on PG&E''s site and selects what to share. Authorized scope
  is returned as an ESPI function-block string (for example FB=1_3_8_13_14_18_19_31_32_35_37_38_39_40_4_5_10_15_16_46_47
  with AdditionalScope, IntervalDuration, BlockDuration, HistoryLength and AccountCollection parameters),
  documented in PG&E''s supported function-block scope-string mapping. PG&E publishes both a production
  authorization server at /datacustodian/oauth/v2/ and a separate test authorization server at /datacustodian/test/oauth/v2/
  used during mandatory registration testing. Verified live anonymously on 2026-07-27: GET on the token
  endpoint returns HTTP 405 {"error":"invalid_request","error_description":"GET not permitted"}, and an
  unparameterised request returns HTTP 400 {"error":"invalid_request","error_description":"Missing grant_type"}
  — real RFC 6749 error responses from a Mulesoft-API-Gateway. Except for the browser redirects in the
  authorization-code flow, every call must carry the third party''s client SSL certificate over mutual
  TLS. No /.well-known/openid-configuration is served (HTTP 404 on both www.pge.com and api.pge.com);
  this is OAuth 2.0, not OpenID Connect.'
humanURL: https://www.pge.com/en/save-energy-and-money/energy-saving-programs/smartmeter/third-party-companies.html
baseURL: https://api.pge.com/datacustodian/oauth/v2
tags:
- Authentication
- Authorization
- Green Button
- ESPI
- Security
tags_raw:
- OAuth
- Authorization
- Green Button
- ESPI
- Security
properties:
- type: Documentation
  url: https://www.pge.com/assets/pge/docs/save-energy-and-money/energy-savings-programs/OAuth_Authorization_ESPI.pdf
- type: Documentation
  url: https://www.pge.com/assets/pge/docs/save-energy-and-money/energy-savings-programs/Supported-Function-Block-Scope-String-Mapping-Click-Thru-2.0.pdf
- type: APIReference
  url: https://www.pge.com/assets/pge/docs/save-energy-and-money/energy-savings-programs/Supported-APIs.pdf
- type: Documentation
  url: https://www.pge.com/en/save-energy-and-money/energy-saving-programs/smartmeter/third-party-companies.html
- type: Registration
  url: https://sharemydata.pge.com/
- type: Authentication
  url: authentication/pge-authentication.yml
- type: OAuthScopes
  url: scopes/pge-scopes.yml
- type: Sandbox
  url: sandbox/pge-sandbox.yml
- type: Reference
  url: http://naesb.org/espi