I am designing an API that some operations may take a while, for example, creating a backup (not the actual case).
I am planning to have an endpoint to query the current job
http GET /api/v1/jobs/{uuid}
{
"code": 1,
"status": "created",
"running": true,
"completed": false
}
To create a new task, the client should do a POST which will return an empty response
http POST /api/v1/backups
I am planning to return a header Location
pointing to the current job uuid
Is it okay to a RESTful API? More specifically, should a 201 response to a POST request contain a body?