Developers

Monstra API v1

Everything you do on the web screens — adding products and photos, generating and translating product pages, getting the results — your own program can do too. These docs are for the developer who builds it.

1.Getting started

Send every request under the base URL below, with the API key in an Authorization: Bearer mk_live_… header.

Base URL
https://<api-host>/api/v1

  • Request and response bodies are JSON with snake_case field names. Ids are integers; times are ISO 8601 strings in UTC (2026-10-09T05:00:00.000Z).
  • A failure answers {"error": "…", "code": "…"}. error is a sentence for people, in Korean, and may change: branch on code. Some errors add fields such as product_id, import_id or url at the same level.
  • Ignore response fields you do not know (see the versioning policy). An unknown field in a request is 400 validation_failed.
  • Use API keys from servers only. A request with an Origin header (a browser) is refused with 403 browser_not_allowed.
  • A key is accepted on /api/v1 and on the signed file URLs in responses (/api/files/…) only. Anywhere else it is 401 invalid_api_key.
Check your account (GET /me)
export MONSTRA_BASE="https://<api-host>/api/v1"
export MONSTRA_KEY="mk_live_…"          # from the "API keys & webhook" screen

curl -s "$MONSTRA_BASE/me" -H "Authorization: Bearer $MONSTRA_KEY"

2.Creating an API key

Log in and create a key on the "API keys & webhook" screen of the account menu. The full key is shown once, when it is created — Monstra stores only its hash and cannot show it again. If you lose it, create a new one and revoke the old one.

  • Format: mk_live_ + 64 hex characters (72 in all). The fixed prefix makes it easy to register with secret scanners or check a repository with grep -r mk_live_.
  • A key has the same rights as the account's web login, except payments, store connections and key and webhook settings, which are web-only.
  • A revoked key is 401 invalid_api_key at once. An account can have up to 10 active keys.
  • Up to 120 requests per minute per key, and 360 per minute for the whole account (all its keys plus v1 calls made with a web login token). Past either it is 429 rate_limited with Retry-After (seconds).
  • Responses that passed key authentication, and v1 responses to a login token, carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (unix seconds) of whichever window is closer to its limit; X-RateLimit-Scope (key or user) says which.
  • Failures with an unknown key are capped at 30 per minute per IP; past that, key requests from the IP are refused with 429 rate_limited for a while.
  • Credit balance, the daily generation limit and concurrent generations are shared with the web.
Open key management

3.End to end

