# Core Methods

#### createApplicant

Creates a new KYC applicant record with the provider. The `externalUserId` should be your own internal user identifier — the provider uses it to deduplicate applicants across calls.

```
const applicant = await kycClient.createApplicant({
  externalUserId: "user-123",
  levelName: "basic-kyc-level",
  email: "alice@example.com",
  fixedInfo: {
    firstName: "Alice",
    lastName: "Test",
    country: "SGP",
    nationality: "SGP",
    dob: "1990-01-01",
  },
});
```

The `fixedInfo` block pre-fills identity fields so the end user is not asked to re-enter them during the hosted verification flow. All fields inside `fixedInfo` are optional — omit any you want the user to supply themselves.

#### createAccessToken

Mints a short-lived SDK token scoped to a single user and verification level. This token is what the frontend passes to the provider's hosted WebSDK to launch the verification UI.

```
const accessToken = await kycClient.createAccessToken({
  userId: "user-123",
  levelName: "basic-kyc-level",
  ttlInSecs: 600,
  lang: "en",
});
```

**Note:** Only return the token string and minimal metadata to the frontend. Never expose your `appToken` or `secretKey` to the client side.

#### getApplicantStatus

Retrieves the current verification status for a given applicant. Pass the provider-side applicant ID (returned by `createApplicant`).

```
const status = await kycClient.getApplicantStatus("sumsub-applicant-id");
```

Common response fields:

* `reviewStatus` — the current stage of the review (e.g. `pending`, `completed`).
* `reviewResult.reviewAnswer` — the final decision (`GREEN`, `RED`, or `RETRY`).
* `reviewResult.rejectLabels` — an array of reasons if the applicant was rejected.


---

# 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://city-protocol.gitbook.io/docs/software-development-kit/kyc/core-methods.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.
