Programatically create page then obtain UUID?

Can I programatically create a page and then obtain the UUID immediately after by perhaps assigning the created page to a variable?

Thanks

yes