API reference

Blur faces

Anonymise faces in an image, optionally keeping people you have enrolled sharp.

POST /v1/face-blur/process1 operation per image

The programmatic form of Blur faces in the dashboard — same models, same allowance.

Request

multipart/form-data, with your key as a bearer token.

FieldTypeDefaultDescription
imagerequiredfileJPEG, PNG or WebP.
blur_strengthinteger124–24. Twelve matches the dashboard; lower is softer, higher is heavier.
modestringall`all` blurs everyone. `except_enrolled` keeps recognised faces sharp. `only_enrolled` blurs just the recognised ones.
collectionstringLimit recognition to one enrolled collection. Omit to use every collection.
thresholdnumber0.9Recognition match score 0–1. Higher is stricter.

Example

curl -X POST https://api.quantilence.com/v1/face-blur/process \
  -H "Authorization: Bearer $QUANTILENCE_API_KEY" \
  -F "image=@photo.jpg" \
  -F "blur_strength=12" \
  -F "mode=all" \
  -F "collection=staff" \
  -F "threshold=0.9"

Response

200 OK with this shape. Values below are illustrative; the keys and types are not.

{
  "success": true,
  "faces_detected": 3,
  "faces_blurred": 2,
  "blur_strength": 12,
  "mode": "except_enrolled",
  "image_data": "/9j/4AAQSkZJRgABAQAAAQ…",
  "faces": [
    {
      "face_index": 0,
      "bbox": [
        0.412,
        0.188,
        0.523,
        0.361
      ],
      "det_score": 0.891,
      "blurred": false,
      "matched": {
        "ml_face_id": 4127,
        "collection": "staff",
        "sim_score": 94.2
      }
    }
  ],
  "processing_time_ms": 268.4,
  "degraded": null
}
FieldTypeDescription
successbooleanAlways true on a 200.
faces_detectedintegerFaces found.
faces_blurredintegerOf those, how many were blurred.
blur_strengthintegerThe strength actually applied.
modestringThe mode actually applied.
image_datastringThe result image, base64-encoded JPEG. Not a URL — decode and save it.
facesFace[]Every detected face, blurred or not.
faces[].face_indexintegerPosition within this response.
faces[].bboxfloat[4][x1, y1, x2, y2], normalised 0–1.
faces[].det_scorefloatDetector confidence, 0–1.
faces[].blurredbooleanWhether this face was blurred.
faces[].matchedMatch | nullThe enrolled face it was recognised as, when it was.
processing_time_msfloatModel time.
degradedstring | nullSet when a selective mode could not read your enrolled faces and blurred everyone instead. The image is safe to publish; it is not the one you asked for.

Worth knowing

  • `image_data` is base64, not a URL. Nothing is stored on our side — decode it and keep it yourself.
  • Always check `degraded`. A non-null value means a selective mode fell back to blurring everyone.
  • `except_enrolled` and `only_enrolled` need faces enrolled first — see Enrol a face.