# 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](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/use-cases/authentication) 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](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/user-roles).

### 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="https://2532558063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5g6dgsxRbyrCvB0uAf8f%2Fuploads%2FJxx0asFR031C1M1KYPuo%2Fer%20api%20basics%20New.drawio%20(1).png?alt=media&#x26;token=51156a9a-3ca2-447c-a901-8fbee730f6b0" 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](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/media-tags).

### 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](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness#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](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api) of our developer guide.

<br>
