---
title: Capture API
canonical: https://developer.unico.io/dual-api/developers/sdks-and-tools/ios/api-reference/capture-api
locale: en
generated_by: markdown-export
---

## Methods to start a session

| Method | Description |
|---|---|
| `prepareSelfieCamera(_:config:)` | Prepares the selfie camera |
| `prepareSelfieCamera(_:config:prepareInfo:)` | Prepares the selfie camera with `PrepareInfo` metadata |
| `prepareDocumentCamera(_:config:)` | Prepares the document camera |
| `open(_:)` | Opens the prepared selfie camera |
| `open(_:webAppToken:)` | Opens the selfie camera for a User Journey, passing the journey token |
| `openDocument(_:delegate:)` | Opens the prepared document camera with a `DocumentEnums` |

## Capture options / parameters

**`PrepareInfo`** — metadata to identify the user session.

| Field | Type | Required | Description |
|---|---|---|---|
| `externalUserId` | `String` | yes | User identifier within your system. Hashed with SHA-256 before transmission. |
| `useCase` | `String` | no | Identifier for the context or flow currently running. Transmitted in plain text. |

**`DocumentEnums`** — see [Enums](/developers/sdks-and-tools/ios/api-reference/enums).

## Result types and fields

**`SelfieResult`** — object returned on successful selfie capture.

| Field | Type | Description |
|---|---|---|
| `base64` | `String` | Captured image in Base64 |
| `encrypted` | `String` | JWT to be sent to the backend |

**`DocumentResult`** — object returned on successful document capture. Same fields as `SelfieResult`.