Create a product, add photos from links, generate the product page and fetch its HTML. The examples use curl and jq.

  1. Create a product

    Put your own id in external_id to find the product by it later and never create it twice (409 external_id_taken + product_id). Every field may be left out.

    PRODUCT_ID=$(curl -s "$MONSTRA_BASE/products" \
      -H "Authorization: Bearer $MONSTRA_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: ali-1005001-create" \
      -d '{
        "title": "Ceramic mug 350 ml",
        "description": "Supplier text, in any language",
        "external_id": "ali-1005001",
        "languages": ["EN", "KO"]
      }' | jq -r .product.id)

  2. Add photos from links

    Up to 20 links per request. It answers 202 with an import job (import) at once and fetches the photos in the background. To upload files yourself, see the multipart example under Photos.

    IMPORT_ID=$(curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/images/from-urls" \
      -H "Authorization: Bearer $MONSTRA_KEY" \
      -H "Content-Type: application/json" \
      -d '{"urls": ["https://example.com/mug-1.jpg", "https://example.com/mug-2.jpg"]}' \
      | jq -r .import.id)

  3. Wait for the import

    It is done when status is completed. Each link's items[].status is added or failed (+code). With a webhook you get image_import.completed.

    while :; do
      IMPORT=$(curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/image-imports/$IMPORT_ID" \
        -H "Authorization: Bearer $MONSTRA_KEY")
      STATUS=$(echo "$IMPORT" | jq -r '.import.status // empty')
      case "$STATUS" in pending|running) sleep 3 ;; *) break ;; esac
    done
    echo "$STATUS"   # completed, or empty when the call failed: see $IMPORT
    echo "$IMPORT" | jq '.import | {added, failed, items: [.items[] | {url, status, code}]}'

  4. Generate the product page

    languages are the languages to make (EN, KO, JA, ZH). With an Idempotency-Key, sending it again after a lost response does not generate twice. Answers 202 with the generation.

    GENERATION_ID=$(curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/compose" \
      -H "Authorization: Bearer $MONSTRA_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: ali-1005001-compose-1" \
      -d '{"languages": ["EN", "KO"]}' | jq -r .generation.id)

  5. Wait for the generation

    Take the webhook's generation.completed, failed or cancelled, or check GET /generations/{id} every few seconds. It has ended when status is neither pending nor running. Per-language results are in items.

    while :; do
      STATUS=$(curl -s "$MONSTRA_BASE/generations/$GENERATION_ID" \
        -H "Authorization: Bearer $MONSTRA_KEY" | jq -r '.generation.status // empty')
      case "$STATUS" in pending|running) sleep 5 ;; *) break ;; esac
    done
    echo "$STATUS"   # completed | failed | cancelled

  6. Get the result

    format=html returns the HTML fragment; without it (json) you get the title, description, sections, rendered_html and image_order. The page's photo URLs are in the JSON image_order and open for about an hour, so download them right away and host them yourself.

    curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/pages/EN?format=html" \
      -H "Authorization: Bearer $MONSTRA_KEY" -o page-en.html
    
    # The page's photos (JSON image_order) are signed links that open for about an hour: keep copies.
    curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/pages/EN" -H "Authorization: Bearer $MONSTRA_KEY" |
      jq -r '.image_order[]' |
      while read -r url; do curl -s -o "$(basename "$url" | cut -d'?' -f1)" "$url"; done

4.Photos

  • Upload files: POST /products/{id}/images with one or more multipart files parts. A photo with the same bytes is not added again — the existing photo (same id) comes back — so after a failure simply upload again.
  • JPEG, PNG, WebP or AVIF still images. Up to 10 MiB each, 20000 px per side and 64 megapixels, and 50 originals per product.
  • Add from links: POST /products/{id}/images/from-urls {"urls": […]} — 1–20 distinct http/https links of at most 2048 characters. Only public internet addresses work — private or internal ones are always 400 image_url_invalid (+url). Up to 3 redirects are followed, each target checked by the same rule.
  • One import at a time per product (409 image_import_in_progress + import_id). While it runs, generating that product is refused with the same code. Across the account, up to 5 products at once (409 too_many_image_imports).
  • Refused at once: the current photos plus the links over 50 is 400 too_many_images; no storage left is 409 storage_limit_reached.
  • Per-link failure code: private_address, invalid_url, redirect, http_status, too_large, timeout, network, unsupported_image, image_dimensions_too_large, too_many_images, storage_limit_reached. An import still ends completed when some links fail.
  • Photo URLs in responses (/api/files/…?e=…&s=…) are signed and open for about an hour. Do not hotlink them from your site: download and keep them. After expiry they answer 401; reading again gives fresh URLs.
  • Idempotency-Key cannot be used on file uploads (400). The duplicate handling above makes it unnecessary.
Upload files (multipart)
curl -s "$MONSTRA_BASE/products/$PRODUCT_ID/images" \
  -H "Authorization: Bearer $MONSTRA_KEY" \
  -F "files=@mug-1.jpg" -F "files=@mug-2.jpg"

5.Webhooks

An account has one webhook. Save the receiving address (https) on the "API keys & webhook" screen and a signing secret (mk_whsec_…) is made. Every piece of work on the account notifies it when it ends, whether started on the web or through the API. Notifications carry a summary only — read the full state with GET afterwards. Polling with GET works without a webhook, always.

