How to return generated ID in RESTful POST? January 1, 2024 by Tarik Return the status code 201 – Created, and put the URL in the Location header. You don’t need to return a body at all.