Skip to main content
POST
Call this from your server, with your key in the x-api-key header, to open one visit to the embedded editor; a signed storefront request opens one for the store it is signed for. The response carries the opaque session token the editor is opened with, the message_session_id your page matches every editor message against, and the one time bootstrap_secret that completes the handshake. Your key stays on your server, in neither the token nor the response. mockup_type picks the editor, session_kind picks the job, and allowed_origin names the one origin allowed to embed the session.
expires_in is an idle window rather than a countdown from creation. It restarts while the session is in use, so an editor a shopper is still working in stays open.

Authorizations

x-api-key
string
header
required

API key with sm_ prefix. Get your key at https://sudomock.com/dashboard/api-keys

Body

application/json
mockup_type
enum<string> | null

Which editor the session opens, psd or 2d.

Available options:
psd,
2d
session_kind
enum<string> | null

What the session is for, setup or customize.

Available options:
setup,
customize
mockup_uuid
string | null

UUID of the mockup to customize

Example:

"c315f78f-d2c7-4541-b240-a9372842de94"

product_id
string | null

Product ID from the platform

Maximum string length: 255
Example:

"8342019283"

variant_id
string | null

Variant ID from the platform

Maximum string length: 255
Example:

"44912837465"

allowed_origin
string | null

HTTPS origin of the page that embeds the editor.

Maximum string length: 2048
Example:

"https://your-store.example.com"

config
StudioConfigPatch · object | null

Optional session-only Studio config override. Not persisted.

action_id
string | null

Your own routing identifier for the action this session completes.

Required string length: 1 - 64
Pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
Example:

"add-to-cart"

artwork
StudioArtworkInput · object

Response

200 - application/json

Successful Response

mockup_type
enum<string>
required

Which editor this session opens, psd or 2d.

Available options:
psd,
2d
session
string
required

Opaque token the editor is opened with.

Example:

"sess_xQ8pM2vK7nR4tB1yH6zJ3wL5sD9fG0aC2eN8uV4iT7o"

expires_in
integer
required

Seconds the session stays valid while it sits idle.

Example:

900

message_session_id
string
required

Identifier your page matches every editor message against.

Example:

"7d1b4a90-2e63-4f18-bb27-1c9a0e4d7f52"

bootstrap_secret
string
required

One-time secret your page sends to complete the handshake.

Example:

"wAKBqgAce_HWV01uenTwEPrczjPkIt9xH0BSjQ1S68A"

success
boolean
default:true

True when the session was created.