Idempotency-Key header. Each route is made safe to retry in its own way.
Flight totals
PUT /v1/partner/grants/{grant_id}/flight-totals sends a whole state, not a change, and as_of makes a retry safe:
as_ofis required. It names the instant of the logbook’s state, in RFC 3339, and is compared to the microsecond.- It may not be more than 5 minutes ahead of the server’s clock. A later
as_ofis refused with400 invalid_request. - Sending the same
as_ofand the same totals again, for example after a lost answer, answers200and applies nothing, while that push is still the grant’s last accepted push. - After a newer push has been accepted, the same retry answers
409 conflictwith reasonstale_totals. So does any push whoseas_ofis older than the last accepted one. Nothing is applied. Send the logbook’s current state. - A retry is recognized by its
as_ofand by the totals it sums to, not by its bytes: two different bodies sent with oneas_ofthat sum to the same totals are the same push.
200 even inside the window, an older as_of is 409 stale_totals, and only a new push inside the window answers 429 push_throttled.
MyPilotIndex raises each hour column to the logbook’s value when it is higher and never lowers one, so a repeated push cannot add time twice.
Code exchange
A code works once. Exchanging it again, after a lost answer, answers400 invalid_request with reason invalid_grant, as in OAuth. Restart the consent to get a new code.

