Preconditions
A job can be edited from two places at once: two browser tabs, two recruiters, or a recruiter and Lisa. To stop one save from silently undoing the other, a resource that can be edited this way has an entity tag. It changes whenever the resource does.
- Read the resource. Its tag is in the
etagfield and theETagheader. - Send the tag back as
If-Matchwhen you save. - If the resource changed since you read it, the save fails with
412 PRECONDITION_FAILEDand nothing is written. Read it again, apply your change to the new version, and save with the new tag.
GET /v1/jobs/8724 ETag: "147ba147e9ffb1a2a544a755914219e7" PUT /v1/jobs/8724 If-Match: "147ba147e9ffb1a2a544a755914219e7"
Which resources have tags
- A job (
GETandPUT /v1/jobs/{jobId}). The tag covers every field a save can write, except the LinkedIn title, seniority, industries and functions, which Alfa fills in after a save when they are empty. - A job's screening criteria (
/v1/jobs/{jobId}/screening). Its tag covers the skills, screening rules and screening lists only, and a job also reports it asscreening_etag.
If-Match is optional: a save without it is applied as before. Weak tags (W/"…") never match, and * matches any version.
