Use long polling. Add wait (0 to 30 seconds) to GET /v1/jobs/{id}. The API holds the request open until the job finishes or the wait ends, then returns the job as it is.
The service keeps a finished job for 5 minutes. After that, GET /v1/jobs/{id} returns 404 with JOB_NOT_FOUND. Read the token before then.Jobs are kept in memory. If the service restarts, it loses the jobs that it holds. A job that is still queued when the service stops fails with SHUTTING_DOWN. Submit it again.
GET /v1/jobs returns the jobs that the service holds, newest first. Filter with status, and set limit (1 to 200, default 50). The list never includes tokens. To get a token, read the job by its ID.