Authorizations
Body
multipart/form-data
Response
Successfully created a new design.
The response is of type object.
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=@example-file{
"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.
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=@example-file{
"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."
}
]
}Successfully created a new design.
The response is of type object.
Was this page helpful?