---
title: "Faça uma prova de vida"
product: "Lacuna Bio"
slug: "run-a-liveness-check"
language: "pt"
canonical_url: "https://try.lacunasoftware.com/pt/lacuna-bio/run-a-liveness-check"
docs_url: "https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/bio-sessions/liveness"
samples: []
samples_repo: "https://github.com/LacunaSoftware/RestBioSamples"
trace_recorded: "2026-10-12"
last_generated: "2026-10-12T15:24:28Z"
---

# Faça uma prova de vida

Verifique se há uma pessoa real diante da sua câmera com a prova de vida 3D da FaceTec, no widget de captura da Lacuna, direto no navegador: o Rest PKI Core, o serviço em nuvem da Lacuna, faz a verificação no servidor.

Live demo: [https://try.lacunasoftware.com/pt/lacuna-bio/run-a-liveness-check](https://try.lacunasoftware.com/pt/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.

### 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.
- 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)
- Docs: https://docs.lacunasoftware.com/pt-br/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
