---
title: "ValueWrite"
method: POST
path: "/v2/write"
tags: ["General"]
---

# ValueWrite

`POST /v2/write`

Write the value of a variable node. This uses the service detailed in <a href="https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.4"> the relevant section of the OPC UA reference specification</a>.

## Request body

- ValueWriteRequestModelRequestEnvelope — Wraps a request and a connection to bind to a body more easily for api that requires a connection endpoint
  - `connection` ConnectionModel, required — Connection model
    - `endpoint` EndpointModel — Endpoint model
      - `url` string — Endpoint url to use to connect with
      - `alternativeUrls` string[] — Alternative endpoint urls that can be used for accessing and validating the server
      - `securityMode` 'Best' | 'Sign' | 'SignAndEncrypt' | 'None', int32 — Security mode of endpoint
      - `securityPolicy` string — Security policy uri to use for communication. default to best.
      - `certificate` string — Endpoint certificate thumbprint
    - `user` CredentialModel — Credential model
      - `type` 'None' | 'UserName' | 'X509Certificate' | 'JwtToken', int32 — Type of credentials to use for authentication
      - `value` unknown
    - `diagnostics` DiagnosticsModel — Diagnostics configuration
      - `level` 'None' | 'Status' | 'Information' | 'Debug' | 'Verbose', int32 — Level of diagnostics requested in responses
      - `auditId` string — Client audit log entry. (default: client generated)
      - `timeStamp` string, date-time — Timestamp of request. (default: client generated)
    - `group` string — Connection group allows splitting connections per purpose.
  - `request` ValueWriteRequestModel, required — Value write request model
    - `nodeId` string — Node id to write value to.
    - `browsePath` string[] — An optional path from NodeId instance to the actual node.
    - `value` unknown, required
    - `dataType` string — A built in datatype for the value. This can be a data type from browse, or a built in type. (default: best effort)
    - `indexRange` string — Index range to write
    - `header` RequestHeaderModel — Request header model
      - `elevation` CredentialModel — Credential model
        - `type` 'None' | 'UserName' | 'X509Certificate' | 'JwtToken', int32 — Type of credentials to use for authentication
        - `value` unknown
      - `locales` string[] — Optional list of locales in preference order.
      - `diagnostics` DiagnosticsModel — Diagnostics configuration
        - `level` 'None' | 'Status' | 'Information' | 'Debug' | 'Verbose', int32 — Level of diagnostics requested in responses
        - `auditId` string — Client audit log entry. (default: client generated)
        - `timeStamp` string, date-time — Timestamp of request. (default: client generated)

## Response `200`

Success

- ValueWriteResponseModel — Value write response model
  - `errorInfo` ServiceResultModel — Service result
    - `statusCode` integer — Error code - if null operation succeeded.
    - `errorMessage` string — Error message in case of error or null.
    - `symbolicId` string — Symbolic identifier
    - `locale` string — Locale of the error message
    - `additionalInfo` string — Additional information if available
    - `namespaceUri` string — Namespace uri
    - `inner` ServiceResultModel — recursive

## Changes

- **2023-06-12** `d4f4e58029fb` — 2 info
  - api tag `General` added
  - api tag `TwinMethods` removed
- **2023-05-02** `e285a38b6ca1` — 5 info
  - api tag `TwinMethods` added
  - api tag `General` removed
  - removed the non-success response with the status `400`
  - removed the non-success response with the status `408`
  - …1 more

[Change history](https://skmtc.dev/azure/apis/opcpublisher/changes/v2/write/post.md)

---

[API](https://skmtc.dev/azure/apis/opcpublisher.md) · [All operations](https://skmtc.dev/azure/apis/opcpublisher/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/opcpublisher/revisions/d4f4e58029fb/schema)
