# ai AI-powered trip generation from documents and text ## Create trip from document - [POST /ai/trips/from-document](https://api-docs.moguplatform.com/openapi/ai/createtripfromdocument.md): 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 ## Get job status - [GET /ai/trips/{publicId}/status](https://api-docs.moguplatform.com/openapi/ai/getjobstatus.md): Get the current status of a trip creation job. This endpoint is public and does not require authentication. Status values: - processing: Job is still running - completed: Trip has been created successfully - error: Job failed with an error - canceled: Job was canceled Stage values (during processing): - initializing: Starting the job - extractingText: Extracting text from the document - generatingBlocks: Generating trip structure with AI - enrichingBlocks: Enriching blocks with real-world data (flights, places, images) - completed: Processing finished When status is completed, the publicUrl and builderUrl will point to the actual trip pages. ## Cancel job - [POST /ai/trips/{publicId}/actions/cancel](https://api-docs.moguplatform.com/openapi/ai/canceljob.md): Cancel a job that is still in progress. Only the agent who created the job can cancel it. Jobs can only be canceled while in processing status. Completed, errored, or already canceled jobs cannot be canceled.