> ## 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 KYC session

> Create or resume a Didit verification session after the user email is verified.

<ParamField header="x-api-key" type="string" required placeholder="your-api-key">
  Your StarkFi API key when required by your environment.
</ParamField>

<ParamField path="kyc_type" type="string" required>
  Verification flow. Use **`verify_public_kyc`** for the public Didit integration.
</ParamField>

<ParamField body="email" type="string">
  Same email used in prepare and OTP. Provide **email** or **wallet** (not both required, but at least one).
</ParamField>

<ParamField body="wallet" type="string">
  Same wallet used in prepare-wallet. Provide **wallet** or **email**.
</ParamField>

<RequestExample>
  ```bash cURL 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"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.starkfi.io/kyc/create/verify_public_kyc",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "x-api-key": "<api_key>",
      },
      body: JSON.stringify({ email: "user@example.com" }),
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.starkfi.io/kyc/create/verify_public_kyc",
      headers={"Content-Type": "application/json", "x-api-key": "<api_key>"},
      json={"email": "user@example.com"},
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 201 - Success 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://..."
      }
    }
  }
  ```

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

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

  ```json 429 - Quota exceeded theme={null}
  {
    "statusCode": 429,
    "success": false,
    "status": "verify_quota_exceeded",
    "message": "Monthly verify quota exceeded"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "statusCode": 404,
    "success": false,
    "status": "method_not_found",
    "message": "Method provided not found"
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "statusCode": 500,
    "success": false,
    "status": "server_failed",
    "message": "Server failed on KYC"
  }
  ```
</ResponseExample>

### Response

<ResponseField name="data" type="object">
  Payload returned by the KYC session builder. Commonly includes **`session`** with identifiers and a hosted **`session_url`** when a new flow is issued. Exact fields may vary when a session already exists or the user is already approved.
</ResponseField>
