> 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/rest-api/identity-api/identity-api-reference/onboarding/morphology.md).

# Morphology

Morphology services validate the physical authenticity of identity documents by analyzing their visual structure. They make it possible to detect forged, altered, or low-quality documents before processing the data they contain.

#### When to use it

Use it as a pre- or post-scan validation step for Document in onboarding flows where the quality and authenticity of the document are critical.

#### Available services

| Service                 | Description                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Document validation     | <p>Standard asynchronous flow for generic documents. The process is completed in three mandatory stages:</p><p><br></p><p>1. <code>POST /start</code>: Initialization of the process and image upload.</p><p><br></p><p>2. <code>POST /status</code>: Query the current validation status.</p><p><br></p><p>3. <code>POST /data</code>: Retrieval of the final result and extracted data.</p> |
| Document validation V2  | Optimized version of the asynchronous flow. It maintains the three-step structure (`POST`), but redefines the response of the endpoint `/data`. This version offers a cleaner data structure and, above all, much clearer and more specific rejection reasons, allowing better exception handling.                                                                                            |
| Document PAD Diagnostic | Presentation Attack Detection on document images. It detects whether someone is trying to validate a screen, a photocopy, or any kind of non-original reproduction.                                                                                                                                                                                                                           |

#### Note on response times

Morphological validation is a semi-automated process. The average time is 60 seconds and can reach up to 270 seconds. Design your integration with polling or webhooks; do not block the main thread while waiting for the response.
