# Oz API Key Concepts

The Oz API is a comprehensive Rest API that enables facial biometrics, allowing for both face matching and liveness checks. This write-up provides an overview of the essential concepts that one should keep in mind while using the Oz API.

### Authentication, Roles, and Access Management

To ensure security, every Oz API call requires an access token in its HTTP headers. To obtain this token, execute the `POST /api/authorize/auth` method with login and password provided by us. Pass this token in `X-Forensics-Access-Token` header in subsequent Oz API calls.

[This article](/oz-knowledge/guides/developer-guide/api/oz-api/use-cases/authentication.md) provides comprehensive details on the authentication process. Kindly refer to it for further information.

Furthermore, the Oz API offers distinct user roles, ranging from `CLIENT`, who can perform checks and access reports but lacks administrative rights, e.g., deleting folders, to `ADMIN`, who enjoys nearly unrestricted access to all system objects. For additional information, please consult [this guide](/oz-knowledge/guides/developer-guide/api/oz-api/user-roles.md).

### Persistence

The unit of work in Oz API is a **folder**: you can upload interrelated media to a folder, run analyses on them, and check for the aggregated result. A folder can contain the unlimited number of media, and each of the media can be a target of several analyses. Also, analyses can be performed on a bunch of media.

<figure><img src="/files/vUCRIvpFlFAnjSKPlyLJ" alt=""><figcaption></figcaption></figure>

### &#x20;Media Types and Tags

Media OZ API works with photos and videos. Video can be either a regular video container, e.g., MP4 or MOV, or a ZIP archive with a sequence of images. Oz API uses the file mime type to define whether media is an image, a video, or a shot set.

It is also important to determine the semantics of a content, e.g., if an image is a photo of a document or a selfie of a person. This is achieved by using tags. The selection of tags impacts whether specific types of analyses will recognize or ignore particular media files. The most important tags are:

* `photo_id_front` – for the front side of a photo ID
* `photo_selfie` – for a non-document reference photo
* `video_selfie_blank` – for a liveness video recorded beyond Oz Liveness SDK
* if a media file is captured using the Oz Liveness SDK, the tags are assigned automatically.&#x20;

The full list of Oz media tags with their explanation and examples can be found [here](/oz-knowledge/guides/developer-guide/api/oz-api/media-tags.md).

### Asynchronous analyses

Since video analysis may take a few seconds, the analyses are performed asynchronously. This implies that you initiate an analysis (`/api/folders/{{folder_id}}/analyses/`) and then monitor the outcomes by polling until processing is complete (`/api/analyses/{{analyse_id}}` for a single analysis or `/api/folders/{{folder_id}}/analyses/` for all folder’s analyses). Alternatively, there is a webhook option available. To see an example of how to use both the polling and webhook options, please check [this guide](/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness.md#processing-steps).

These were the key concepts of Oz API. To gain a deeper understanding of its capabilities, please refer to the [Oz API section](/oz-knowledge/guides/developer-guide/api/oz-api.md) of our developer guide.

<br>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.ozforensics.com/oz-knowledge/general/readme/oz-api-key-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
