---
updatedAt: 2026-03-31T12:12:41.000Z
agentTools:
  projectIndex: https://api.net2grid.com/llms.txt
---

# /plug/relay

This endpoint controls the relay button of the Smart Plug. It is applicable only to gateways
     with Smart Plug functionality like SPLR4911. These devices can measure and/or control the load of an appliance
     that is directly connected to it's integrated schuko socket

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "NET2GRID Customer Engagement API",
    "description": "This is the B2C NET2GRID API that can be used by mobile and web apps to manage the accounts and the data that are provided by the NET2GRID Meter Data Analytics Platform.",
    "version": "13.6.0"
  },
  "servers": [
    {
      "url": "http://api.net2grid.docker",
      "description": "API server"
    }
  ],
  "paths": {
    "/v2/plug/relay": {
      "put": {
        "tags": [
          "Device Management"
        ],
        "summary": "/plug/relay",
        "description": "This endpoint controls the relay button of the Smart Plug. It is applicable only to gateways\n     with Smart Plug functionality like SPLR4911. These devices can measure and/or control the load of an appliance\n     that is directly connected to it's integrated schuko socket",
        "operationId": "v2putPlugRelay",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlugRelayRequestDTO"
              },
              "examples": {
                "PutPlugRelayRequest": {
                  "$ref": "#/components/examples/PutPlugRelayRequest"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponseDTO"
                },
                "examples": {
                  "OkResponse": {
                    "$ref": "#/components/examples/OkResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid Request <br/>153: No valid meter found for user.\n     <br/>271: Unable to perform switch.<br/>999: Unspecified error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "PlugRelayRequestDTO": {
        "required": [
          "on_off"
        ],
        "properties": {
          "on_off": {
            "description": "On-off value of relay. 0 sets the relay state to Off, 1 sets the relay state to On, 2 toggles the relay state.",
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ]
          }
        },
        "type": "object"
      },
      "ErrorDTO": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponseDTO": {
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDTO"
          }
        },
        "type": "object"
      },
      "OkResponseDTO": {
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "examples": {
      "OkResponse": {
        "summary": "Success response",
        "value": {
          "status": "ok",
          "message": "ok"
        }
      },
      "PutPlugRelayRequest": {
        "summary": "Request body",
        "value": {
          "on_off": 1
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "bearerFormat": "JWT",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Device Management",
      "description": "Device Management"
    }
  ],
  "x-explorer-enabled": false
}
```