Adding configuration items using the API

I cant seem to find anyting in the documentation about adding configuration items to an assett.
Is it not possible?

If not, it seems little weird, as I guess the access restricted write configuration item need to bed added and checked?

How else would I go about setting up REALM + Asset + attribute + config item fully programatically?

Hi!

I cant seem to find anyting in the documentation about adding configuration items to an assett.
Is it not possible?

In the Manager UI, you can add configuration items on the Assets page,
by configuring the attributes as found here.
.

If not, it seems little weird, as I guess the access restricted write configuration item need to bed added and checked?

Access restricted write is used to grant “restricted users” WRITE access to an attribute.
More information on how this works can be found here in our documentation.
So yes, it needs to be added and enabled before it is applied.
.

How else would I go about setting up REALM + Asset + attribute + config item fully programatically?

To create a new asset using the HTTP API, that includes configuration items,
you can use this POST endpoint: Create an asset | OpenRemote Documentation.
For updating an you can use PUT with Update an asset | OpenRemote Documentation

The documentation on the attributes payload is a bit unclear, so this below might help.
Example payload of Create asset (March 2025):

{
  "id" : "5VCQDJ5VripCKK3BkuHQLQ",
  "version" : 0,
  "createdOn" : 1743065652421,
  "name" : "New Asset",
  "accessPublicRead" : false,
  "realm" : "master",
  "type" : "<asset type>",
  "path" : [ "5VCQDJ5VripCKK3BkuHQLQ" ],
  "attributes" : {
    "myCustomAttribute" : {
      "name" : "myCustomAttribute",
      "type" : "number",
      "meta" : {
        "ruleState" : true,
        "accessRestrictedRead" : true,
        "storeDataPoints" : true,
        "readOnly" : true
      },
      "value" : null,
      "timestamp" : 1743065652416
    }
    // all other attributes should also be added here.
  }
}

No I need a way to automatically, using the API, add the configuration items.
So I dont have to go in and manyally click on RESTRECITED WRITE and STORE DATAPOINT on each and every attribute.

configuration items