---
title: "Realizar una prueba de vida"
product: "Lacuna Bio"
slug: "run-a-liveness-check"
language: "es"
canonical_url: "https://try.lacunasoftware.com/es/lacuna-bio/run-a-liveness-check"
docs_url: "https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/bio-sessions/liveness"
samples: []
samples_repo: "https://github.com/LacunaSoftware/RestBioSamples"
trace_recorded: "2026-10-12"
last_generated: "2026-11-10T22:45:25Z"
---

# Realizar una prueba de vida

Compruebe que hay una persona real delante de su cámara con la prueba de vida 3D de FaceTec, en el widget de captura de Lacuna, directamente en el navegador: Rest PKI Core, el servicio en la nube de Lacuna, realiza la comprobación en el servidor.

Live demo: [https://try.lacunasoftware.com/es/lacuna-bio/run-a-liveness-check](https://try.lacunasoftware.com/es/lacuna-bio/run-a-liveness-check). It runs against Lacuna's real products; this page describes it for AI coding agents.

## Call sequence

Recorded on 2026-10-12 against the real products with Lacuna's public test certificates and data. Keys, tokens, sessions, ids, file contents and personal data are masked.

Recorded up to the capture widget: the face capture and the session's completion need a real face, so they are not shown yet.

### 1. Rest PKI Core starts a liveness session with the page's origin as the trusted origin, PreferMobile and FaceTec's 3D liveness pinned, and the browser gets the session URL alone.

On the server: `IRestBioService.StartLivenessSessionAsync`

`POST https://core.pki.rest/api/bio/sessions/liveness` → 200

Request:

```json
{
  "CaptureIdentificationDocument": false,
  "FaceCaptureProvider": 1,
  "TrustedOrigin": "https://try.lacunasoftware.com/",
  "PlatformPreference": 2
}
```

Response:

```json
{
  "sessionType": "Liveness",
  "sessionId": "***",
  "sessionUrl": "***"
}
```

### 2. Lacuna's capture widget opens the session URL over the page and gives back a ticket to complete the session with; the capture needs a person, so it and the completion are not recorded.

In the browser: `widget.performBioSession(sessionUrl)`

## Patterns to copy

- Server, browser, server: your server starts the liveness session and hands the browser only the session URL; Lacuna's capture widget (`performBioSession`) hands back only a ticket; your server completes the session and reads the outcome, so the result never comes from the browser. Treat the session URL and the ticket as credentials: never log or show them.
- On the start request, set `TrustedOrigin` to your page's scheme and host and `PlatformPreference` to `PreferMobile`, and pin `FaceCaptureProvider = FaceTecLiveness3d` rather than leave it to the subscription's default.
- Read the outcome from the completion's `FaceLivenessStatus.Success`: there is no score. Don't fetch the session's result data unless you need it: on a pass it holds the captured face.
- For evidence of a pass, read the session's details (`GET api/bio/sessions/{id}`, a `BioLivenessSessionModel`; the key needs the role to view bio sessions): its times and each FaceTec attempt with its date and result. Treat a failed read as no evidence, not as a failed check, and keep the client IP and user agent it also carries out of what you show.
- The session URL must be opened within 5 minutes and a capture can last 30, so put no timeout on the widget call; complete promptly, or Rest PKI Core answers `ApiSessionExpired`. When the widget returns both a ticket and a failure code, the failure code wins.

## Links

- Live demo: https://try.lacunasoftware.com/en/lacuna-bio/run-a-liveness-check (Portuguese: https://try.lacunasoftware.com/pt/lacuna-bio/run-a-liveness-check; Spanish: https://try.lacunasoftware.com/es/lacuna-bio/run-a-liveness-check)
- Docs: https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/bio-sessions/liveness
- Samples: https://github.com/LacunaSoftware/RestBioSamples
- Every demo: https://try.lacunasoftware.com/llms.txt and https://try.lacunasoftware.com/demos.json
