idempotencyKey is an optional caller-supplied string that makes a submission
deduplicating. Send the same key twice and the second submission resolves to the task the
first one created rather than queuing new work.
Single and batch differ on purpose
This is the one place the two endpoints diverge, and it trips people up.results[i].task you get back is the existing task, so your task mapping still resolves.
Matching results back to submissions
Two independent handles, and you want both:integer
Positionally 1:1 with your input array. Use it to correlate the batch response with the
tasks you sent.
string
Echoed back verbatim. Use it to correlate the webhook — which arrives minutes later,
out of order, with no reference to your original array.
If you did not supply an
idempotencyKey, the field is omitted from the task object
rather than returned as null. Internally the task falls back to its own uuid as a key,
which is unique by construction and therefore never dedupes.