cURL
curl --request POST \ --url https://api.magicpatterns.com/api/v2/pattern \ --header 'Content-Type: multipart/form-data' \ --header 'x-mp-api-key: <api-key>' \ --form mode=fast \ --form 'prompt=Create a login page' \ --form presetId=html-tailwind \ --form 'images=[ null ]'
{ "id": "abc123", "sourceFiles": [ { "id": "<string>", "name": "<string>", "code": "<string>", "type": "javascript" } ], "compiledFiles": [ { "id": "<string>", "fileName": "<string>", "hostedUrl": "<string>", "type": "javascript" } ], "editorUrl": "https://www.magicpatterns.com/c/abc123", "previewUrl": "https://abc123-preview.magicpatterns.app", "chatMessages": [ { "role": "assistant", "content": "I will create a login page with a centered layout." } ] }
Creates a new design based on the provided prompt and optional images. This version supports both default and custom preset configurations.
Successfully created a new design.
The response is of type object.
object
Was this page helpful?