> For the complete documentation index, see [llms.txt](https://k4k3ru.gitbook.io/k4k3ru-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k4k3ru.gitbook.io/k4k3ru-docs/api/crm/create-account-with-email-otp.md).

# Create an Account with an Email OTP

Create a K4K3RU account and its email credential by submitting the one-time password (OTP) sent to the user's email address.

Request an OTP with [Request a Sign-Up OTP by Email](/k4k3ru-docs/api/crm/request-sign-up-otp.md) before calling this method.

## Endpoint

| Property       | Value                           |
| -------------- | ------------------------------- |
| URL            | `https://api.k4k3ru.com/`       |
| HTTP method    | `POST`                          |
| RPC method     | `AccountEmail.CreateCredential` |
| Authentication | Not required                    |

## Request

### Request Body

This method uses the common [JSON-RPC request envelope](/k4k3ru-docs/api/json-rpc.md#request-envelope). Set `method` to `AccountEmail.CreateCredential`.

### Params Fields

The request envelope's `params` object accepts:

| Field   | Type   | Required | Description                                         |
| ------- | ------ | -------- | --------------------------------------------------- |
| `email` | string | Yes      | Email address used when requesting the sign-up OTP. |
| `code`  | string | Yes      | OTP sent to the email address.                      |

### Example Request

```bash
curl --request POST 'https://api.k4k3ru.com/' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "1",
    "method": "AccountEmail.CreateCredential",
    "params": {
      "email": "alex@example.com",
      "code": "052784"
    }
  }'
```

## Response

### Response Body

Successful requests use the common [JSON-RPC success response envelope](/k4k3ru-docs/api/json-rpc.md#success-response-envelope). Failed requests use the common [JSON-RPC error response envelope](/k4k3ru-docs/api/json-rpc.md#error-response-envelope).

### Result Fields

| Field        | Type   | Description                                                                                   |
| ------------ | ------ | --------------------------------------------------------------------------------------------- |
| `accountId`  | string | Unique identifier of the created account.                                                     |
| `status`     | string | Account email credential status. A successful creation currently returns `active`.            |
| `email`      | string | Email address associated with the credential.                                                 |
| `otpPurpose` | string | Purpose of the verified OTP. For this method, the value is `account.email.create_credential`. |
| `bonusTicks` | number | Number of signup bonus ticks credited to the account.                                         |

### Errors

| Code                | When it occurs                                                                                       |
| ------------------- | ---------------------------------------------------------------------------------------------------- |
| `invalid_parameter` | The `params` object cannot be decoded into the expected request parameters.                          |
| `already_created`   | An active email credential already exists for the email address.                                     |
| `not_found`         | No usable sign-up OTP exists for the email address.                                                  |
| `unsupported`       | The supplied OTP code does not match the requested OTP.                                              |
| `unexpected`        | The request cannot be completed because of an unexpected validation, processing, or storage failure. |

### Example Success Response

```json
{
  "id": "1",
  "result": {
    "accountId": "1786180518874776239",
    "status": "active",
    "email": "alex@example.com",
    "otpPurpose": "account.email.create_credential",
    "bonusTicks": 10000000
  }
}
```

The `accountId` and `bonusTicks` values shown above are examples. Use the values returned by the API.

### Example Error Response

```json
{
  "id": "1",
  "error": {
    "code": "not_found"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://k4k3ru.gitbook.io/k4k3ru-docs/api/crm/create-account-with-email-otp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
