> 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/midapi-v2/daf/consultar-estado.md).

# Check status (polling)

Check the status of a DAF transaction until it reaches a terminal status. While the transaction has not finished, the response contains only the identifier and the status. When a terminal status with diagnosis is reached, it also includes the [result response](/docs.facephi-en/rest-api/midapi-v2/daf/respuesta-de-resultado.md) full.

### Endpoint

```
GET /v2/daf/{transactionId}
```

### Headers

| Name              | Type   | Required | Description                                                                                                             |
| ----------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Authorization** | string | **Yes**  | Consumer Token in format `Bearer <token>` (see [Authentication](/docs.facephi-en/rest-api/midapi-v2/autenticacion.md)). |
| **consumer-id**   | string | **Yes**  | Consumer identifier.                                                                                                    |
| **operation-id**  | string | **Yes**  | Identifier of the business operation/session.                                                                           |

### Path parameters

| Parameter       | Type   | Required | Description                                                 |
| --------------- | ------ | -------- | ----------------------------------------------------------- |
| `transactionId` | string | **Yes**  | Transaction identifier returned by `POST /v2/daf/validate`. |

### Responses

#### `200` Success (transaction in progress)

```json
{
  "transactionId": "1c7d...e9",
  "status": "IN_PROGRESS"
}
```

#### `200` Success (terminal transaction)

When the transaction reaches a terminal status with diagnosis (`COMPLETED`), the response also includes the full diagnosis. See [Result response](/docs.facephi-en/rest-api/midapi-v2/daf/respuesta-de-resultado.md).

### Transaction statuses

| Status        | Meaning                                                                        | Terminal? |
| ------------- | ------------------------------------------------------------------------------ | --------- |
| `PROCESSED`   | The transaction was created and accepted for processing.                       | No        |
| `ERROR`       | The transaction could not be created/started (failure in the initial request). | Yes       |
| `IN_PROGRESS` | Validation is in progress.                                                     | No        |
| `COMPLETED`   | There is a diagnosis available (`APPROVED` or `DECLINED`).                     | Yes       |
| `FAILED`      | Irrecoverable failure during processing. Includes `failureReason`.             | Yes       |

{% hint style="info" %}
The terminal status `COMPLETED` is unique to any result with diagnosis: the consumer cannot know and does not need to know which specific validations were run internally. In the presence of `ERROR` or `FAILED`, there will be no `diagnostic` nor `ocr` in the response. The status `FAILED` does include `failureReason` and `timestamp`.
{% endhint %}

### failureReason

When `status = FAILED`, the field `failureReason` describes the cause of the failure with a **generic and stable**. The internal technical detail is not exposed; these are the possible values:

| failureReason                             | Meaning / recommended action                                                                                                                                                                                       |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Validation could not be completed`       | Transient processing failure (e.g. an analysis service did not respond in time or returned an error). It is safe **to retry** by starting a new transaction with the same assets; if it persists, contact support. |
| `Internal processing error`               | Unexpected error during processing. Retry later; if it persists, contact support.                                                                                                                                  |
| `Asset not found in storage: <fileKey>`   | One of the referenced assets could not be resolved. Verify that the `fileKeys` exist and were uploaded correctly before retrying.                                                                                  |
| `Invalid <front\|back\|face> asset token` | The indicated asset is not a valid capture token. Capture/upload that asset again and restart the process.                                                                                                         |

{% hint style="info" %}
`failureReason` is intentionally **generic**: different internal causes (including analysis timeouts) are aggregated in `Validation could not be completed`. The concrete detail remains in the service's internal logs; if you need to diagnose a case, share it with support together with the `transactionId`.
{% endhint %}
