Skip to navigation

Upload a capture file

Stores one document image, selfie, video or supporting file and returns its mediaId, which you then reference when creating a verification. An unreferenced upload is discarded after 30 minutes.

Accepted content types are image/jpeg, image/png, image/webp, video/webm, video/mp4 and application/pdf. The file content decides the stored type, so a HEIC photo labelled as JPEG is converted for you.

A hosted verification session token is also accepted in place of an API key. An optional X-Myaza-Device-Id header (at most 64 characters) records which device made the capture.

This endpoint returns plain sentences in error rather than stable codes, apart from the authentication codes below.

Error codes

errorStatusMeaning
type must be one of ...400The type field is missing or not an accepted value.
file is required400No file part was sent.
mimeType one of ...400The file content type is not accepted.
File too large (max 25MB)400The file exceeds the size limit.
(storage message)400The file could not be stored, for example a PDF sent for an image-only type.
(conversion message)415A HEIC image could not be converted.
Missing or invalid Authorization header401No bearer credential was sent.
Invalid API key401The key is unknown or revoked.
environment_mismatch403The key belongs to an environment this host does not serve.
origin_not_allowed403The request origin is not on the publishable key allowlist.
ip_not_allowed403The caller address is not on the secret key allowlist.
organization_suspended403The organisation is suspended.
business_not_approved403A production key was used before the business was approved.

Accepts a publishable (pk_) or secret (sk_) key.

Authentication

AuthorizationBearer
Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required.

Request

This endpoint expects a multipart form containing a file.
filefileRequired
The raw file bytes, at most 25 MB.
typeenumRequired

What the file is. Images are accepted for every type, videos for the video types, and PDF only for proof_of_address, business_document and supporting_document.

sessionIdstringOptional
The resumable session this upload belongs to, so the file is kept for the life of that session rather than the default 30 minutes.

Response

The file was stored.
mediaIdstring

The identifier to reference in mediaIds when creating a verification.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
415
Unsupported Media Type Error