Skip to main content
POST
/
v1
/
widget
/
embed
/
sessions
/
{sessionId}
/
uploads
curl -X POST https://api.vouchmark.com/v1/widget/embed/sessions/wses_.../uploads \
  -F "file=@/path/to/certificate.pdf" \
  -F "token=elt_..." \
  -F "moduleId=document_upload" \
  -F "fieldName=certificateOfIncorporation"
{
  "success": true,
  "data": {
    "sessionId": "wses_...",
    "widgetId": "wgt_aBcD...",
    "status": "in_progress",
    "currentModuleId": "document_upload",
    "answers": {},
    "attachments": {
      "document_upload": {
        "certificateOfIncorporation": {
          "url": "https://res.cloudinary.com/.../certificate.pdf",
          "publicId": "kyb-widget-sessions/abc123",
          "format": "pdf",
          "size": 482113,
          "originalName": "certificate.pdf"
        }
      }
    },
    "referenceId": null
  }
}
This is an embed runtime endpoint. It is called by the embedded Vouchmark widget in the applicant’s browser, not by your backend. It uses the widget’s token and does not take a Bearer token.
Uploads a single file and attaches it to a module field on an in-progress session. The request is multipart/form-data. The session must be in_progress and the module must be enabled on the widget. Returns the updated session view, including the new attachment. Accepted file types: PDF, JPEG, PNG. Maximum size 10 MB.

Path parameters

sessionId
string
required
The session ID (starts with wses_).

Form fields

file
file
required
The file to upload. Field name must be file.
token
string
required
The widget’s embed link token (embedLinkToken, starts with elt_).
moduleId
string
required
The module this attachment belongs to. Must be enabled on the widget.
fieldName
string
required
The module field the attachment is stored under.
curl -X POST https://api.vouchmark.com/v1/widget/embed/sessions/wses_.../uploads \
  -F "file=@/path/to/certificate.pdf" \
  -F "token=elt_..." \
  -F "moduleId=document_upload" \
  -F "fieldName=certificateOfIncorporation"
{
  "success": true,
  "data": {
    "sessionId": "wses_...",
    "widgetId": "wgt_aBcD...",
    "status": "in_progress",
    "currentModuleId": "document_upload",
    "answers": {},
    "attachments": {
      "document_upload": {
        "certificateOfIncorporation": {
          "url": "https://res.cloudinary.com/.../certificate.pdf",
          "publicId": "kyb-widget-sessions/abc123",
          "format": "pdf",
          "size": 482113,
          "originalName": "certificate.pdf"
        }
      }
    },
    "referenceId": null
  }
}
Returns 201. Rate limited to 40 uploads per hour.