{"openapi":"3.1.0","info":{"title":"Miles trips API","version":"1.0.0","description":"Turn a trip into a Miles animated map video. Stateless: nothing is stored; the trip lives in the returned links. Read-only, no sign-in. Only include travel the user actually took."},"servers":[{"url":"https://createmiles.com"}],"components":{"schemas":{"VideoJob":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","rendering","done","failed"]},"progress":{"type":"number"},"etaSeconds":{"type":"number"},"videoUrl":{"type":"string","description":"The MP4, once status is done"},"statusUrl":{"type":"string"},"shareUrl":{"type":"string"}}}}},"paths":{"/api/videos":{"post":{"operationId":"renderVideo","summary":"Render the trip as an MP4 on the server","description":"Starts (or reuses) a render. Poll statusUrl until status is done, then share videoUrl. 720p, 30 fps.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["query"],"properties":{"query":{"type":"string","description":"Query string of a Miles share link"}}},{"type":"object","required":["legs"],"properties":{"title":{"type":"string"},"legs":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"Airport code (DEL), city name (Agra, \"London, GB\") or city id"},"to":{"type":"string","description":"Airport code, city name or city id"},"mode":{"type":"string","description":"flight, train, car, bus or ferry (taxi and uber count as car). Defaults to flight."},"date":{"type":"string","format":"date","description":"Departure date, YYYY-MM-DD"}}}}}}]}}}},"responses":{"200":{"description":"Already rendered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJob"}}}},"202":{"description":"Rendering","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJob"}}}},"429":{"description":"Renderer busy or hourly limit reached"}}}},"/api/videos/{id}":{"get":{"operationId":"getVideoStatus","summary":"Check a render","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJob"}}}},"404":{"description":"Unknown or expired"}}}},"/api/trips":{"post":{"operationId":"createTrip","summary":"Create a trip video from journeys in travel order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["legs"],"properties":{"title":{"type":"string","maxLength":80},"subtitle":{"type":"string","maxLength":120},"look":{"type":"string","enum":["midnight","paper","mono","atlas","fiord","neon"],"description":"midnight, paper and mono are free"},"format":{"type":"string","enum":["9:16","4:5","1:1","16:9"]},"units":{"type":"string","enum":["km","mi"]},"pace":{"type":"string","enum":["relaxed","normal","quick"]},"legs":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"Airport code (DEL), city name (Agra, \"London, GB\") or city id"},"to":{"type":"string","description":"Airport code, city name or city id"},"mode":{"type":"string","description":"flight, train, car, bus or ferry (taxi and uber count as car). Defaults to flight."},"date":{"type":"string","format":"date","description":"Departure date, YYYY-MM-DD"}}}}}}}}},"responses":{"200":{"description":"Links to watch, edit and export the trip, plus a preview image","content":{"application/json":{"schema":{"type":"object","properties":{"editUrl":{"type":"string","description":"Open to edit and export the video"},"shareUrl":{"type":"string","description":"Watch-only page"},"previewImage":{"type":"string"},"trip":{"type":"object"},"unresolved":{"type":"array","items":{"type":"string"},"description":"Stops that couldn't be matched; their journeys were left out"}}}}}},"400":{"description":"Invalid trip"},"422":{"description":"No legs could be matched to places"}}}}}}