Create a design
Creates a new Magic Patterns design.
Behavior depends on the request:
- With
prompt: kicks off AI generation in the background. The response returns immediately witheditorId; pollGET /v3/designs/{editorId}/statusuntilisGeneratingisfalse. Generation typically takes 2–10 minutes. - Without
prompt: creates a blank design with scaffold files (App.tsx, index.tsx, index.css, tailwind.config.js) and returns immediately. - With
templateId: forks an existing design first, then optionally applies the prompt to the fork.
Generation calls bill credits from the authenticated user’s normal credit balance.
Authorizations
Magic Patterns API key. The same key authenticates v3 REST and the MCP server. Create one at https://www.magicpatterns.com/settings/api-keys.
Body
Optional name for the design. Defaults to "Untitled".
"Onboarding flow"
Optional natural-language prompt. If supplied, AI generation runs
in the background and the caller must poll
GET /v3/designs/{editorId}/status. If omitted, a blank design
with scaffold files is created instantly.
"A login page with social sign-in."
Optional image URLs to use as visual references (only used with prompt).
Optional ID of the design system to use. Discover IDs via GET /v3/design-systems.
Optional design system name (e.g. "Shadcn"). Resolved case-insensitively. designSystemId takes precedence if both are provided.
Optional editor ID of an existing design to use as a template. The design is forked first, then any prompt is applied to the fork.
Response
Design created. If generation is in flight, poll status.
"abc123"
"https://www.magicpatterns.com/c/abc123"
Live preview URL. Only populated once the first artifact has been compiled.
"https://project-onboarding-flow.magicpatterns.app"
The artifact created at design-creation time. Null until the first artifact is ready.
File names in the active artifact. Empty while generation is still running.