# API Reference

## Send verification code

<mark style="color:green;">`POST`</mark> `https://ev.apis.paypi.dev/sendCode`

This request send's a code to the given email address, which should be returned to check it is correct.&#x20;

All emails are sent from `emailverify@paypi.dev`

#### Headers

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | PayPI subscriber secret in `Bearer <token>` format |

#### Request Body

| Name                                    | Type   | Description                                        |
| --------------------------------------- | ------ | -------------------------------------------------- |
| email<mark style="color:red;">\*</mark> | string | The email address to send the verification code to |

{% tabs %}
{% tab title="200: OK Success - Email sent" %}

```javascript
{
    success: true,
    message: "Verification email sent"
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid or incorrectly formatted email given" %}

```javascript
{
    success: false,
    message:
      "Unable to send email - please check the email address and try again"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```javascript
{
    success: false,
    message: "Authorization header value invalid"
}
```

{% endtab %}
{% endtabs %}

## Check verification code

<mark style="color:green;">`POST`</mark> `https://ev.apis.paypi.dev/checkCode`

Checks the user's emailed code is valid.&#x20;

If this returns `success=true`, you can safely assume the user you are interacting with is the owner of that email address.

#### Headers

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | PayPI subscriber secret in `Bearer <token>` format |

#### Request Body

| Name                                    | Type   | Description                                 |
| --------------------------------------- | ------ | ------------------------------------------- |
| email<mark style="color:red;">\*</mark> | string | The email address to check the code against |
| code<mark style="color:red;">\*</mark>  | string | The 6 digit code given by the user.         |

{% tabs %}
{% tab title="200: OK Success - Code Correct" %}

```javascript
{
      success: true,
      message: "email successfully verified"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```javascript
{
    success: false,
    message: "Authorization header value invalid",
}
```

{% endtab %}

{% tab title="200: OK Unable to verify email - Code incorrect" %}

```javascript
{
    success: false,
    message: "Given code is not valid"
}
```

{% endtab %}

{% tab title="403: Forbidden Tries Exceeded" %}
To prevent abuse and brute forcing, we limit the number of checkCode requests for each email address to 20.&#x20;

This means if more than 20 requests are made you will have to send another code to your user, this will reset the limit.

```javascript
{
    success: false,
    message: "Number of tries exceeded, please request a new code"
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/L2a3aSMAllpZY1WCLzlm" %}


---

# 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://emailverify.paypi.dev/api-reference.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.
