> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starkfi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create session

Use this step after the user has verified their **email** (OTP) or **wallet** (signed challenge). StarkFi returns session details you use to send the user to the hosted KYC experience.

<Info>
  Prerequisite: [Prepare](/prepare) + email OTP, or [Prepare wallet](/prepare-wallet). If identity is not verified yet, the API responds with **403** `identity_not_verified`.
</Info>

***

## Endpoint

```shellscript theme={null}
POST /kyc/create/verify_public_kyc
```

***

## Request body

Provide **email** or **wallet** (same identifier used in prepare):

| Field    | Type   | Required               | Description                        |
| -------- | ------ | ---------------------- | ---------------------------------- |
| `email`  | string | One of email or wallet | Same email used in prepare and OTP |
| `wallet` | string | One of email or wallet | Same wallet used in prepare-wallet |

### Example (email)

```shellscript theme={null}
curl --request POST \
  --url https://api.starkfi.io/kyc/create/verify_public_kyc \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api_key>' \
  --data '{"email":"user@example.com"}'
```

### Example (wallet)

```shellscript theme={null}
curl --request POST \
  --url https://api.starkfi.io/kyc/create/verify_public_kyc \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api_key>' \
  --data '{"wallet":"FmTGYpzX27fDqaiytXUdFVaphC5o68G61Q3uhVM2d8bm"}'
```

***

## Responses

### 201 — Session created or returned

```json theme={null}
{
  "statusCode": 201,
  "success": true,
  "status": "kyc_session_created",
  "message": "KYC session created",
  "data": {
    "success": true,
    "message": "didit_create_kyc_session",
    "session": {
      "session_id": "string",
      "session_url": "https://..."
    }
  }
}
```

The exact shape of `data` can vary when a session already exists or the user is already approved. Read **`session_url`** to open the hosted flow and **`session_id`** to correlate status checks.

### 403 — Identity not verified

```json theme={null}
{
  "statusCode": 403,
  "success": false,
  "status": "identity_not_verified",
  "message": "You must verify your email or wallet before starting KYC"
}
```

### 403 — User not prepared

```json theme={null}
{
  "statusCode": 403,
  "success": false,
  "status": "user_not_prepared",
  "message": "Complete KYC prepare and verify your email or wallet before starting a session"
}
```

### 429 — Quota exceeded

`status`: `verify_quota_exceeded` — monthly KYC session quota exhausted.

### 404 — Unsupported path

`status`: `method_not_found` — the `kyc_type` in the URL is not supported.

***

## Related

* [Getting started](/getting-started)
* [Get KYC status](/getting-status)