EventWhendata
generation.completed · generation.failed · generation.cancelledA generation ended (succeeded, failed or cancelled)generation: id, product_id, external_id, kind, status, items[] (language, status, error_message), error_message, cost, created_at, finished_at
bulk.completed · bulk.cancelledA bulk job endedbulk: as bulk of GET /bulk/jobs/{id}
store_job.completed · store_job.failedA store import, update or restore endedjob: id, kind, status, connection_id, product_id, external_id, error_code, error, cost, created_at, finished_at
image_import.completedAdding photos from links endedimport: as GET …/image-imports/{id} (with its items)
ping"Send test notification" was pressed on the screen{}
A notification request
POST /monstra/webhook HTTP/1.1
Content-Type: application/json
User-Agent: Monstra-Webhooks/1.0
Monstra-Event: generation.completed
Monstra-Delivery: 8123
Monstra-Signature: t=1760000000,v1=5f2b…(64 hex)

{
  "id": 8123,
  "event": "generation.completed",
  "created_at": "2026-10-09T05:00:00.000Z",
  "origin": "api",
  "api_key_id": 7,
  "data": {
    "generation": {
      "id": 912,
      "product_id": 345,
      "external_id": "ali-1005001",
      "kind": "compose",
      "status": "completed",
      "items": [
        { "language": "EN", "status": "completed", "error_message": null },
        { "language": "KO", "status": "completed", "error_message": null }
      ],
      "error_message": null,
      "cost": 1830,
      "created_at": "2026-10-09T04:58:41.000Z",
      "finished_at": "2026-10-09T05:00:00.000Z"
    }
  }
}

  • The body's id is the delivery id, the same as the Monstra-Delivery header. Retries keep it, so de-duplicate on it.
  • origin is "api" (work started with an API key) or "web"; api_key_id is that key's id (null for the web).
  • Deleting a product drops the notifications of its generations and imports.
  • When a compose or translate request itself ends in an error (5xx) — refused while handing the work over — no generation.failed notification is sent: the error response is the result.

Verifying the signature

  • Monstra-Signature: t=<unix seconds>,v1=<signature> — the signature is the hex HMAC-SHA256(t + "." + body) keyed with the secret (the whole mk_whsec_… string).
  • Use the body bytes exactly as received. Parsing the JSON and serializing it again changes spacing or order and the signature no longer matches.
  • Reject a t more than 5 minutes away from now (replay protection). Compare signatures in constant time (timingSafeEqual, hmac.compare_digest).
  • t is set at each attempt: retries of one notification have the same body and a different signature.
  • A new secret signs from that moment on, waiting retries included. Update the receiving side right away.
Node.js (Express)
import crypto from 'node:crypto'
import express from 'express'

const TOLERANCE_SECONDS = 5 * 60

/**
 * rawBody: the request body exactly as received (a Buffer), never re-serialized JSON.
 * header: the Monstra-Signature header. secret: the whole "mk_whsec_…" string.
 */
export function verifyMonstraSignature(rawBody, header, secret, nowSeconds = Date.now() / 1000) {
  // A parsed body (express.json) or a missing secret can never verify.
  if (!Buffer.isBuffer(rawBody) || !secret) return false
  const parts = {}
  for (const piece of String(header ?? '').split(',')) {
    const i = piece.indexOf('=')
    if (i > 0) parts[piece.slice(0, i).trim()] = piece.slice(i + 1).trim()
  }
  const t = parts.t
  if (!/^\d+$/.test(t ?? '') || !/^[0-9a-f]{64}$/.test(parts.v1 ?? '')) return false
  if (Math.abs(nowSeconds - Number(t)) > TOLERANCE_SECONDS) return false
  const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest()
  return crypto.timingSafeEqual(expected, Buffer.from(parts.v1, 'hex'))
}

const app = express()
// express.raw, not express.json: the signature is over the bytes as sent.
app.post('/monstra/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  if (!verifyMonstraSignature(req.body, req.get('Monstra-Signature'), process.env.MONSTRA_WEBHOOK_SECRET)) {
    return res.sendStatus(400)
  }
  res.sendStatus(204) // answer first, work afterwards
  const event = JSON.parse(req.body.toString('utf8'))
  // De-duplicate on event.id (= Monstra-Delivery), then GET the current state.
  console.log(event.event, event.id)
})
app.listen(3000)

