> For the complete documentation index, see [llms.txt](https://docs.net2grid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.net2grid.com/device-management-api/label-partner-configuration/labelpartners-labelpartner-streamer-power-thresholds-configuration.md).

# /labelpartners/{labelpartner}/streamer/power-thresholds/configuration

Sets the power thresholds alert configuration in the pt\_mgmt shadow for all devices registered to a specific label partner. Each phase (mains, phase\_1, phase\_2, phase\_3) accepts a list of threshold configurations. The label partner setting overrides any previously applied per-device configuration. Disclaimer: Any changes to the power thresholds alert configuration will be applied to all devices registered to the label partner. All user-defined configurations will be lost without a way to restore them.

```json
{"openapi":"3.0.1","info":{"title":"Device Management API","version":"1.6.0"},"tags":[{"name":"Label Partner Configuration","description":"Commands to configure all devices of a specific label partner"}],"servers":[{"url":"https://device-management.n2g-{platform}.net/v2","variables":{"platform":{"default":"dev","description":"The platform name"}}}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"x-api-key","in":"header"}},"parameters":{"LabelPartner":{"name":"labelpartner","in":"path","description":"The label partner short name","required":true,"schema":{"type":"string"}}},"schemas":{"PowerThresholdsConfiguration":{"type":"object","description":"Contains the power thresholds configuration. At least one phase must be provided. Each phase accepts at most 4 threshold configurations.\n","properties":{"mains":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/PowerThresholdsThreshold"},"description":"The power thresholds configuration for mains."},"phase_1":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/PowerThresholdsThreshold"},"description":"The power thresholds configuration for phase 1."},"phase_2":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/PowerThresholdsThreshold"},"description":"The power thresholds configuration for phase 2."},"phase_3":{"type":"array","maxItems":4,"items":{"$ref":"#/components/schemas/PowerThresholdsThreshold"},"description":"The power thresholds configuration for phase 3."}}},"PowerThresholdsThreshold":{"type":"object","description":"A single threshold configuration within a phase.","required":["threshold_id","alert_state"],"properties":{"threshold_id":{"type":"string","enum":["threshold_0","threshold_1","threshold_2","threshold_3"],"description":"Contains the ID of the power threshold."},"alert_state":{"type":"string","enum":["enabled","disabled","reset"],"description":"Indicates the status of the power alerts configuration:\n  - `enabled`: The power threshold is active.\n  - `disabled`: The power threshold is disabled, but it remains configured on the device.\n  - `reset`: No power threshold is configured. This status can be used to remove a previously set\n    threshold.\n"},"threshold_value":{"type":"integer","description":"Contains the threshold value in Watts. Positive values indicate energy consumption, negative values indicate energy production, and zero indicates the transition between consumption and production. The `threshold_value` is required when setting up a power threshold for the first time. If it has already been configured and is omitted in subsequent requests, the previously set value will be used.\n"},"alert_type":{"type":"string","enum":["upper","lower","both"],"description":"Indicates whether the threshold is `upper` (the alert triggers when power exceeds the threshold), `lower` (the alert triggers when power falls below the threshold) or `both`. Defaults to the previously set value, or to `upper` if the power threshold is being enabled for the first time.\n"},"cooldown":{"type":"integer","minimum":1,"description":"Indicates the cooldown period, in seconds, between two consecutive reported alerts. Defaults to the previously set value, or to `15` if the power threshold is being enabled for the first time.\n"},"aggregation_method":{"type":"string","enum":["mean","median","mode","none"],"description":"Indicates the aggregation method to use. Defaults to the previously set value, or to `mean` if the power threshold is being enabled for the first time.\n"},"aggregation_sample_count":{"type":"integer","minimum":1,"maximum":120,"description":"Indicates the number of samples to consider for aggregation. Defaults to the previously set value, or to `5` if the power threshold is being enabled for the first time.\n"},"aggregation_sample_interval":{"type":"integer","minimum":1,"description":"Indicates the interval between samples, in seconds. Defaults to the previously set value, or to `1` if the power threshold is being enabled for the first time.\n"}}},"SuccessfulResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"The success message returned."}}},"ErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"The error message returned."},"code":{"type":"integer","description":"The error code returned."}}}},"responses":{"LabelPartnerNotFoundOrEmptyErrorResponse":{"description":"Not found:\n  - The thing group '{labelpartner}' was not found in the registry.\n  - The thing group '{labelpartner}' does not have any IoT Things associated with it.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerErrorResponse":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/labelpartners/{labelpartner}/streamer/power-thresholds/configuration":{"put":{"summary":"/labelpartners/{labelpartner}/streamer/power-thresholds/configuration","description":"Sets the power thresholds alert configuration in the pt_mgmt shadow for all devices registered to a specific label partner. Each phase (mains, phase_1, phase_2, phase_3) accepts a list of threshold configurations. The label partner setting overrides any previously applied per-device configuration.\nDisclaimer: Any changes to the power thresholds alert configuration will be applied to all devices registered to the label partner. All user-defined configurations will be lost without a way to restore them.\n","operationId":"putLabelPartnerStreamerPowerThresholdsConfiguration","tags":["Label Partner Configuration"],"parameters":[{"$ref":"#/components/parameters/LabelPartner"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PowerThresholdsConfiguration"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessfulResponse"}}}},"400":{"description":"Invalid request:\n  - Request body is required but was not provided.\n  - Schema validation failed due to error: At least one phase must be provided.\n  - Schema validation failed due to error: Invalid phase: '{phase}'.\n  - Schema validation failed due to error: Phase '{phase}' must be a non-empty list of threshold configurations.\n  - Schema validation failed due to error: Phase '{phase}' must contain at most 4 threshold configurations.\n  - Schema validation failed due to error: Each threshold in '{phase}' must be a dict.\n  - Schema validation failed due to error: Duplicate 'threshold_id': '{id}' in phase '{phase}'.\n  - Schema validation failed due to error: Invalid 'threshold_id': '{id}'.\n  - Schema validation failed due to error: Invalid 'alert_state': '{state}'.\n  - Schema validation failed due to error: Invalid 'alert_type': '{type}'.\n  - Schema validation failed due to error: Invalid 'aggregation_method': '{method}'.\n  - Schema validation failed due to error: Invalid 'cooldown': '{cooldown}'. Must be >= 1.\n  - Schema validation failed due to error: Invalid 'aggregation_sample_count': '{count}'. Must be between 1 and 120.\n  - Schema validation failed due to error: Invalid 'aggregation_sample_interval': '{interval}'. Must be >= 1.\n  - Edge events are not enabled for label partner '{labelpartner}'.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/LabelPartnerNotFoundOrEmptyErrorResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorResponse"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.net2grid.com/device-management-api/label-partner-configuration/labelpartners-labelpartner-streamer-power-thresholds-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
