Skip to main content

Set Configuration

Updates node configuration properties in the nxt.properties file. Changes take effect on node restart. Requires admin password. This is a POST-only endpoint.

Request

POST /nxt?requestType=setConfiguration&adminPassword=<adminPassword>&propertiesJSON=<array>&shutdown=<boolean>

Parameters

NameTypeRequiredDescription
propertiesJSONarray of objectsYesArray of property updates. Each object must contain property (string) and optionally value (string). Setting value to null removes the property.
shutdownbooleanNoIf true, the node will shut down after writing the configuration file. Defaults to false.
adminPasswordstringConditionalAdmin password required if nxt.adminPassword is set. If the node is configured without a password, this is not required.

propertiesJSON Object

[
{
"property": "nxt.apiServerPort",
"value": "22024"
},
{
"property": "nxt.adminPassword",
"value": null
}
]

Response

{
"shutdown": false
}

Response Fields

FieldTypeDescription
shutdownbooleanWhether the node was shut down after writing the configuration.

Error Responses

ConditionResponse
propertiesJSON missing{"error": "propertiesJSON", "errorDescription": "propertiesJSON is required"}
Invalid property value{"error": "value", "errorDescription": "Incorrect value for property <name>"}

Notes

  • This endpoint does not require the blockchain to be running (requireBlockchain = false).
  • Not chain-specific — affects global configuration only.
  • Requires admin password authentication (requirePassword = true).
  • Requires POST method (requirePost = true).
  • All property values are validated against ConfigParser.isValidPropertyValue() before writing.

Source: SetConfiguration.java.

Example

curl -X POST "http://localhost:22024/nxt" \
-d "requestType=setConfiguration" \
-d "adminPassword=mySecretPassword" \
-d 'propertiesJSON=[{"property":"nxt.apiServerPort","value":"22025"}]' \
-d "shutdown=false"