Push the pilot's flight totals
Sends the logbook’s current totals for the pilot of a grant that holds hours.write: per aircraft type, in the logbook’s own categories and in minutes, and the simulator sessions per device class. It is a whole state, not a delta. MyPilotIndex applies its own aviation rules (SPIC is PIC time, PICUS has its own column, a turboshaft helicopter counts in the helicopter turbine columns and not in airplane turbine, and simulator time never counts as flight time), raises each of the pilot’s hour columns to the logbook’s value when it is higher and never lowers one, raises the hours in type of the type ratings he holds, and recomputes his MPI Score when anything moved. A type’s category is read only when the MyPilotIndex aircraft catalog does not resolve the type, and such a type adds to no engine-type column (jet, turboprop, turbine): a helicopter counts in the helicopter columns and in no engine column; an airplane counts in the airplane total and follows multi_engine in the engine-count columns (single engine, multi engine, PIC multi engine); a glider, balloon, airship, gyroplane or powered lift adds to total time and its role columns only, never to an engine-count column. A type the catalog resolves follows the catalog, whatever its category says. The push carries at least one types row or one simulator row (a logbook of simulator sessions only sends types as an empty array). The grant keeps only aggregates of the push (the resulting columns and counts), never a type designator or a row. as_of is required and names the instant of the logbook’s state; it may not be more than 5 minutes past the server’s clock, and it is compared to the microsecond. Sending the same as_of and body again (a retry after a lost answer) answers 200 and applies nothing while that push is still the grant’s last accepted push; after a newer push the same retry is 409 stale_totals. A retry is recognized by its as_of and by the totals it sums to, not by its bytes: two different bodies sent with one as_of that sum to the same totals are treated as the same push, and the second applies nothing. A push whose as_of is older than the grant’s last accepted push is 409 stale_totals; one accepted push per grant per 15 minutes, otherwise 429 push_throttled with Retry-After. 422 hours_rule when the totals, merged with the pilot’s record, would break his hours rules (for example a figure above 99,999.9 hours): nothing is applied. Every call counts toward the daily allowance. Pushes take no Idempotency-Key. A grant that is revoked, unknown or another partner grant answers 404 not_found; a grant, or a token, without hours.write is 403 scope_missing.
Authorizations
OAuth 2.0 client credentials. Request a token from the token endpoint of the identity provider's domain (https://{cognito-domain}/oauth2/token, with HTTP Basic client authentication) and send it as a Bearer token. Production uses auth.mypilotindex.com. The sandbox uses the dev environment's Cognito domain, which is given to the partner with its sandbox credential. A token carries only the scopes the partner was approved for.
Path Parameters
Body
Maximum 262144 bytes (256 KiB). Unknown or repeated members are rejected at every level.
The instant of the logbook's state (RFC 3339). Not more than 5 minutes past the server's clock; compared to the microsecond.
One row per aircraft type the logbook knows, each type once. It may be empty for a logbook of simulator sessions only: a push carries at least one types row or one simulator row (400 invalid_request otherwise).
500Informative; the authority whose rules the logbook keeps. Not stored.
FAA, EASA, ANAC, TCCA, CASA, other Sessions in a flight simulation training device, one row per device class. Kept apart from flight time.
5Response
What the push did. A retry of the last accepted push, and a push that brings nothing new, answer applied 0 and score_requested false.
How many of the pilot's figures the push raised: hour columns, and hours in type of the type ratings he holds.
x >= 0How many hour columns of the push the pilot's record already held at or above it.
x >= 0The hour columns left out, sorted, because within the push a column was larger than its parent (for example PIC above total time); its children are left out with it.
Whether the pilot's MPI Score is recomputed; true exactly when applied is above zero.

