Network Sustainability Analytics: API Endpoints and Parameters
Use the Network Sustainability Analytics APIs to programmatically access sustainability data and configure supported settings.
This topic describes the supported Network Sustainability Analytics API endpoints, request parameters, and HTTP status codes. Use this information to construct API requests and interpret API responses.
For information about accessing Data Center Assurance sustainability data using APIs, API request authentication, and API token access permissions, see Access Data Center Assurance Using APIs.
Supported API Endpoints
Supports API requests for the following resources:
-
Energy Settings
-
Traffic Settings
-
Sites Summary Metrics
-
Non-Usage Emissions
-
Forecasted Power
-
Historical Metrics
-
Savings Summary
-
Savings by Recommendation Type
Each resource type is scoped to either an organization (org_id) or a
specific site (site_id).
For example:
- Organization:
GET /api/v1/sustainability/orgs/<org-id>/energy_settings - Site:
GET /api/v1/sustainability/sites/<site-id>/energy_settings
The settings endpoints support GET, POST, and
PUT methods for configuration changes.
Table 1 lists the API endpoints supported for each resource type.
| Resource Type | API Endpoints | |
|---|---|---|
|
Organization |
Sites |
|
|
Energy Settings |
|
|
|
Traffic Settings |
|
|
|
Sites Summary Metrics |
|
- |
|
Non-Usage Emissions |
GET
/api/v1/sustainability/jei-core/stats/orgs/<org-id>/nonusage-emissions |
GET
/api/v1/sustainability/jei-core/stats/sites/<site-id>/nonusage-emissions |
|
Forecasted Power |
|
POST
/api/v1/sustainability/jei-core/stats/sites/<site-id>/forecasted-power |
|
Historical Metrics |
POST
/api/v1/sustainability/jei-core/stats/historical/orgs/<org-id>/metrics |
POST
/api/v1/sustainability/jei-core/stats/historical/sites/<site-id>/metrics |
|
Savings Summary |
GET
/api/v1/sustainability/jei-recommender/orgs/<org-id>/savings/summary |
GET
/api/v1/sustainability/jei-recommender/orgs/<org-id>/sites/<site-id>/savings/summary |
|
Savings by Recommendation Type |
POST
/api/v1/sustainability/jei-recommender/orgs/<org-id>/savings/summary-by-recommendation-type |
POST
/api/v1/sustainability/jei-recommender/orgs/<org-id>/sites/<site-id>/savings/summary-by-recommendation-type |
Supported Parameters
You can add parameters to modify the output of your API request as per your requirements.
| Parameter | Value | Description | Example |
|---|---|---|---|
org_id |
Organization ID | Path parameter that identifies the organization to query or
configure. Note: Required parameter on all
organization-scoped endpoints.
|
GET
/api/v1/sustainability/orgs/org_id/energy_settings |
site_id |
Site ID | Path parameter that identifies the site to query or
configure. Note: Required parameter on all
site-scoped endpoints.
|
GET
/api/v1/sustainability/sites/site_id/energy_settings |
from |
Epoch milliseconds | Start of the time range. Note: Required
parameter on sites-summary, forecasted-power, historical
metrics, and savings summary endpoints.
|
GET .../sites-summary?from=1753948800000 |
to |
Epoch milliseconds | End of the time range. Note: Required with
from parameter on the same
endpoints. |
GET .../sites-summary?to=1753949700000 |
sort |
Metric name | Sort site summary results by the specified metric. Note:
This parameter is optional and is supported only on the Sites Summary Metrics endpoint. Allowed metrics:
Each metric can be prefixed with a hyphen
( |
GET .../sites-summary?sort=-power |
limit |
Number | Maximum number of items to return. Note: This parameter is optional and is supported only on the Sites
Summary Metrics endpoint. The default limit is
50.
|
GET .../sites-summary?limit=10 |
offset |
Number | Number of items to skip before returning results. Note: This parameter is optional and is
supported only on the Sites Summary Metrics endpoint. The
default is 0
|
GET .../sites-summary?offset=2 |
Some endpoints also accept parameters in the request body for POST
and PUT requests.
| Endpoints | Field | Description |
|---|---|---|
|
Forecasted, Power, Historical Metrics |
interval_type |
Granularity of the data: 1mo (monthly) or 1d (daily). |
| Historical Metrics | aggregated |
Boolean.
|
|
Energy Settings ( |
|
Energy settings values. Some fields accept only specific values. Accepted values are:
All listed fields are required for |
|
Traffic Settings ( |
|
Traffic threshold values; high must be greater
than low. |
|
Savings by Recommendation Type |
action_type |
Optional. Filters results to recommendation types whose name
contains this substring. The default is |
The Savings Summary and Savings by Recommendation Type endpoints always return HTTP 200 status code.
For these endpoints, request validation errors are reported in the response body
as status.status = 400 and status.message and
instead of as an HTTP error status code.
See the endpoint description in the Swagger specification for the exact list of possible error messages.
REST API HTTP Status Codes
After you send as API request, the API returns a response with one of the following HTTP status codes.
| Status | Description |
|---|---|
200 |
OK. The API successfully processed the request and returned a response. |
204 |
No Content. The request succeeded, but the response does not contain a body.
This status code is returned by the |
400 |
Bad Request. The API endpoint exists but the request syntax or payload is invalid. |
401 |
Unauthorized. The authentication toward the API failed. You receive this code if the authentication token is invalid or is not sent in the required format. Verify your authentication information. |
403 |
Forbidden. Authentication succeeded, but the caller does not have permission to access the requested organization, site, or resource. Access is also enforced at the upstream gateway or service layer in front of sustainability service. |
404 |
Not found. The requested Energy Settings or Traffic Settings resource does not exist for the specified organization or site. This status code can also be returned when the requested Forecasted Power resource is not available. |
405 |
Method Not Allowed. The Energy Settings or Traffic Settings endpoint received an HTTP
method other than |
500 |
Internal Server Error. The API encountered an unexpected condition that prevented it from fulfilling the request. |
503 |
Service Unavailable. This status code is returned by Forecasted Power and Historical metrics endpoints wheninterval_type=1d is requested but the daily
data source is not configured for the deployment. |