API reference / Documents

post/v1/documents/photo

Render a correctly sized passport photograph

Operation
renderPassportPhoto
Authentication
API key

Send the image as the request body with a `Content-Type` of `image/jpeg` or `image/png`, and name the destination in the query. Returns the cropped, background-replaced photograph as base64.

**Stateless.** The bytes are read into memory, passed to the rendering service, and returned. Nothing is written to storage and no row is created, which is deliberate: a passport photograph is the one document whose retention raises the hardest questions in this product.

**`compliant` is always `false`.** The pipeline verifies exactly one thing for itself, that a single face was detected. Everything else an immigration officer looks at is unmeasured and is listed under `human_review`, never as a passing check. A `200` carrying `errors` means the photograph was seen and could not be used, which is a different outcome from a failure to reach the service.

Request

Parameters

destination_iso3queryrequiredstring

Responses

200The rendered photograph, or the reason one could not be produced. `errors` is non-empty when the image was rejected; `processing: null` when the pipeline did not run.
compliantbooleanrequired

one of:

errorsstring[]required
warningsstring[]required
checksobjectrequired
human_reviewstring[]required
processingobjectnullrequired
input_dimensionsobjectnullrequired
render_target_sourcestringrequired
destination_iso3stringrequired

one of: ETHSOMDJIKEN

photo_base64stringnullrequired
hd_photo_base64stringnullrequired
400The request body or query failed validation.
errorobjectrequired
401No key, an unknown key, a revoked key, or a key whose tenant is not active. All four return an identical body on purpose: distinguishing them would let a caller discover which partners we have.
errorobjectrequired
403The key is valid but does not hold the scope this route requires.
errorobjectrequired
404Not found, or not yours. A resource belonging to another tenant answers 404 rather than 403, because 403 would confirm the record exists.
errorobjectrequired
503Photo rendering is not configured on this deployment.
errorobjectrequired

Example

curl
curl -X POST https://api.haavisa.com/v1/documents/photo \
  -H "Authorization: Bearer $HAAVISA_API_KEY"?destination_iso3=<destination_iso3>

More in Documents

Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.