The format of the JSON object depends on the configuration of the node you want to create but also the configuration of your master (i.e. version of core and plugins). There is a way to retrieve the JSON object corresponding to the desired configuration using the browser developer tool. For more information about the Browser developer tools can be found in the article Required Data: Rendering Problems or Loading Issues.

Different browser have different tools, most of them are similar and enable to capture the request body of HTTP requests which is what we want. Following is an example with Chrome:

Go to the Manage Jenkins > Manage Nodes page

Click on “New Node”, select “Permanent Agent”, give it a name and click on “OK”. You should now be on the node’s configuration page:

Configure the node with the values you want but DON’T SAVE YET!

Open the browser developer tools console with Right Click > Inspect

You should see the [developer console] appear:

Switch to the Network tab

Click the Clean button (second button at the top left of the Network tab)

Keep the console open and click on “Save” in Jenkins to save the form

You should see lots of requests appearing, one of them - the top one - is “doCreateItem”:

Click on the doCreateItem record (a panel should appear on the right)

In the right panel, ensure that you are on the “Headers” tab and scroll down to the bottom to access the Form Data section where you should see the field json.

This JSON is the format the the Jenkins instance is expecting. Attributes can be set accordingly.