{"openapi":"3.1.0","info":{"title":"Wingman REST API","version":"1.0.0","description":"The REST API behind the Wingman web and iOS apps. Everything it does is also available to AI assistants through the MCP server at https://mcp.flightwingman.com/mcp.","termsOfService":"https://flightwingman.com/terms","contact":{"name":"Wingman support","email":"support@flightwingman.com","url":"https://flightwingman.com/support"}},"servers":[{"url":"https://flightwingman.com/api/v1"}],"externalDocs":{"description":"Agent and auth guide","url":"https://flightwingman.com/auth.md"},"security":[{"oauth2":["read"]}],"paths":{"/auth/sign_up":{"post":{"summary":"Create an account","tags":["auth"],"parameters":[],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"},"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/sign_in":{"post":{"summary":"Sign in with email and password","tags":["auth"],"parameters":[],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/apple":{"post":{"summary":"Sign in with Apple","tags":["auth"],"parameters":[],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identity_token","nonce"],"properties":{"identity_token":{"type":"string"},"authorization_code":{"type":"string"},"nonce":{"type":"string"},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/google":{"post":{"summary":"Sign in with Google","tags":["auth"],"parameters":[],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id_token"],"properties":{"id_token":{"type":"string"},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/sign_out":{"delete":{"summary":"Sign out and revoke the current token","tags":["auth"],"parameters":[],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/me":{"get":{"summary":"Get the current user","tags":["account"],"parameters":[],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"patch":{"summary":"Update profile and preferences","tags":["account"],"parameters":[],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"timezone":{"type":"string"},"favorite_airports":{"type":"array","items":{"type":"string"}},"buffer_domestic_minutes":{"type":"integer"},"buffer_international_minutes":{"type":"integer"},"marketing_emails":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"summary":"Delete the account and all data","tags":["account"],"parameters":[],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights":{"get":{"summary":"List flights","tags":["flights"],"parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["upcoming","past"],"default":"upcoming"}}],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"summary":"Add a flight by number and date","tags":["flights"],"parameters":[],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"flight":{"type":"string","examples":["BA117"]},"date":{"type":"string","format":"date"},"carrier_code":{"type":"string"},"flight_number":{"type":"string"}},"required":["date"]}}}},"responses":{"201":{"description":"Flight added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/import":{"post":{"summary":"Add flights from pasted booking text","tags":["flights"],"parameters":[],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}},"errors":{"type":"array","items":{"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/{id}":{"get":{"summary":"Get a flight with its event timeline","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"patch":{"summary":"Update seat, confirmation code or notes","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seat":{"type":"string"},"confirmation_code":{"type":"string"},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"summary":"Remove a flight","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/{id}/refresh":{"post":{"summary":"Refresh live status (rate limited)","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/{id}/share/rotate":{"post":{"summary":"Replace the public share link","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flight"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/{id}/extras":{"get":{"summary":"WiFi, lounges, security wait, seat map, airport status and connection info","tags":["flights"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^flt_"},"description":"Flight public id (flt_...)."}],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/airports":{"get":{"summary":"Search airports by IATA code, city, name or country","tags":["airports"],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Airport"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/stats":{"get":{"summary":"Flying statistics","tags":["account"],"parameters":[{"name":"year","in":"query","schema":{"type":"string"}}],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/push_tokens":{"post":{"summary":"Register a push token","tags":["account"],"parameters":[],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"platform":{"type":"string","default":"ios"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/connections":{"get":{"summary":"List connected AI apps","tags":["account"],"parameters":[],"security":[{"oauth2":["read"]},{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/connections/{id}":{"delete":{"summary":"Revoke a connected AI app","tags":["account"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["write"]},{"bearerAuth":[]}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth 2.1 authorization code with PKCE (S256). Dynamic client registration at https://flightwingman.com/oauth/register.","flows":{"authorizationCode":{"authorizationUrl":"https://flightwingman.com/oauth/authorize","tokenUrl":"https://flightwingman.com/oauth/token","refreshUrl":"https://flightwingman.com/oauth/token","scopes":{"read":"Read flights, stats and profile.","write":"Add, change and remove flights and account settings."}}}},"bearerAuth":{"type":"http","scheme":"bearer","description":"A Wingman access token from the OAuth flow, or a first-party token from /auth/sign_in."}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"timezone":{"type":"string"},"provider":{"type":["string","null"]},"inbound_email":{"type":"string"},"calendar_url":{"type":"string"},"favorite_airports":{"type":"array","items":{"type":"string"}},"buffer_domestic_minutes":{"type":"integer"},"buffer_international_minutes":{"type":"integer"},"marketing_emails":{"type":"boolean"}}},"AuthResult":{"type":"object","properties":{"token":{"type":"string"},"user":{"$ref":"#/components/schemas/User"}}},"Airport":{"type":"object","properties":{"iata":{"type":"string"},"name":{"type":"string"},"city":{"type":"string"},"country_code":{"type":"string"},"country_name":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"tz":{"type":"string"}}},"Connection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"connected_at":{"type":"string","format":"date-time"}}},"Flight":{"type":"object","properties":{"id":{"type":"string","description":"Public id, flt_ prefix."},"flight":{"type":"string","examples":["BA117"]},"carrier_code":{"type":"string"},"flight_number":{"type":"string"},"date":{"type":"string","format":"date"},"origin":{"$ref":"#/components/schemas/Airport"},"destination":{"$ref":"#/components/schemas/Airport"},"status":{"type":"string","enum":["scheduled","active","landed","cancelled","diverted","unknown"]},"delay_minutes":{"type":["integer","null"]},"departure":{"type":"object","additionalProperties":true},"arrival":{"type":"object","additionalProperties":true},"aircraft":{"type":"object","additionalProperties":true},"inbound":{"type":["object","null"],"additionalProperties":true},"prediction":{"type":["object","null"],"additionalProperties":true},"leave_by":{"type":["string","null"],"format":"date-time"},"share_url":{"type":"string"},"seat":{"type":["string","null"]},"confirmation_code":{"type":["string","null"]},"notes":{"type":["string","null"]},"progress":{"type":"number","minimum":0,"maximum":1},"connection_risk":{"type":["object","null"],"additionalProperties":true},"events":{"type":"array","items":{"type":"object","additionalProperties":true}},"updated_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}