Overview
These examples show how to interact with Scriptonia’s APIs during a typical workflow: Idea → Intent → Platform → Payment → Execution → Completion. Requests are shown usingfetch and curl. Adjust headers, body, and URLs based on your environment.
Common Patterns
- All APIs are JSON-based.
- sessionId is required to associate requests with a workflow.
- Most APIs are POST.
- Errors are returned as
{ error }with an HTTP status code. - Successful responses include
{ status: 'success', ... }.
Create / Update Workflow Context
Start or update workflow session
POST/api/workflow
Idea
Submit an idea
POST/api/idea
- analysis
- clarifyingQuestions
Intent
Submit intent answers
POST/api/intent
- refinedRequirements
- features
- audience
- techNotes
Platform
Select platform
POST/api/platform
- platformOptions
- cost
- timeline
Payment
Create checkout (card)
POST/api/dodo/create-checkout
- checkout_url
Confirm payment (optional)
POST/api/dodo/confirm-payment
Execute
Run execution
POST/api/execute
- Loads workflow
- Validates payment
- Runs execution agents
- Generates ZIP output
Completion
Fetch completion summary
GET/api/completion?sessionId=example-session-1
- summary
- downloadUrl
- project metadata
Error Handling
Common errors:- Missing sessionId
- Invalid workflow stage
- Payment not completed
- Execution already run
Notes
- Run APIs in order: Idea → Intent → Platform → Payment → Execute.
- Execution requires refinedRequirements to exist.
- Payment APIs may be skipped in test environments depending on configuration.