Python (Flask)
import hashlib
import hmac
import json
import os
import re
import time

from flask import Flask, request

TOLERANCE_SECONDS = 5 * 60


def verify_monstra_signature(raw_body: bytes, header: str, secret: str, now=None) -> bool:
    """raw_body: the request body exactly as received. secret: the whole "mk_whsec_..." string."""
    parts = {}
    for piece in (header or "").split(","):
        key, sep, value = piece.partition("=")
        if sep:
            parts[key.strip()] = value.strip()
    t, v1 = parts.get("t", ""), parts.get("v1", "")
    if not re.fullmatch(r"[0-9]+", t) or not re.fullmatch(r"[0-9a-f]{64}", v1):
        return False
    if abs((time.time() if now is None else now) - int(t)) > TOLERANCE_SECONDS:
        return False
    expected = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, v1)


app = Flask(__name__)


@app.post("/monstra/webhook")
def monstra_webhook():
    raw = request.get_data()  # the bytes as sent, before any JSON parsing
    if not verify_monstra_signature(raw, request.headers.get("Monstra-Signature", ""), os.environ["MONSTRA_WEBHOOK_SECRET"]):
        return "", 400
    event = json.loads(raw)
    # Answer 2xx quickly; de-duplicate on event["id"] (= Monstra-Delivery) and do the work afterwards.
    print(event["event"], event["id"])
    return "", 204

Delivery and retries

  • Any 2xx answer is a delivery. Answer 2xx as soon as the request arrives and do the work afterwards. No answer within 10 seconds counts as a failure.
  • A 3xx is not followed and counts as a failure (the signed body must not go anywhere else).
  • After a failure it is sent again after 1 minute → 5 minutes → 30 minutes → 2 hours → 8 hours (6 tries including the first, about 10.5 hours). Then the notification ends failed.
  • Order is not guaranteed. Sort by created_at and id, and read the current state with GET.
  • The receiving address must be a public https address on the default port (443) — no number such as :8443 or :80 after the host. Private or internal addresses cannot be saved.
  • Turning the webhook off or deleting it cancels waiting notifications. Beyond 1000 notifications waiting, the oldest are cancelled.
  • The "API keys & webhook" screen shows the recent notifications and why any failed.

6.Idempotency keys

