Skip to main content
POST https://api.craftkit.dev/v1/embed/form-submit/:sessionId/upload-image
Accepts a multipart/form-data upload with a single file field (an image), stores it under the session’s namespace, and returns the public URL — so the form submit payload can carry a URL instead of a raw file. Call this before posting the JSON form data.

Authorization

Embed session JWT only — never a project API key.
string
required
Bearer <session_token> — a fill-mode session JWT. The request origin must be allow-listed, and :sessionId must match the token’s session. The submitForm permission is not required for upload — only fill mode.

Path parameters

string
required
The embed session id. Must match the bearer token’s session.

Body

Send as multipart/form-data.
file
required
The image to upload. MIME type must start with image/. Max size 10 MB. The stored key is embed-uploads/{projectId}/{sessionId}/{uuid}.{ext}; the extension comes from the filename, falling back to a MIME-type mapping (jpg, png, gif, webp, svg) or .bin.

Response

200 with the public URL of the uploaded image.
string
Public URL of the uploaded image. Pass it back as the value of the matching image variable in the data of your form submit.

Errors

cURL
200