# Paymail

Paymail is a alias protocol that let's users pick a easier identifiable address (such as <sato@relysia.com>) and increases computational efficiency due with the peer-to-peer (P2P) approach.

P2P means that instead of the receiver needing to search the blockchain for a incoming transactions (potentially among billions), the receiver gets directly the transaction bundle which the receiver then submits to the miners and to instantly get a payment confirmation.&#x20;

To add your own paymail domain to your dedicated server (with a serviceID), you need to append to the your-domain.com/.well-known/bsvalias path the following json file.

```
{"bsvalias":"1.0","capabilities":{"6745385c3fc0":false,"pki":"https://api.relysia.com/v1/bsvalias/id/{alias}@{domain.tld}","paymentDestination":"https://api.relysia.com/v1/bsvalias/address/{alias}@{domain.tld}","a9f510c16bde":"https://api.relysia.com/v1/bsvalias/verifypubkey/{alias}@{domain.tld}/{pubkey}","5f1323cddf31":"https://api.relysia.com/v1/bsvalias/receive-transaction/{alias}@{domain.tld}","2a40af698840":"https://api.relysia.com/v1/bsvalias/p2p-payment-destination/{alias}@{domain.tld}"}}
```

you find examples of the entry at all major wallets, including <https://relysia.com/.well-known/bsvalias>. Once you added the entry to your domain & set up the serviceId with given domain, your paymail will be active.&#x20;

## Get paymail Id details

<mark style="color:blue;">`GET`</mark> `https://api.relysia.com/v1/paymail/:paymailId`

Get a paymail account details.

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| paymailId<mark style="color:red;">\*</mark> | string |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Operation successful",
    "paymailDetails": {
      "walletID": "ec4ae905-c5ef-41bd-adfb-4db361093245",
      "paymailId": "1325@relysia.com"
    }
  }
}
```

{% endtab %}
{% endtabs %}

you can change your paymail to any of your personalized choice, but each paymail should be unique so before setting your personalized paymail we will check if already not exists in our system.

## Update paymail

<mark style="color:orange;">`PUT`</mark> `https://api.relysia.com/v1/paymail`

Set a paymail to your personalized choice

#### Headers

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| walletID | string |             |

#### Request Body

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| newPaymailId<mark style="color:red;">\*</mark> | string |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "operation completed successfully !",
    "paymail": "new-personalized-paymail@relysia.com"
  }
}
```

{% endtab %}
{% endtabs %}

## Activate/Deactivate paymail

<mark style="color:green;">`POST`</mark> `https://api.relysia.com/v1/paymail/activate`

If you want to change your paymail status you can use this endpoint

#### Headers

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| walletID | string |             |

#### Request Body

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| activate | boolean |             |

{% tabs %}
{% tab title="200: OK Activate paymail" %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "paymail activated now"
  }
}
```

{% endtab %}

{% tab title="200: OK Deactivate paymail" %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "paymail deactivated now"
  }
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.relysia.com/utility/paymail.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.
