GET
/
pattern
/
{patternId}
/
generation
/
{snapshotIndex}
/
{generationId}
curl --request GET \
  --url https://api.magicpatterns.com/api/pattern/{patternId}/generation/{snapshotIndex}/{generationId} \
  --header 'x-mp-api-key: <api-key>'
{
  "id": "<string>",
  "status": "NOT_STARTED",
  "type": "NEW",
  "sourceCode": "<string>",
  "error": "<string>",
  "previewJob": {
    "url": "<string>",
    "status": "NOT_STARTED"
  }
}

Authorizations

x-mp-api-key
string
header
required

Path Parameters

patternId
string
required

The unique ID of the pattern.

snapshotIndex
integer
required

The index of the snapshot in the pattern's history.

generationId
string
required

The unique ID of the generation.

Response

200
application/json
Successfully retrieved the generation.
id
string

Unique identifier for the generation.

status
enum<string>

Status of the generation process.

Available options:
NOT_STARTED,
GENERATING,
ERROR,
COMPLETE
type
enum<string>

Type of generation.

Available options:
NEW,
UPDATE
sourceCode
string

Final code.

error
string | null

Error message if the generation failed.

previewJob
object