Idempotency
Two different mechanisms stop a retry from creating a second copy. They are not interchangeable.
External id
external_id is your identifier for a job or a worker profile.
For jobs it is unique inside the organisation. Creating a job again with the same id and the same payload returns the existing job with status 200. The same id with a different payload returns 409 and does not change the stored job. A blank id is stored as null, and those jobs are never collapsed together.
For workers, external_id is unique inside the integration. PUT /api/v1/external/workers creates the profile or updates the one that already has that id.
Source version
Upserts, job updates and cancellation require source_version, an integer of 1 or more. It is your revision, not AssignPoint's version field.
| Comparison with the stored source version | Result |
|---|---|
| Greater, and the payload changes something | The write is applied. version increments by one. |
| Equal, and the payload matches | 200 with the current record. version stays the same. |
| Equal, but the payload would change the record | 409. Nothing is written. |
| Lower | 409. Nothing is written. |
Cancellation is the exception to the equal-version rule. If the job is not cancelled yet, the same source_version returns 409, because cancelling would change it. Send a newer version to cancel. Repeating that version after the job is already cancelled returns 200.
Idempotency-Key
PUT and PATCH writes, and job cancellation, require this header. POST /api/v1/external/jobs accepts it and still deduplicates external_id when the header is absent.
The value is 1 to 255 characters from letters, digits and _ . : -. AssignPoint scopes it to the integration, the HTTP method and the path. A key used on create can be used again on update.
Within 72 hours, a repeat with the same body returns the stored response and does not run the write again. A stored 201 is replayed as 200. The stored body can therefore show the record from the earlier call, even if a later call has changed it.
The same key with a different body returns 409 and errors on Idempotency-Key. After 72 hours the stored response is discarded and the same key can run again.