Idempotence
Networks fail. When a request times out you can’t tell whether Ivy received it, so your client needs a way to repeat it safely. Two operations that start long-running work take an ID of your own for this, and file changes can be made conditional.
Ivy has no general Idempotency-Key header. Reads (GET) are always safe to repeat.
Sending a message: client_message_id
sendAgentMessage (POST …/conversations/{conversation_id}/messages) takes an optional client_message_id in its body: 1 to 128 letters, digits, - or _, unique per conversation, for example a UUID.
{ "text": "Summarise last week’s support tickets", "client_message_id": "7d0c9a52-…" }
When you send the same client_message_id to the same conversation again, Ivy doesn’t store a second message or start a second run. It streams the run that the first request started instead, from the beginning. Add a Last-Event-ID header with the ID of the last event you processed to get only the events after it.
Starting a code run: client_run_id
startCodeRun (POST …/files/{file_id}/runs) requires a client_run_id: 1 to 128 characters of your choice.
{ "client_run_id": "nightly-report-2026-11-05" }
Repeating the request with the same client_run_id answers 202 with the same run_id and starts nothing new. The ID is scoped to the caller: two service identities can use the same value without affecting each other.
Ivy remembers both IDs for as long as it keeps the run’s record, 30 days by default.
Changing files: If-Match
Updating, moving, trashing and uploading new versions of files and folders accept an If-Match header with the version you last saw: the "r{revision}" ETag for renames, moves and trashing, the "{version_id}" content ETag for new versions and restores. If something changed in between, including your own earlier attempt, Ivy answers 412 instead of applying the change twice. Read the resource again and decide.
Everything else
Other writes have no idempotency key. Before repeating one after a timeout, read the current state first: for example, list the folder before uploading the same file again. An upload whose name is taken answers 409 with name_taken and the existing file’s ID in details.existing_id.