> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nox.energy/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch Devices Pv Settings

> Update on a device or user level the device/user settings. If you want to update a setting on a device level, provide the device_id instead.
Any of the settings can be updated separately or together.


 You can change the following settings:

 * Enable/Disable steering optimizations. `pv_curtailment_mode` can be set to `managed`, `external` or `off`.
 If `managed` is enabled, we will optimize the pv curtailment.
 If `external` is enabled, we steer based on schedules provided by external parties like energy suppliers.
 If `off` is enabled, we will not curtail the pv.

 * The country code and the postal code



## OpenAPI

````yaml /api-docs/pv/openapi-pv.json patch /v1/devices/pv/settings
openapi: 3.1.0
info:
  title: NOX Energy API - PV
  description: >
    # PV API Documentation


    This documentation shows only the endpoints available to pv users.


    ## Authentication


    1. Get your API key from [NOX Energy](mailto:support@nox.energy).

    2. Include the API key in your API calls with the header: `x-api-key:
    YOUR_API_KEY`.


    ## Access Level


    This documentation is specifically for **pv users** who have access to these
    endpoints.


    Base URL: [https://api.nox.energy](https://api.nox.energy)
  version: 1.0.0
servers:
  - url: https://api.nox.energy
    description: Production Server
security:
  - ApiKeyAuth: []
tags:
  - name: Asset Info
    description: API to get basic information about your assets.
  - name: User Management
    description: API endpoints to manage users and their data.
paths:
  /v1/devices/pv/settings:
    patch:
      tags:
        - User Management
      summary: Patch Devices Pv Settings
      description: >-
        Update on a device or user level the device/user settings. If you want
        to update a setting on a device level, provide the device_id instead.

        Any of the settings can be updated separately or together.


         You can change the following settings:

         * Enable/Disable steering optimizations. `pv_curtailment_mode` can be set to `managed`, `external` or `off`.
         If `managed` is enabled, we will optimize the pv curtailment.
         If `external` is enabled, we steer based on schedules provided by external parties like energy suppliers.
         If `off` is enabled, we will not curtail the pv.

         * The country code and the postal code
      operationId: patch_devices_pv_settings_v1_devices_pv_settings_patch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevicesPVSettingsRequest'
            examples:
              full_configuration:
                summary: Complete settings configuration
                description: Example with all available settings configured
                value:
                  user_id: user456
                  device_id: device123
                  optimization_settings:
                    pv_curtailment_mode: managed
                  location:
                    country: NL
                    postal_code: 1234AB
              user_id_only:
                summary: Settings update based on user_id only
                description: >-
                  Example for updating settings for all devices of a user
                  without specifying device_id
                value:
                  user_id: user456
                  optimization_settings:
                    pv_curtailment_mode: external
                  location:
                    country: NL
                    postal_code: 1234AB
              device_id_only:
                summary: Settings update based on device_id only
                description: >-
                  Example for updating settings for a specific device without
                  user_id
                value:
                  device_id: device123
                  optimization_settings:
                    pv_curtailment_mode: 'off'
                  location:
                    country: NL
                    postal_code: 1234AB
              location_update_only:
                summary: Settings update with location information only
                description: Example for enabling/disabling device steering
                value:
                  device_id: device123
                  location:
                    country: NL
                    postal_code: 1234AB
      responses:
        '204':
          description: No Content - Settings updated successfully
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DevicesPVSettingsRequest:
      properties:
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          description: Device ID to update settings for
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: User ID to update settings for
        optimization_settings:
          anyOf:
            - $ref: >-
                #/components/schemas/app__models__pv__pv_settings_model__OptimizationSettings
            - type: 'null'
          description: Optimization settings for the device
        location:
          anyOf:
            - $ref: '#/components/schemas/LocationSettings'
            - type: 'null'
          description: Location-related settings
      additionalProperties: false
      type: object
      title: DevicesPVSettingsRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    app__models__pv__pv_settings_model__OptimizationSettings:
      properties:
        pv_curtailment_mode:
          anyOf:
            - $ref: '#/components/schemas/PVCurtailmentMode'
            - type: 'null'
          description: >-
            PV curtailment mode. If `managed`, NOX Energy manages the PV
            curtailment. If `external`, we follow the curtailment schedule
            provided by the external party. If `off`, PV curtailment is
            disabled.
      type: object
      title: OptimizationSettings
    LocationSettings:
      properties:
        country:
          type: string
          maxLength: 2
          title: Country
          description: ISO country code
        postal_code:
          anyOf:
            - type: string
              maxLength: 18
            - type: 'null'
          title: Postal Code
          description: Postal code for the device location
      type: object
      required:
        - country
      title: LocationSettings
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PVCurtailmentMode:
      type: string
      enum:
        - managed
        - external
        - 'off'
      title: PVCurtailmentMode
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Enter your API key in the format: YOUR_API_KEY'

````