Detect tampering in a document image
Analyze one document-page image for tampering and AI editing, and get back a verdict plus any localized tampered regions (bounding boxes in original-image pixels). Synchronous but slow — about 5 to 90 seconds per image (more on a cold start) — so call it from a background job with a long timeout, not in a user-facing request. Send a single image; to analyze a PDF, rasterize each page to an image and call once per page. Requires an API key with the document-image scope.
Authorization
BearerAuth Send your secret API token as a bearer token in the Authorization header:
Authorization: Bearer <token>. Keep it server-side and never expose it in client code.
In: header
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
{
"edited": true,
"score": 0.82,
"threshold": 0.5,
"imageWidth": 1654,
"imageHeight": 2339,
"meanConfidence": 0.78,
"fileName": "passport-page-1.png",
"processingTimeMs": 82140,
"errorMessage": null,
"regions": [
{
"x": 512,
"y": 880.5,
"width": 240,
"height": 52,
"score": 0.91,
"meanScore": 0.63,
"areaFraction": 0.0032
}
]
}{
"error": {
"code": "IMAGE_FORENSICS:FILE_TOO_LARGE",
"message": "File photo.jpg exceeds the maximum size of 50 MB."
}
}{
"error": {
"code": "IMAGE_FORENSICS:UNSUPPORTED_FORMAT",
"message": "Unsupported file format. Allowed — jpg, jpeg, png, webp, heic, heif, tiff."
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API token."
}
}{
"error": {
"code": "api_key.scope_missing",
"message": "This API key is not authorized for the document-image scope."
}
}
