Référence REST
REST · Hébergement et abonnements
Hébergeurs de serveurs, clés d’API, nœuds, offres, boosts, plans et paiements.
Hébergement — /api/hosting
Réservé aux hébergeurs enregistrés : un hébergeur déclare ses nœuds (base de données, média), publie des offres, et alloue des ressources aux serveurs qui les choisissent.
Enregistre un hébergeur.
POST https://gateway.alfychat.app/api/hosting/providers/register
Corps JSON
| name | longueur 2–100 | obligatoire |
| obligatoire | ||
| slug | format imposé | obligatoire |
| website_url | URL | facultatif |
| country_code | longueur 2–2 | facultatif |
Erreurs
- 409Email ou slug déjà utilisé
- 409Vous avez déjà un compte hébergeur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/providers/register" \
-H "Content-Type: application/json" \
-d '{"name":"…","email":"…","slug":"…"}'Profil de l'hébergeur courant.
GET https://gateway.alfychat.app/api/hosting/providers/me
Erreurs
- 404Hébergeur introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/providers/me" \
-H "Authorization: Bearer $ACCESS_TOKEN"Serveurs hébergés par l'hébergeur.
GET https://gateway.alfychat.app/api/hosting/providers/servers
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/providers/servers" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée une clé d'API d'hébergeur.
POST https://gateway.alfychat.app/api/hosting/apikeys
Corps JSON
| name | longueur 2–100 | obligatoire |
| permissions | tableau | obligatoire |
| expires_in_days | MinMax | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/apikeys" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","permissions":"…","expires_in_days":"…"}'Liste les clés d'API.
GET https://gateway.alfychat.app/api/hosting/apikeys
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/apikeys" \
-H "Authorization: Bearer $ACCESS_TOKEN"Révoque une clé d'API.
DELETE https://gateway.alfychat.app/api/hosting/apikeys/{keyId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/apikeys/<keyId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Déclare un nœud de base de données.
POST https://gateway.alfychat.app/api/hosting/nodes/db
Corps JSON
| label | longueur 2–100 | obligatoire |
| host | NotEmpty | obligatoire |
| port | MinMax | facultatif |
| db_name | NotEmpty | obligatoire |
| db_user | NotEmpty | obligatoire |
| db_password | longueur ≥ 6 | obligatoire |
| max_servers | Min | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/nodes/db" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"label":"…","host":"…","db_name":"…","db_user":"…","db_password":"…"}'Liste les nœuds de base de données.
GET https://gateway.alfychat.app/api/hosting/nodes/db
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/nodes/db" \
-H "Authorization: Bearer $ACCESS_TOKEN"Signal de vie d'un nœud de base de données.
PATCH https://gateway.alfychat.app/api/hosting/nodes/db/{nodeId}/heartbeat
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/hosting/nodes/db/<nodeId>/heartbeat" \
-H "Authorization: Bearer $ACCESS_TOKEN"Retire un nœud de base de données.
DELETE https://gateway.alfychat.app/api/hosting/nodes/db/{nodeId}
Erreurs
- 404Nœud introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/nodes/db/<nodeId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Déclare un nœud média.
POST https://gateway.alfychat.app/api/hosting/nodes/media
Corps JSON
| label | longueur 2–100 | obligatoire |
| endpoint_url | URL | obligatoire |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/nodes/media" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"label":"…","endpoint_url":"…"}'Liste les nœuds média.
GET https://gateway.alfychat.app/api/hosting/nodes/media
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/nodes/media" \
-H "Authorization: Bearer $ACCESS_TOKEN"Signal de vie d'un nœud média.
PATCH https://gateway.alfychat.app/api/hosting/nodes/media/{nodeId}/heartbeat
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/hosting/nodes/media/<nodeId>/heartbeat" \
-H "Authorization: Bearer $ACCESS_TOKEN"Retire un nœud média.
DELETE https://gateway.alfychat.app/api/hosting/nodes/media/{nodeId}
Erreurs
- 404Nœud introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/nodes/media/<nodeId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Publie une offre d'hébergement.
POST https://gateway.alfychat.app/api/hosting/offers
Corps JSON
| name | longueur 2–100 | obligatoire |
| slug | format imposé | obligatoire |
| tier | ∈ {free, starter, standard, premium, enterprise} | obligatoire |
| price_monthly | Min | obligatoire |
| price_yearly | Min | facultatif |
| currency | longueur 3–3 | facultatif |
| limits | objet | obligatoire |
| features | tableau | obligatoire |
| boost_type | ∈ {admin_only, users, mixed} | facultatif |
Erreurs
- 409Slug déjà utilisé par cet hébergeur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/offers" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","slug":"…","tier":"…","price_monthly":"…","limits":"…","features":"…"}'Offres d'hébergement publiques.
GET https://gateway.alfychat.app/api/hosting/offers
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/offers"Modifie une offre.
PUT https://gateway.alfychat.app/api/hosting/offers/{offerId}
Succès : 200
curl -X PUT "https://gateway.alfychat.app/api/hosting/offers/<offerId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Supprime une offre.
DELETE https://gateway.alfychat.app/api/hosting/offers/{offerId}
Erreurs
- 404Offre introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/offers/<offerId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Alloue des ressources d'hébergement à un serveur.
POST https://gateway.alfychat.app/api/hosting/allocate
Corps JSON
| server_id | UUID | obligatoire |
| offer_id | UUID | facultatif |
| creator_lat | MinMax | facultatif |
| creator_lon | MinMax | facultatif |
| preferred_hoster_id | UUID | facultatif |
Succès : 201, 409
curl -X POST "https://gateway.alfychat.app/api/hosting/allocate" \
-H "Content-Type: application/json" \
-d '{"server_id":"…"}'Allocation courante d'un serveur.
GET https://gateway.alfychat.app/api/hosting/allocate/{serverId}
Erreurs
- 404Allocation introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/allocate/<serverId>"Booste un serveur.
POST https://gateway.alfychat.app/api/hosting/boosts/{serverId}
Corps JSON
| boost_type | ∈ {monthly, quarterly, yearly} | obligatoire |
| boost_slots | MinMax | facultatif |
| transaction_id | UUID | facultatif |
Erreurs
- 403Les boosts ne sont pas activés sur ce serveur
- 403Seuls les admins peuvent booster ce serveur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/boosts/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"boost_type":"…","boost_slots":"…","transaction_id":"…"}'Boosts d'un serveur.
GET https://gateway.alfychat.app/api/hosting/boosts/{serverId}
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/boosts/<serverId>"Liste les hébergeurs (administration).
GET https://gateway.alfychat.app/api/hosting/admin/providers
Erreurs
- 401Non authentifié
- 403Accès admin uniquement
- 500Erreur vérification rôle
curl -X GET "https://gateway.alfychat.app/api/hosting/admin/providers" \
-H "Authorization: Bearer $ACCESS_TOKEN"Valide ou suspend un hébergeur (administration).
PATCH https://gateway.alfychat.app/api/hosting/admin/providers/{id}/status
Erreurs
- 401Non authentifié
- 403Accès admin uniquement
- 500Erreur vérification rôle
curl -X PATCH "https://gateway.alfychat.app/api/hosting/admin/providers/<id>/status" \
-H "Authorization: Bearer $ACCESS_TOKEN"Statistiques de l'hébergement (administration).
GET https://gateway.alfychat.app/api/hosting/admin/stats
Erreurs
- 401Non authentifié
- 403Accès admin uniquement
- 500Erreur vérification rôle
curl -X GET "https://gateway.alfychat.app/api/hosting/admin/stats" \
-H "Authorization: Bearer $ACCESS_TOKEN"Moyens de paiement configurés.
GET https://gateway.alfychat.app/api/hosting/payment-configs
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/payment-configs" \
-H "Authorization: Bearer $ACCESS_TOKEN"Enregistre la configuration d'un moyen de paiement.
POST https://gateway.alfychat.app/api/hosting/payment-configs
Corps JSON
| provider | ∈ {stripe, mollie, paypal, tebex} | obligatoire |
| secret_key | longueur 10–1000 | obligatoire |
| public_key | longueur 0–500 | facultatif |
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/hosting/payment-configs" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider":"…","secret_key":"…","public_key":"…"}'Supprime la configuration d'un moyen de paiement.
DELETE https://gateway.alfychat.app/api/hosting/payment-configs/{provider}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/payment-configs/<provider>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Clé de signature des webhooks de paiement.
GET https://gateway.alfychat.app/api/hosting/payment-configs/webhook-key/{provider}
Erreurs
- 404Config introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/payment-configs/webhook-key/<provider>"Techniciens de l'hébergeur.
GET https://gateway.alfychat.app/api/hosting/technicians
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/hosting/technicians" \
-H "Authorization: Bearer $ACCESS_TOKEN"Ajoute un technicien.
POST https://gateway.alfychat.app/api/hosting/technicians
Corps JSON
| username | longueur 2–50 | obligatoire |
| role | ∈ {viewer, editor, admin} | facultatif |
Erreurs
- 404Utilisateur introuvable
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/hosting/technicians" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"username":"…","role":"…"}'Retire un technicien.
DELETE https://gateway.alfychat.app/api/hosting/technicians/{userId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/hosting/technicians/<userId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Abonnements — /api/subscriptions
Les quatre prestataires de paiement (Stripe, Mollie, PayPal, Tebex) ont chacun une route de paiement et un webhook dont la signature est vérifiée. Ces webhooks reçoivent le corps brut, jamais du JSON ré-encodé.
Plans d'abonnement disponibles.
GET https://gateway.alfychat.app/api/subscriptions/plans
Erreurs
- 500Erreur serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/subscriptions/plans"Crée ou met à jour un plan (administration).
POST https://gateway.alfychat.app/api/subscriptions/plans
Erreurs
- 401Non authentifié
- 403Accès admin uniquement
- 500Erreur vérification rôle
curl -X POST "https://gateway.alfychat.app/api/subscriptions/plans" \
-H "Authorization: Bearer $ACCESS_TOKEN"Ouvre une session de paiement Stripe.
POST https://gateway.alfychat.app/api/subscriptions/checkout/stripe
Erreurs
- 404Plan introuvable
- 500Erreur création session Stripe
- 503Stripe non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/checkout/stripe" \
-H "Authorization: Bearer $ACCESS_TOKEN"Ouvre un paiement Mollie.
POST https://gateway.alfychat.app/api/subscriptions/checkout/mollie
Corps JSON
| payment_method | texte | facultatif |
Erreurs
- 404Plan introuvable
- 500Erreur création paiement Mollie
- 503Mollie non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/checkout/mollie" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"payment_method":"…"}'Ouvre un paiement PayPal.
POST https://gateway.alfychat.app/api/subscriptions/checkout/paypal
Erreurs
- 404Plan introuvable
- 500Erreur création commande PayPal
- 503PayPal non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/checkout/paypal" \
-H "Authorization: Bearer $ACCESS_TOKEN"Ouvre un paiement Tebex.
POST https://gateway.alfychat.app/api/subscriptions/checkout/tebex
Erreurs
- 404Plan introuvable
- 500Erreur création panier Tebex
- 503Tebex non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/checkout/tebex" \
-H "Authorization: Bearer $ACCESS_TOKEN"Webhook Stripe (signature vérifiée).
POST https://gateway.alfychat.app/api/subscriptions/webhooks/stripe
Erreurs
- 400Signature invalide
- 500Erreur traitement webhook
- 503Stripe non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/webhooks/stripe"Webhook Mollie.
POST https://gateway.alfychat.app/api/subscriptions/webhooks/mollie
Erreurs
- 503Mollie non configuré
curl -X POST "https://gateway.alfychat.app/api/subscriptions/webhooks/mollie"Webhook PayPal (signature vérifiée).
POST https://gateway.alfychat.app/api/subscriptions/webhooks/paypal
Erreurs
- 400Signature invalide
curl -X POST "https://gateway.alfychat.app/api/subscriptions/webhooks/paypal"Webhook Tebex (signature vérifiée).
POST https://gateway.alfychat.app/api/subscriptions/webhooks/tebex
Erreurs
- 403Signature invalide
- 403Signature manquante
- 503Tebex non configuré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/webhooks/tebex"Ses abonnements.
GET https://gateway.alfychat.app/api/subscriptions/me
Erreurs
- 500Erreur serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/subscriptions/me" \
-H "Authorization: Bearer $ACCESS_TOKEN"Abonnement d'un serveur.
GET https://gateway.alfychat.app/api/subscriptions/server/{serverId}
Erreurs
- 500Erreur serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/subscriptions/server/<serverId>"Résilie un abonnement.
POST https://gateway.alfychat.app/api/subscriptions/{id}/cancel
Erreurs
- 404Abonnement introuvable
- 500Erreur annulation
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/subscriptions/<id>/cancel" \
-H "Authorization: Bearer $ACCESS_TOKEN"Historique de ses paiements.
GET https://gateway.alfychat.app/api/subscriptions/transactions
Erreurs
- 500Erreur serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/subscriptions/transactions" \
-H "Authorization: Bearer $ACCESS_TOKEN"