The most popular option for these kind of tasks would be the Confluence CLI plugin, although you can also just do it directly through the REST API if you'd prefer but the CLI plugin makes the process much easier to complete. You can see some examples for using the CLI plugin here: https://bobswift.atlassian.net/wiki/display/CSOAP/Examples
All the best,
Hey Austin! Come join us for our 2019 Atlassian Community Summer BASH as we transition ourselves into party status! Bring an attachment, log a great time, and collaborate with new friends as we celeb...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events