To send a request again safely when its response was lost, add an Idempotency-Key header to the POST. Sent again with the same key, it answers the first response.

  • Works on every v1 POST except file uploads. PUT and DELETE give the same result however often they are sent, so the header there is refused with 400.
  • Value: 1–128 characters of A–Z a–z 0–9 _ . : -. Scoped to the account, so it carries over when you change API keys; kept for 24 hours.
  • A replayed response carries Idempotency-Replayed: true. It replays the first response, so states in it (a generation's status) are as they were then — read the current state with GET.
  • The same key with a different request (another path or body) is 409 idempotency_key_reused; while the first request is still running it is 409 idempotency_in_progress (try again shortly).
  • Only answers about the request itself are stored and replayed: successes, and 4xx such as validation errors, not found, external_id_taken and finished work (generation_finished, bulk_finished).
  • Answers that depend on the moment are not stored, so the same key sent again really runs: every 429 and 5xx, plus too_many_active · quota_exceeded · insufficient_credit · busy · rate_limited · storage_limit_reached · product_limit_reached · too_many_image_imports · upload_in_progress · generation_in_progress · image_import_in_progress · store_push_in_progress · store_job_in_progress · bulk_in_progress · idempotency_in_progress · source_page_required · base_page_not_ready · store_needs_reauth · store_not_connected · store_unavailable · engine_unavailable · bulk_unavailable · writer_unavailable.
  • Send the same body again, byte for byte. A trailing / in the path is ignored. Replays count toward the per-minute limit.
  • Signed photo URLs in a replayed body may have expired (they last about an hour). GET the resource again for fresh ones.
curl -si "$MONSTRA_BASE/products/$PRODUCT_ID/compose" \
  -H "Authorization: Bearer $MONSTRA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ali-1005001-compose-1" \
  -d '{"languages": ["EN", "KO"]}' | grep -i '^idempotency-replayed'
# Idempotency-Replayed: true   <- the first answer, replayed; no second generation

7.Your own ids (external_id)

Attach your system's id (product number, SKU …) to a product and you need not store Monstra's product id yourself.

  • external_id on POST /products and PUT /products/{id}: 1–128 characters after trimming, no control characters, case-sensitive. Unique within the account.
  • A value already in use answers 409 external_id_taken with that product's product_id — carry on with that product.
  • Find a product: GET /products?external_id=… (exact match, 0 or 1 result). Combines with the other filters.
  • PUT replaces the whole product, except external_id: left out, it is kept; null clears it (languages is also kept when left out).
  • Generation, store job and photo import notifications carry the product's external_id.
curl -s "$MONSTRA_BASE/products?external_id=ali-1005001" \
  -H "Authorization: Bearer $MONSTRA_KEY" | jq '.products[0].id'

8.Bulk jobs and stores

  • Bulk generation: see the estimate with POST /bulk/generate/estimate, then POST /bulk/generate. Bulk delete: POST /bulk/delete. Status GET /bulk/jobs/{id}, cancel POST /bulk/jobs/{id}/cancel.
  • Up to 100 products per request and one running bulk job per account (409 bulk_in_progress + bulk_id). When it ends you get bulk.completed or bulk.cancelled.
  • A bulk job generates its products one after another. To run several at once, send compose for each product yourself (within the concurrent generation limit).
  • Stores are connected on the web only. Once connected, GET /stores, POST /stores/{id}/import, GET /products/{id}/store/preview, POST /products/{id}/store/push and restore, and POST /bulk/push work through the API, ending with store_job.completed or failed.
  • Where store integration is off, the store routes answer 404 not_found.

9.Limits

WhatLimitBeyond it
Requests per key120 per minute429 rate_limited + Retry-After
Requests per account360 per minute (all keys plus v1 calls with a login token)429 rate_limited + Retry-After
Failures with an unknown key30 per minute per IP429 rate_limited
Active keys per account10409 api_key_limit_reached
Generations running at once2 per account (an admin can change it; quota.max_active of /me)429 too_many_active
Pages generated per day1,000 by default (an admin can change it per account, or remove it; quota.daily_limit of /me, null = no daily limit)429 quota_exceeded
CreditThe same balance as the web; a running generation holds its estimate429 insufficient_credit
Products / storage500 / 2 GiB409 product_limit_reached / storage_limit_reached
Photos50 originals per product, 10 MiB each, 20000 px per side and 64 megapixels400 too_many_images · 413 file_too_large · 400 image_dimensions_too_large
Photos from links20 per request, 2048-character links, one running per product, 5 products at once per account400 validation_failed · 409 image_import_in_progress · 409 too_many_image_imports
Bulk jobs100 products per request, one running per account409 bulk_in_progress
JSON body1 MiB413 payload_too_large
Signed photo URLsAbout an hour — download and keep them401 unauthorized after expiry
WebhooksAnswer within 10 seconds, 6 tries, log kept 30 days—
Webhook settings (web screen)Save 10 per minute, test notification 5 per minute429 rate_limited
Undelivered webhook notificationsUp to 1000 waitingThe oldest are cancelled beyond that
Idempotency keysKept 24 hours409 idempotency_key_reused · idempotency_in_progress

10.Error codes

The codes you are most likely to meet. The responses of each route are in the OpenAPI spec.

HTTPcodeMeaning
400validation_failed · invalid_jsonThe input or the JSON is not valid. error names the field.
400images_required · languages_requiredGenerating with no photos, or with no language to make
400no_files · invalid_upload · too_many_images · unsupported_image · image_dimensions_too_large · invalid_image_orderPhoto upload or order errors
400image_url_invalid (+url)A photo link that cannot be used (format, private or internal address)
400writer_unavailableSomething went wrong, so pages cannot be made right now — try again shortly
401unauthorizedNo authentication, or an expired signed URL
401invalid_api_keyA wrong or revoked key, or a key used outside v1
403browser_not_allowedA key used from a browser (Origin header)
404not_found · product_not_found · image_not_found · page_not_found · generation_not_found · image_import_not_found · bulk_not_found · store_not_found · store_job_not_foundMissing or not yours (another account's is 404 too)
409generation_in_progressThe product is already being generated
409source_page_requiredTranslating needs a generation (compose) first
409image_import_in_progress (+import_id)Photos are being added from links
409too_many_image_importsFive photo imports are already running across the account
409external_id_taken (+product_id)The external_id is already in use
409idempotency_key_reused · idempotency_in_progressIdempotency key conflict
409product_limit_reached · storage_limit_reachedProduct count or storage limit
409bulk_in_progress (+bulk_id) · store_job_in_progress (+job_id)A bulk or store job is already running
413file_too_large · payload_too_largeA photo over 10 MiB, a JSON body over 1 MiB
429rate_limitedToo many requests per minute (key, account, or an IP with many unknown-key failures) — try again after Retry-After seconds
429too_many_active · quota_exceeded · insufficient_creditConcurrent generations, daily limit or credit
429upload_in_progressAnother upload of the account is running
500internal_errorAn unexpected error — try again shortly
502 · 503engine_rejected · engine_error · engine_unavailable · busyGeneration is not available for a moment — try again shortly
400 · 404 · 409webhook_url_invalid · webhook_not_found · api_key_not_found · api_key_limit_reachedWeb screens only (key and webhook settings) — never from /api/v1

11.OpenAPI spec

Every route and the shape of every request and response are in the OpenAPI 3.1 spec, ready for code generators or Postman. Response schemas say additionalProperties: false, but build clients that ignore new fields.

Open openapi.jsonhttps://<api-host>/api/v1/openapi.json

Routes at a glance
# Account and catalog
GET    /me
GET    /me/ledger?cursor=&limit=
GET    /languages
GET    /personas
GET    /layouts?lang=

# Products
GET    /products?limit=&offset=&q=&sort=&source=&state=&lang=&lang_state=&external_id=
POST   /products
GET    /products/{id}
PUT    /products/{id}
DELETE /products/{id}
PUT    /products/{id}/layout
PUT    /products/{id}/image-selection
PUT    /products/{id}/photo-set
PUT    /products/{id}/hero-image

# Photos
POST   /products/{id}/images                      (multipart "files")
POST   /products/{id}/images/from-urls
GET    /products/{id}/image-imports/{importId}
PUT    /products/{id}/images/order
DELETE /products/{id}/images/{imageId}

# Generation and pages
POST   /products/{id}/compose
POST   /products/{id}/translate
GET    /products/{id}/generations?limit=
GET    /generations/{id}
POST   /generations/{id}/cancel
GET    /products/{id}/pages/{language}?format=json|html
GET    /products/{id}/pages/{language}/history
GET    /products/{id}/source

# Bulk
POST   /bulk/delete
POST   /bulk/generate/estimate
POST   /bulk/generate
GET    /bulk/jobs?active=&limit=
GET    /bulk/jobs/{id}
POST   /bulk/jobs/{id}/cancel
POST   /bulk/push/plan
POST   /bulk/push

# Stores (connected on the web first)
GET    /stores
GET    /stores/jobs/{jobId}
GET    /stores/{id}/products?cursor=&q=
POST   /stores/{id}/import
GET    /products/{id}/store/preview
POST   /products/{id}/store/push
POST   /products/{id}/store/restore

# Docs
GET    /openapi.json                              (public)

12.Versioning

  • v1 only ever adds fields and routes. Clients must ignore response fields they do not know.
  • Renaming, removing, or changing the type or meaning of anything comes as v2.
  • An unknown field in a request is 400 validation_failed.
  • Paths under /api/… but not /api/v1 belong to the web screens and change without notice. Do not use them from programs.
  • The error sentences are Korean and may change. Branch on code.