# Gateways

## Email gateway object

Own email gateway:\
Now supported only SMTP provider.

```json
{
  "id": 2,
  "leasable": false,
  "label": "Paas gate",
  "provider": "smtp",
  "params": {
    "default_from_address": "no-reply@domain.tld",
    "mail.smtp.user": null,
    "mail.smtp.password": null,
    "mail.smtp.host": "localhost",
    "mail.smtp.port": 25,
    "mail.smtp.ssl.port": 465,
    "mail.smtp.ssl.trust_all_hosts": false,
    "mail.smtp.auth": true,
    "mail.debug": false,
    "mail.smtp.starttls.enable": false,
    "mail.smtp.starttls.required": false,
    "mail.smtp.use_ssl": false,
    "mail.smtp.timeout": 60000,
    "mail.smtp.connectiontimeout": 60000,
    "mail.transport.protocol": "smtp"
  }
}
```

Leasable email gateway:

```json
{
  "id": 1,
  "label": "Platform gate",
  "default_from_address": "no-reply@domain.tld"
}
```

## API actions

API path: `panel/gateways/email`.

### list

Gets list of available email gateways for the panel.

*required permissions*: `email_gateways: "read"`.

#### Parameters

Only session `hash`.

#### Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/panel/gateways/email/list' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "fa7bf873fab9333144e171372a321b06"}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/panel/gateways/email/list?hash=fa7bf873fab9333144e171372a321b06
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true,
  "bound_gateway": 2,
  "own": [
    {
      "id": 1,
      "leasable": false,
      "label": "Paas gate",
      "provider": "smtp",
      "params": {
        "default_from_address": "no-reply@domain.tld",
        "mail.smtp.user": null,
        "mail.smtp.password": null,
        "mail.smtp.host": "localhost",
        "mail.smtp.port": 25,
        "mail.smtp.ssl.port": 465,
        "mail.smtp.ssl.trust_all_hosts": false,
        "mail.smtp.auth": true,
        "mail.debug": false,
        "mail.smtp.starttls.enable": false,
        "mail.smtp.starttls.required": false,
        "mail.smtp.use_ssl": false,
        "mail.smtp.timeout": 60000,
        "mail.smtp.connectiontimeout": 60000,
        "mail.transport.protocol": "smtp"
      }
    }
  ],
  "leasable": [
    {
      "id": 2,
      "label": "Default",
      "provider": "mandrill_smtp",
      "default_from_address": "no-reply@x-gpsmail.com"
    }
  ]
}
```

#### Errors

[General](https://github.com/SquareGPS/navixy-api/blob/master/docs/user-api/backend-api/getting-started/errors.md#error-codes) types only.


---

# 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://navixy.com/docs/navixy-api/panel-api/resources/gateways.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.
