Menu

Idempotency

How a retry after a lost answer is made safe, for every operation that spends credits.

When an answer is lost (a dropped connection, a timeout), retrying must not create or charge something twice. Every operation that spends credits says how a retry is made safe, in x-weird-idempotency:

  • header: send the Idempotency-Key header, 1 to 255 printable ASCII characters naming this operation. Repeating the request with the same key, on the same route and within 24 hours, answers the first answer again with the header idempotent-replay: true; it is not performed or charged a second time. A malformed key, or one used for a different request, is refused 400 invalid-params.
  • body: a field of the body (named in field, required or not) does the same.
  • natural: a repeat is refused or changes nothing, for the reason given.
  • none: a repeat makes a second one; bills says whether it costs.

Make the key once per intended action and reuse it on every retry of that action. The weird command line does this for you, and --idempotency-key lets a script choose the key of a charged create.

OperationRetry safety
POST /abuse/reportsa repeat makes a second one (it costs nothing): a repeat files a second report with its own reference (nothing is charged); keep the first reference rather than sending again
POST /auth/account/exporta repeat is refused or changes nothing: one copy a day: a repeat within a day answers the copy already asked for (200), or 429 rate-limited once it is gone
POST /credits/withdrawalsa repeat is refused or changes nothing: a top-up is withdrawn from once: a repeat answers the withdrawal already made (200) and refunds nothing twice
GET /dns/eventsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /dns/zonesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /dns/zonessend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /dns/zones/{origin}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
DELETE /dns/zones/{origin}send the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /dns/zones/{origin}/dnsseca repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /dns/zones/{origin}/exporta repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
PUT /dns/zones/{origin}/importsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /dns/zones/{origin}/migrationa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /dns/zones/{origin}/recordssend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
DELETE /dns/zones/{origin}/records/{name}send the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /dns/zones/{origin}/resyncsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /dns/zones/{origin}/resynca repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /dns/zones/{origin}/resync/applysend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /dns/zones/{origin}/seedsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /dns/zones/{origin}/snapshotssend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /dns/zones/{origin}/snapshotsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /dns/zones/{origin}/snapshots/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /domainsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /domainssend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /domains/availabilitya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /domains/{domain}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /domains/{domain}/grantsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /domains/{domain}/hostingsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /domains/{domain}/renewsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /domains/{domain}/tradea repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /domains/{domain}/tradesend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /domains/{domain}/transfersend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /ipfs/cid/{cid}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/contenta repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/content/{cid}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/content/{cid}/copiesa repeat is refused or changes nothing: the same copy count as now changes nothing (state unchanged, or raising/lowering while the first change is under way)
GET /ipfs/domainsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/domainssend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
DELETE /ipfs/domains/{id}send the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /ipfs/domains/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/domains/{id}/pinsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/domains/{id}/pinsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/domains/{id}/retargetsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
POST /ipfs/domains/{id}/stats/detailsend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /ipfs/grantsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/grantsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/namesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/namesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/names/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
PUT /ipfs/names/{id}/targeta repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/path-mapsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/path-mapsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/path-maps/{id}/desireda repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/pinsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/pinsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/pins/{requestid}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/detaila repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/exporta repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/pathsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/settingsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/subjectsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/summarya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/stats/todaya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/storage/enablea repeat is refused or changes nothing: storage is enabled once per account: a repeat answers the same state with charged false and charges nothing
GET /ipfs/storage/location-noticea repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /ipfs/uploadssend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /ipfs/uploadsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/uploads/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /ipfs/usagea repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /namesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /namessend the Idempotency-Key header: a repeat with the same key answers the first answer and is not performed or charged again
GET /names/basesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /names/checka repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /names/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /p2p/appsa repeat is refused or changes nothing: an app name is unique: a repeat is refused 409 conflict (the name is taken)
GET /p2p/appsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /p2p/apps/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /p2p/apps/{id}/domainsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /tunnelsa repeat is refused or changes nothing: a hostname has at most one live tunnel: a repeat is refused 409 hostname-taken
GET /tunnelsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /tunnels/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/actions/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/activitya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/appsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/apps/deploymentsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /vps/apps/deploymentsthe body field idempotency_key (required) makes a repeat safe
GET /vps/apps/deployments/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/availabilitya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/chargesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/instancesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /vps/instancesthe body field idempotency_key (required) makes a repeat safe
GET /vps/instances/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/instances/{id}/actionsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/instances/{id}/domainsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/instances/{id}/metricsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /vps/instances/{id}/resizea repeat is refused or changes nothing: a repeat is refused: 409 busy while the first resize runs, then 400 invalid-params (field tier_id: the instance is of this tier already)
POST /vps/instances/{id}/snapshotsthe body field idempotency_key (required) makes a repeat safe
GET /vps/limitsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/snapshotsa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/ssh-keysa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/ssh-keys/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/system-imagesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/tiersa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/transfersa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
GET /vps/volumesa repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /vps/volumesthe body field idempotency_key (required) makes a repeat safe
GET /vps/volumes/{id}a repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again
POST /vps/volumes/{id}/resizea repeat is refused or changes nothing: a repeat is refused: 409 busy while the first growth runs, then 400 invalid-params (field size_gb: a volume only grows)