Pont · Documentation
RéférenceAPI

E mail et alertes

SMTP et alertes configurables.

Lire la configuration SMTP

GET
/admin/email

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Response Body

Configuration.

application/json
  1. response
vault?boolean
configured*boolean
host*string|null
port*integer|null
security*|null
user*string|null
from*string|null
passwordSet*boolean

Le mot de passe n'est jamais renvoyé : seulement s'il existe.

curl -X GET 'http://localhost:8787/admin/email'
{  "vault": true,  "configured": true,  "host": "string",  "port": 0,  "security": "none",  "user": "string",  "from": "string",  "passwordSet": true}

Supprimer la configuration SMTP

DELETE
/admin/email

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Response Body

Supprimée.

application/json
  1. response
vault?boolean
configured*boolean
host*string|null
port*integer|null
security*|null
user*string|null
from*string|null
passwordSet*boolean

Le mot de passe n'est jamais renvoyé : seulement s'il existe.

curl -X DELETE 'http://localhost:8787/admin/email'
{  "vault": true,  "configured": true,  "host": "string",  "port": 0,  "security": "none",  "user": "string",  "from": "string",  "passwordSet": true}

Enregistrer la configuration SMTP

PUT
/admin/email

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Request Body

application/json
  1. body
host*string

Serveur SMTP.

Length1 <= length <= 255
port*integer

Port SMTP.

Range1 <= value <= 65535
security*string

none : sans chiffrement (réseau local) ; starttls : port 587 ; tls : port 465.

Value in"none""starttls""tls"
user?string

Identifiant SMTP.

Lengthlength <= 255
password?string

Mot de passe SMTP. Omis ou vide : l'ancien est conservé.

Lengthlength <= 1000
from*string

Adresse d'expédition : contact@exemple.bj ou Pont <contact@exemple.bj>.

Length3 <= length <= 255

Response Body

Configuration enregistrée.

application/json
  1. response
vault?boolean
configured*boolean
host*string|null
port*integer|null
security*|null
user*string|null
from*string|null
passwordSet*boolean

Le mot de passe n'est jamais renvoyé : seulement s'il existe.

curl -X PUT 'http://localhost:8787/admin/email' \  -H 'Content-Type: application/json' \  -d '{  "host": "smtp.exemple.bj",  "port": 587,  "security": "starttls",  "user": "contact@exemple.bj",  "from": "Pont <contact@exemple.bj>"}'
{  "vault": true,  "configured": true,  "host": "string",  "port": 0,  "security": "none",  "user": "string",  "from": "string",  "passwordSet": true}

Envoyer un e-mail de test

POST
/admin/email/test

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Request Body

application/json
  1. body
to*string
Formatemail

Response Body

E-mail envoyé.

application/json
  1. response
sent?boolean
curl -X POST 'http://localhost:8787/admin/email/test' \  -H 'Content-Type: application/json' \  -d '{  "to": "moi@exemple.bj"}'
{  "sent": true}

Envoyer un e-mail

POST
/admin/email/send

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Request Body

application/json
  1. body
to*string
Formatemail
subject*string
text*string
html?string

Response Body

E-mail envoyé.

application/json
  1. response
sent?boolean
curl -X POST 'http://localhost:8787/admin/email/send' \  -H 'Content-Type: application/json' \  -d '{  "to": "moi@exemple.bj",  "subject": "Bonjour",  "text": "Message de test."}'
{  "sent": true}

Lire les alertes

GET
/admin/alerts

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Response Body

Alertes.

application/json
  1. response
vault*boolean
emailConfigured*boolean
rules*array<>
recipients*array<>
lowBalanceThreshold*integer
history*array<>

50 dernières alertes.

curl -X GET 'http://localhost:8787/admin/alerts'
{  "vault": true,  "emailConfigured": true,  "rules": [    {      "id": "payment_failed",      "label": "string",      "description": "string",      "enabled": true    }  ],  "recipients": [    "user@example.com"  ],  "lowBalanceThreshold": 0,  "history": [    {      "id": "string",      "rule": "string",      "title": "string",      "detail": "string",      "at": 0,      "status": "sent",      "error": "string"    }  ]}

Configurer les alertes

PUT
/admin/alerts

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Request Body

application/json
  1. body
rules?

Règle activée ou non, par identifiant (payment_failed, webhook_failed, payout_stuck, low_balance, admin_login).

recipients?array<>

Destinataires, 20 au plus.

lowBalanceThreshold?integer

Seuil du compte de transit pour la règle low_balance.

Response Body

Alertes configurées.

application/json
  1. response
vault*boolean
emailConfigured*boolean
rules*array<>
recipients*array<>
lowBalanceThreshold*integer
history*array<>

50 dernières alertes.

curl -X PUT 'http://localhost:8787/admin/alerts' \  -H 'Content-Type: application/json' \  -d '{  "rules": {    "payment_failed": true,    "admin_login": true  },  "recipients": [    "moi@exemple.bj"  ],  "lowBalanceThreshold": 100000}'
{  "vault": true,  "emailConfigured": true,  "rules": [    {      "id": "payment_failed",      "label": "string",      "description": "string",      "enabled": true    }  ],  "recipients": [    "user@example.com"  ],  "lowBalanceThreshold": 0,  "history": [    {      "id": "string",      "rule": "string",      "title": "string",      "detail": "string",      "at": 0,      "status": "sent",      "error": "string"    }  ]}

Envoyer une alerte de test

POST
/admin/alerts/test

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Response Body

Alerte envoyée.

application/json
  1. response
sent?boolean
curl -X POST 'http://localhost:8787/admin/alerts/test'
{  "sent": true}

Signaler un événement

POST
/admin/alerts/events

Authorization

AdminToken
headerAuthorizationBearer <token>

PONT_ADMIN_TOKEN, pour les routes /admin.

Request Body

application/json
  1. body
rule*"admin_login"
Value in"admin_login"
detail?string

Response Body

Événement traité.

application/json
  1. response
curl -X POST 'http://localhost:8787/admin/alerts/events' \  -H 'Content-Type: application/json' \  -d '{  "rule": "admin_login",  "detail": "Connexion de ancien@exemple.bj"}'
{}