> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api.md).

# Oz API

<figure><img src="https://2532558063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5g6dgsxRbyrCvB0uAf8f%2Fuploads%2FwlYYK4AngBwGewdef7Wj%2Fcomponents-public-apiall.svg?alt=media&amp;token=275012f9-0670-4521-b2e2-7831a9d865b9" alt=""><figcaption></figcaption></figure>

Oz API is the most important component of the system – it connects all the other components together, and it is the unified REST interface you call to run **Liveness** and **Biometry** analyses. Oz API:

* provides the unified REST API interface to run the Liveness and Biometry analyses,
* processes authorization and user-permission management,
* tracks and records requested orders and analyses to the database (for example, in 6.0 the database size for 100 000 orders with analyses is \~4 GB),
* archives the inbound media files,
* collects telemetry from connected mobile apps,
* provides settings for specific device models,
* generates reports with analyses' results.

For the latest API methods collection, please refer to our [API reference](https://apidoc.ozforensics.com/).

### Persistent and non-persistent (Instant) modes

Oz API runs the same analyses in two modes that differ mostly in **what is stored**:

|                | Persistent (`/api/folders/`)                                                                  | Non-persistent – Instant API (`/api/instant/folders/`)                                                                                                                                                                                      |
| -------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| What is stored | Creates a folder; media, analyses, results, and reports are stored and can be retrieved later | Nothing is stored – the result exists only in the HTTP response. However, you can [set up S3 storage to save the Instant API artifacts](/oz-knowledge/guides/administrator-guide/how-to-save-artifacts-to-s3-storage-using-instant-api.md). |
| Best for       | Case history, the Web Console, reports, webhooks, re-analysis                                 | Sensitive data, GDPR compliance, a minimal storage footprint                                                                                                                                                                                |

Instant API is part of Oz API, not a separate product: it exposes the same analyses through a non-persistent endpoint, and it supports both submission modes described below.

### Single request and multi-request

You can submit your media and analyses in two ways, available in both the persistent and Instant modes:

* [**Single request**](/oz-knowledge/guides/developer-guide/api/oz-api/single-request.md) – send all the media together with the analysis request in one call and receive the results in the same response. This removes the need for multiple API calls – one is sufficient. Introduced in API 6.0.
* **Multi-request** – create the folder, upload the media, assign the analyses, and then poll for the result or receive it via a webhook. Use this for larger media, deferred analysis, or operator review.

### OzCapsula secure capture

For maximum protection of the captured media, the Oz SDKs can pack a capture into [**OzCapsula**](/oz-knowledge/guides/developer-guide/api/oz-api/ozcapsula-data-container.md) – a proprietary, encrypted, integrity-protected data container tied to a single capture session by a short-lived `session_token`. The container is an opaque blob: it is forwarded to the API as-is (with `Content-Type: application/octet-stream`) and validated server-side, which defends against injection, tampering, and replay of the captured data.

{% hint style="info" %}
OzCapsula containers are currently submitted **only via single request** – on either `POST /api/folders/` (persistent) or `POST /api/instant/folders/` (Instant).
{% endhint %}

### Authentication

Oz API calls are [authorized](/oz-knowledge/guides/developer-guide/api/oz-api/use-cases/authentication.md) with a token passed in the `X-Forensic-Access-Token` header. You obtain it by logging in with credentials or by using a long-lived **service token** for server-to-server integrations. Instant API can optionally be run without authorization.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
