π Process Image Endpoint
The Process Image endpoint queues an uploaded image for asynchronous masking. It applies anonymization to sensitive elements such as faces, people, or license plates based on your parameters, and returns a jobId that can be used to track the result.
This flow is optimized for robust integration into both synchronous and event-driven pipelines. You can poll for completion or enable webhook delivery for hands-free operation.
π¦ Endpoint Overview
- URL: POST https://app.maskit.ai/api/v1/masking/process-image
- Content-Type: multipart/form-data
- Authentication: X-Api-Key header (required)
- Response: JSON object containing the jobId
- Use Case: Asynchronous masking with polling or webhook callback
π Request Parameters
Send the following fields as multipart/form-data:
Field | Type | Required | Default | Description |
|---|---|---|---|---|
image | file | β | β | The image file to process (JPEG or PNG). |
faces | boolean | β | true | Whether to detect and mask faces. |
humans | boolean | β | true | Whether to detect and mask full human bodies. |
licensePlates | boolean | β | true | Whether to detect and mask license plates. |
shape | string | β | Mask | Shape used to mask areas: Mask (soft polygon) or Rectangle (bounding box). |
method | string | β | Blur | Masking method: Blur or BlackFill. |
blurStrength | int | β | 30 | Gaussian blur strength when method=Blur. |
edgeBlurSize | double (0.0β1.0) | β | 0.2 | Softness applied to the edges of masked regions. |
metadata | string | β | β | Optional metadata string (e.g. user ID, context) attached to the job. |
useWebhook | boolean | β | false | If true, result is delivered via webhook once ready. |
π Authentication
Include your API key in the request header:
X-Api-Key: YOUR_API_KEYRefer to the API Key & Webhook Secret page to generate and manage your credentials.
π Response
{
"jobId": "9f52f3d9-1c84-4b1d-bf7c-2f0b9383fa17"
}Error Responses:
Code | Description |
|---|---|
400 | Invalid or missing parameters |
401 | Missing or invalid API key |
500 | Server error while processing the image |
π Webhook Delivery
If you set useWebhook=true, the final masked image will be delivered to your configured webhook URL as a multipart/form-data POST request.
For full details, including HMAC validation and payload structure, see the Webhook documentation.
π Example cURL Request
curl -X POST "https://app.maskit.ai/api/v1/masking/process-image" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "faces=true" \
-F "humans=true" \
-F "licensePlates=true" \
-F "shape=Mask" \
-F "method=Blur" \
-F "blurStrength=30" \
-F "edgeBlurSize=0.2" \
-F "useWebhook=true"This command uploads an image for masking and enables webhook delivery once it's processed.