# Create trip from document Create a new trip from a document using AI. Supports URLs to documents (PDF, TXT, images) or plain text descriptions. The job runs asynchronously. Use the returned status URL to poll for completion. Supported source types: - url: URL to a document (PDF, TXT, JPG, PNG) - text: Plain text description or JSON object (will be stringified) - inline: Base64-encoded document with filename Endpoint: POST /ai/trips/from-document Version: 1.0.0 Security: bearerAuth ## Request fields (application/json): - `source` (any, required) - `isTemplate` (boolean) Create the trip as a template ## Response 202 fields (application/json): - `jobId` (string, required) Unique public identifier for the job Example: "1c2c38f3-e596-463e-9f62-75c7c3602770" - `status` (string, required) Enum: "processing" - `links` (object, required) - `links.publicUrl` (string, required) URL to the trip public page Example: "https://v2.app.moguplatform.com/ai/trip/public/1c2c38f3-e596-463e-9f62-75c7c3602770" - `links.builderUrl` (string, required) URL to the trip builder (requires authentication) Example: "https://v2.app.moguplatform.com/ai/trip/1c2c38f3-e596-463e-9f62-75c7c3602770" - `links.status` (string, required) API endpoint to check job status Example: "https://trips.api.moguplatform.com/ai/trips/1c2c38f3-e596-463e-9f62-75c7c3602770/status" - `links.cancel` (string, required) API endpoint to cancel the job Example: "https://trips.api.moguplatform.com/ai/trips/1c2c38f3-e596-463e-9f62-75c7c3602770/actions/cancel" ## Response 400 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code Enum: "invalid_source", "invalid_url", "unsupported_format", "job_not_cancelable", "missing_api_key", "invalid_api_key", "job_not_found" - `error.message` (string, required) Human readable error message Example: "Source configuration is invalid" ## Response 401 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code Enum: "invalid_source", "invalid_url", "unsupported_format", "job_not_cancelable", "missing_api_key", "invalid_api_key", "job_not_found" - `error.message` (string, required) Human readable error message Example: "Source configuration is invalid"