> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/iad/technical_documentation/api_reference/iad/evaluate-a-capture-with-an-explicit-pipeline.md).

# Evaluate a capture with an explicit pipeline

Evaluates the capture like `POST /api/v1/iad/evaluate`, but with the analysis pipeline and calibration chosen by the client. The response and the errors are the same as for `/evaluate`, plus the validation of `pipeline` and `calibration`.

* `pipeline` (required): `iad_r01` or `iad_r00`.
* `calibration` (optional): `regular` (default) or `hardened`.
* Both values are compared case-insensitively and ignoring leading and trailing whitespace. When `calibration` is missing or empty, `regular` is used.
* Errors of the `capture` field are checked before those of `pipeline`.
* In the deployment with the Facephi Docker image, `/evaluate` is equivalent to `iad_r01` with `regular`, and every combination is available without additional configuration. If a combination the analysis engine does not have available is requested, the response is HTTP 400 with `ErrorProcessing`.

```json
{"openapi":"3.0.1","info":{"title":"IAD Service REST API","version":"3.0.0"},"tags":[{"name":"IAD","description":"Injection attack detection endpoints"}],"servers":[{"url":"http://127.0.0.1:6982/"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT signed with HS256 and sent as `Authorization: Bearer <jwt>`. Only required when JWT authentication is enabled."},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"The same JWT sent in the API key header. `x-api-key` is the default header name; it can be overridden at startup with `auth_api_key_header_name`. Only required when JWT authentication is enabled."}},"schemas":{"BinaryData":{"type":"string","format":"binary","description":"Encrypted facial capture generated by the Facephi capture component."},"EvaluationResult":{"type":"object","description":"Public injection attack detection result. The order of the keys is not part of the contract, and clients must ignore unknown fields.","required":["diagnostic","reason","transactionId","timestamp"],"properties":{"diagnostic":{"type":"string","description":"Binary verdict of the evaluation. It is the only field that must decide whether the capture is accepted; any value other than `NoAttack` must be treated as a rejection.\n\n- `NoAttack`: no injection attack was detected; the capture is accepted.\n- `Attack`: an injection attack was detected; the capture is rejected.\n","enum":["NoAttack","Attack"]},"reason":{"type":"string","description":"Reason for the rejection. It is informative and must not be used to decide the outcome. When there are several reasons, only the first one is returned. The service converts the reasons reported by the analysis to PascalCase, so new values may appear; show a generic message for the ones you do not recognize.\n\nPossible values:\n- `None`: the capture was accepted (`NoAttack`).\n- `Unknown`: the capture was rejected without a specific reason reported by the analysis.\n- `UntrustedEnvironment`: the capture was generated in an untrusted runtime environment.\n- `SuspiciousActivity`: the device showed activity patterns associated with an attack.\n- `UntrustedDevice`: the device could not be trusted to be what it claims to be.\n- `SdkIntegrityViolation`: the capture SDK or its libraries appear to have been tampered with.\n- `UntrustedCorruptedPayload`: the payload appears to be corrupted or tampered with.\n- `UntrustedContent`: an injection attack was detected.\n- `UntrustedContentLowConfidence`: signs of an injection attack were detected with lower confidence; the capture must still be treated as rejected.\n","enum":["None","Unknown","UntrustedEnvironment","SuspiciousActivity","UntrustedDevice","SdkIntegrityViolation","UntrustedCorruptedPayload","UntrustedContent","UntrustedContentLowConfidence"]},"transactionId":{"type":"string","format":"uuid","description":"Unique identifier of the evaluation (lowercase UUID v4). A new one is generated on every request, also when the same capture is retried."},"timestamp":{"type":"string","format":"date-time","description":"UTC instant at which the service started handling the request, in ISO-8601 format with milliseconds (`YYYY-MM-DDTHH:mm:ss.SSSZ`)."}}},"BadRequestResult":{"type":"object","description":"The request is not valid, the capture could not be processed, or the license of the service is not valid.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string","description":"Service error message or error normalized by Facephi.","oneOf":[{"$ref":"#/components/schemas/FacephiErrorMessage"},{"type":"string"}]},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"FacephiErrorMessage":{"type":"string","description":"Documented public error messages returned in HTTP 400 responses.\n\n- Capture that the analysis engine could not evaluate (the three capture endpoints): `NoneBecause*` values.\n- Capture rejected by the experimental replay mitigation (the three capture endpoints): `Replay attack detected`.\n- Unclassified failure of the analysis engine: `ErrorProcessing` (`POST /api/v1/iad/evaluate` and `POST /api/v1/iad/evaluate/custom`) or `ErrorFacialImage` (`POST /api/v1/iad/extract`).\n- License that stopped being valid while the service runs (the three capture endpoints): `Invalid license: <reason> (code: <code>)`. The capture is not analyzed.\n- Request validation on the three capture endpoints: `Empty multipart payload`, `Required multipart field 'capture' not found` and `Empty data in multipart field 'capture'`.\n- Request validation specific to `POST /api/v1/iad/evaluate/custom`: the `pipeline` and `calibration` messages.\n- Service not ready: `Service not initialized` and `Service not configured`.\n\nWhen the analysis engine does not respond, the capture endpoints answer HTTP 503 with `Engine communication error:` followed by the detail (see `ServiceUnavailableResult`). `GET /api/v1/iad/health` answers HTTP 503 when the service cannot handle evaluations.\n","enum":["NoneBecauseFaceTooClose","NoneBecauseFaceNotFound","NoneBecauseFaceTooSmall","NoneBecauseAngleTooLarge","NoneBecauseImageDataError","NoneBecauseLicenseError","NoneBecauseTooManyFaces","NoneBecauseFaceTooCloseToBorder","NoneBecauseFaceCropped","NoneBecauseFaceOccluded","NoneBecauseEyesClosed","Replay attack detected","ErrorProcessing","ErrorFacialImage","Empty multipart payload","Required multipart field 'capture' not found","Empty data in multipart field 'capture'","Required multipart field 'pipeline' not found","Invalid value for 'pipeline'; expected 'iad_r01' or 'iad_r00'","Invalid value for 'calibration'; expected 'regular' or 'hardened'","Service not initialized","Service not configured"]},"TimeStamp":{"type":"string","description":"UTC date and time in `%Y-%m-%dT%H:%M:%SZ` format (second precision)."},"UnauthorizedResult":{"type":"object","description":"The authentication token is missing or invalid.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string","description":"Reason for the rejection (`Missing authentication token`, `Authentication secret is not configured`, `JWT token is expired`, `JWT token is not yet valid`, `JWT token does not include exp claim` or `JWT token validation failed`). Use the HTTP status code, not the text, to make decisions."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"ExceptionResult":{"type":"object","description":"An unhandled internal error occurred.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string","description":"Description of the internal error."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"ServiceUnavailableResult":{"type":"object","description":"The service cannot handle the request right now. The capture endpoints return it when the analysis engine does not respond; `GET /api/v1/iad/health` returns it when the service cannot handle evaluations.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string","description":"Reason why the service is not available."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}},"responses":{"Unauthorized":{"description":"The authentication token is missing or invalid. Only returned when JWT authentication is enabled. The response includes the `WWW-Authenticate` header with the value `Bearer`.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResult"}}}},"PayloadTooLarge":{"description":"The request body exceeds `client_max_body_size`. This response is produced by the HTTP server before the request reaches the service, so it does not carry the standard Facephi error body."},"EngineUnavailable":{"description":"The analysis engine does not respond: its process has stopped, is blocked or does not answer in time. The capture was not evaluated; retry later.\n\n`message` is `Engine communication error:` followed by the detail: `Too many retries` when the engine still did not respond after the retries configured in `engine_max_retries`, or `Connection failed` or `Request timeout` when no retries are configured.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResult"}}}}}},"paths":{"/api/v1/iad/evaluate/custom":{"post":{"summary":"Evaluate a capture with an explicit pipeline","description":"Evaluates the capture like `POST /api/v1/iad/evaluate`, but with the analysis pipeline and calibration chosen by the client. The response and the errors are the same as for `/evaluate`, plus the validation of `pipeline` and `calibration`.\n\n- `pipeline` (required): `iad_r01` or `iad_r00`.\n- `calibration` (optional): `regular` (default) or `hardened`.\n- Both values are compared case-insensitively and ignoring leading and trailing whitespace. When `calibration` is missing or empty, `regular` is used.\n- Errors of the `capture` field are checked before those of `pipeline`.\n- In the deployment with the Facephi Docker image, `/evaluate` is equivalent to `iad_r01` with `regular`, and every combination is available without additional configuration. If a combination the analysis engine does not have available is requested, the response is HTTP 400 with `ErrorProcessing`.\n","operationId":"evaluateCaptureCustom","tags":["IAD"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["capture","pipeline"],"properties":{"capture":{"$ref":"#/components/schemas/BinaryData"},"pipeline":{"type":"string","description":"Analysis pipeline.","enum":["iad_r01","iad_r00"]},"calibration":{"type":"string","description":"Pipeline calibration.","enum":["regular","hardened"],"default":"regular"}}}}}},"responses":{"200":{"description":"Evaluation verdict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResult"}}}},"400":{"description":"Request or capture validation error. Besides the errors of `POST /api/v1/iad/evaluate`, this endpoint validates `pipeline` and `calibration`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"500":{"description":"An unhandled internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}},"503":{"$ref":"#/components/responses/EngineUnavailable"}}}}}}
```
