Use action=set to add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to specify the location of the object in the configuration.
For example, if you are adding a new rule to the security rulebase, the xpath-value would be:
/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security
Use the element parameter to specify a value for the object you are adding or creating using its XML representation (as seen in the output of action=show ).
Set Configuration
Create a new rule called rule1 in the security policy: https://firewall/api/?type=config&action=set&key=keyvalue&xpath=xpath-value&element=element-value where the xpath-value is: /config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1'] and the element-value is: <source><member>src</member></source><destination><member>dst</member></destination><service><member>service</member></service><application><member>application</member></application><action>action</action><source-user><member>src-user</member></source-user><option><disable-server-response-inspection>yes-or-no</disable-server-response-inspection></option><negate-source>yes-or-no</negate-source><negate-destination>yes-or-no</negate-destination><disabled>yes-or-no</disabled><log-start>yes-or-no</log-start><log-end>yes-or-no</log-end><description>description</description><from><member>src-zone</member></from><to><member>dst-zone</member></to>
Use the response from the config show API request to create the XML body for the element. https://firewall/api/?type=config&action=show
To add an additional member to a group/list, include the 'list' node in the xpath using the member[text()='name'] syntax and include the members in the element parameter. For example, to add an additional static address object named abc to an address group named test, use: https://firewall/api/?type=config&action=set&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/address-group/entry[@name='test']&element=<static><member>abc</member></static>

Related Documentation