An asynchronous API endpoint should give clients a way to identify and track the resource being created. Returning 202 Accepted with an empty response body makes that difficult: the server has accepted the work, but the client has no resource ID to use for subsequent requests.
That was the problem with GitLab's release evidence collection endpoint:
POST /projects/:id/releases/:tag_name/evidence
In GitLab MR !268983 , addressing issue #214819 , I worked on returning the newly created release evidence ID immediately while keeping the asynchronous workflow compatible with existing Sidekiq jobs and multi-node deployments.
The interesting part was not simply returning an ID. It was making the lifecycle of an asynchronously created database record safe across retries, deployments, and existing query paths.
The Problem: Accepted Work Without a Resource Handle
An endpoint that schedules background processing commonly returns HTTP 202 Accepted .…