POST
https://api.craftkit.dev/v1/embed/form-submit/:sessionId/upload-imagemultipart/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.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
The embed session id. Must match the bearer token’s session.
Body
Send asmultipart/form-data.
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.
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
| Status | code | Meaning |
|---|---|---|
| 400 | bad_request | Request origin is not in the allowed origins list. |
| 400 | invalid_multipart | Body is not valid multipart/form-data. |
| 400 | missing_file | No file field in the form data. |
| 401 | unauthorized | Missing/malformed header, or the session token failed verification. |
| 403 | wrong_mode | Session is not scope.mode = "fill". |
| 404 | session_not_found | :sessionId does not match the bearer token. |
| 413 | file_too_large | File exceeds the 10 MB limit. |
| 415 | invalid_type | The file’s MIME type is not image/*. |
cURL
200