Référence REST
REST · Serveurs
Serveurs, salons, rôles, membres, invitations, messages de salon, forums, évènements, AutoMod, webhooks.
Les droits requis par chaque action suivent le masque décrit dans Permissions. Quand aucun node auto-hébergé n’est connecté, le service central répond ; sinon le gateway relaie au node (voir Serveurs auto-hébergés). Pour le direct, les évènements Socket.IO équivalents existent pour la plupart des actions.
Serveurs et appartenance
Enregistre un serveur auto-hébergé.
POST https://gateway.alfychat.app/api/servers/register
Corps JSON
| name | longueur 2–100 | obligatoire |
| endpoint | NotEmpty | obligatoire |
| port | MinMax | obligatoire |
| publicKey | NotEmpty | obligatoire |
| description | — | facultatif |
| maxMembers | — | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/register" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","endpoint":"…","port":"…","publicKey":"…"}'Signal de vie d'un server-node.
POST https://gateway.alfychat.app/api/servers/{serverId}/ping
Corps JSON
| nodeToken | — | facultatif |
| stats | — | facultatif |
Erreurs
- 401node_token invalide
- 401node_token requis
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/ping" \
-H "Content-Type: application/json" \
-d '{"nodeToken":"…","stats":"…"}'Liste des serveurs dont on est membre.
GET https://gateway.alfychat.app/api/servers
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers" \
-H "Authorization: Bearer $ACCESS_TOKEN"Nombre de serveurs créables et déjà créés.
GET https://gateway.alfychat.app/api/servers/quota
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/quota" \
-H "Authorization: Bearer $ACCESS_TOKEN"Détail d'un serveur (salons, rôles, membres selon les droits).
GET https://gateway.alfychat.app/api/servers/{serverId}
Erreurs
- 404Serveur non trouvé
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Rejoint un serveur (public, ou avec un code d'invitation).
POST https://gateway.alfychat.app/api/servers/{serverId}/join
Corps JSON
| inviteCode | — | facultatif |
Erreurs
- 404Serveur non trouvé
- 410Cette invitation a atteint son nombre maximum d'utilisations
- 410Cette invitation a expiré
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/join" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"inviteCode":"…"}'Quitte un serveur.
POST https://gateway.alfychat.app/api/servers/{serverId}/leave
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/leave" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée un serveur (rôle @everyone et salon par défaut inclus).
POST https://gateway.alfychat.app/api/servers
Corps JSON
| name | longueur 2–100 | obligatoire |
| category | ∈ {standard, community} | facultatif |
| description | — | facultatif |
| iconUrl | — | facultatif |
| bannerUrl | — | facultatif |
| isPublic | — | facultatif |
| template | — | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…"}'Modifie un serveur (nom, description, icône, bannière, visibilité).
PATCH https://gateway.alfychat.app/api/servers/{serverId}
Corps JSON
| verificationLevel | — | facultatif |
| restrictEmojiUsage | — | facultatif |
| category | — | facultatif |
Erreurs
- 400Catégorie invalide
- 400La catégorie ne concerne que les serveurs hébergés par AlfyChat
- 400Niveau de vérification invalide
- 404Serveur non trouvé
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"verificationLevel":"…","restrictEmojiUsage":"…","category":"…"}'Supprime un serveur (propriétaire).
DELETE https://gateway.alfychat.app/api/servers/{serverId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Rejoint un serveur avec un code d'invitation.
POST https://gateway.alfychat.app/api/servers/join
Corps JSON
| inviteCode | texte · longueur 1–64 | obligatoire |
Erreurs
- 401Authentification requise
Succès : 200, 403, 404, 410
curl -X POST "https://gateway.alfychat.app/api/servers/join" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"inviteCode":"…"}'Jeton d'un server-node auto-hébergé (propriétaire).
GET https://gateway.alfychat.app/api/servers/{serverId}/node-token
Erreurs
- 404Serveur non trouvé
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/node-token" \
-H "Authorization: Bearer $ACCESS_TOKEN"Réclame les droits d'administration avec le code du node.
POST https://gateway.alfychat.app/api/servers/{serverId}/claim-admin
Corps JSON
| code | — | facultatif |
Erreurs
- 400code requis
- 404Serveur non trouvé
- 409Ce serveur a déjà un propriétaire
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/claim-admin" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"…"}'Salons et surcharges de permissions
Salons visibles par l'appelant (surcharges de permissions appliquées).
GET https://gateway.alfychat.app/api/servers/{serverId}/channels
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/channels" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée un salon ou une catégorie.
POST https://gateway.alfychat.app/api/servers/{serverId}/channels
Corps JSON
| name | longueur 1–100 | obligatoire |
| type | — | obligatoire |
| parentId | — | facultatif |
| topic | — | facultatif |
| isNsfw | — | facultatif |
| slowMode | — | facultatif |
| userLimit | — | facultatif |
| isPrivate | — | facultatif |
Erreurs
- 404Serveur introuvable
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/channels" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","type":"…"}'Modifie un salon.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}
Corps JSON
| name | — | facultatif |
| topic | — | facultatif |
| position | — | facultatif |
| isNsfw | — | facultatif |
| slowMode | — | facultatif |
| userLimit | — | facultatif |
| parentId | — | facultatif |
Erreurs
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Supprime un salon.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}
Erreurs
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Réordonne salons et catégories par lot (glisser-déposer).
PATCH https://gateway.alfychat.app/api/servers/{serverId}/channels
Erreurs
- 400Salon inconnu dans ce serveur
- 400parentId doit désigner une catégorie de ce serveur
- 400position invalide
- 400positions invalide
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/channels" \
-H "Authorization: Bearer $ACCESS_TOKEN"Surcharges de permissions d'un salon.
GET https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/overrides
Erreurs
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/overrides" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée ou remplace une surcharge (rôle ou membre).
PUT https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/overrides
Corps JSON
| targetType | — | facultatif |
| targetId | — | facultatif |
| deny | — | facultatif |
| allow | — | facultatif |
Erreurs
- 400targetType/targetId requis
- 404Membre introuvable dans ce serveur
- 404Rôle introuvable dans ce serveur
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X PUT "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/overrides" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"targetType":"…","targetId":"…","deny":"…","allow":"…"}'Supprime une surcharge.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/overrides/{targetType}/{targetId}
Erreurs
- 400targetType invalide
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/overrides/<targetType>/<targetId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Resynchronise les permissions du salon avec sa catégorie.
POST https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/overrides/sync
Erreurs
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/overrides/sync" \
-H "Authorization: Bearer $ACCESS_TOKEN"Rôles
Réordonne les rôles.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/roles
Erreurs
- 400Le rôle @everyone reste en bas
- 400Rôle ou position invalide
- 400positions invalide
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/roles" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée un rôle.
POST https://gateway.alfychat.app/api/servers/{serverId}/roles
Corps JSON
| name | longueur 1–100 | obligatoire |
| color | — | facultatif |
| permissions | — | facultatif |
| iconEmoji | — | facultatif |
| hoist | — | facultatif |
| mentionable | — | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/roles" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…"}'Liste des rôles.
GET https://gateway.alfychat.app/api/servers/{serverId}/roles
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/roles" \
-H "Authorization: Bearer $ACCESS_TOKEN"Modifie un rôle (nom, couleur, permissions…).
PATCH https://gateway.alfychat.app/api/servers/{serverId}/roles/{roleId}
Corps JSON
| permissions | — | facultatif |
| position | — | facultatif |
| name | — | facultatif |
| color | — | facultatif |
| iconEmoji | — | facultatif |
| iconUrl | — | facultatif |
| hoist | — | facultatif |
| mentionable | — | facultatif |
Erreurs
- 404Rôle introuvable dans ce serveur
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/roles/<roleId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Supprime un rôle.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/roles/{roleId}
Erreurs
- 400Le rôle par défaut ne peut pas être supprimé
- 404Rôle introuvable dans ce serveur
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/roles/<roleId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Membres
Appartenance d'un utilisateur et fiche minimale (rôles, pseudo, date d'arrivée).
GET https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}/check
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>/check" \
-H "Authorization: Bearer $ACCESS_TOKEN"Bitmask de permissions effectives (option `channelId`).
GET https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}/permissions
Erreurs
- 404Serveur non trouvé
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>/permissions" \
-H "Authorization: Bearer $ACCESS_TOKEN"Liste des membres.
GET https://gateway.alfychat.app/api/servers/{serverId}/members
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/members" \
-H "Authorization: Bearer $ACCESS_TOKEN"Modifie rôles et pseudo d'un membre.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}
Corps JSON
| roleIds | — | facultatif |
| nickname | — | facultatif |
Erreurs
- 400Rôle inconnu dans ce serveur
- 400nickname invalide
- 400roleIds invalide
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"roleIds":"…","nickname":"…"}'Expulse un membre.
POST https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}/kick
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>/kick" \
-H "Authorization: Bearer $ACCESS_TOKEN"Bannit un membre.
POST https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}/ban
Corps JSON
| reason | — | facultatif |
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>/ban" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"…"}'Lève un bannissement.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/members/{userId}/ban
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/members/<userId>/ban" \
-H "Authorization: Bearer $ACCESS_TOKEN"Invitations
Crée une invitation.
POST https://gateway.alfychat.app/api/servers/{serverId}/invites
Corps JSON
| maxUses | — | facultatif |
| expiresIn | — | facultatif |
| customSlug | — | facultatif |
| isPermanent | — | facultatif |
| code | — | facultatif |
| id | — | facultatif |
Erreurs
- 400creatorId requis
- 409Ce slug est déjà utilisé
Succès : 200, 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/invites" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Liste les invitations du serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/invites
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/invites" \
-H "Authorization: Bearer $ACCESS_TOKEN"Supprime une invitation.
DELETE https://gateway.alfychat.app/api/servers/invites/{inviteId}
Erreurs
- 404Invitation non trouvée
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/invites/<inviteId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Aperçu public d'une invitation (nom, icône, nombre de membres).
GET https://gateway.alfychat.app/api/servers/invite/{code}
Succès : 200, 404, 410
curl -X GET "https://gateway.alfychat.app/api/servers/invite/<code>"Messages de salon
Historique d'un salon (`limit`, `before`).
GET https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/messages
Erreurs
- 404Salon introuvable dans ce serveur
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/messages" \
-H "Authorization: Bearer $ACCESS_TOKEN"Envoie un message dans un salon.
POST https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/messages
Corps JSON
| content | texte · longueur 1–4000 | obligatoire |
| tags | tableau | facultatif |
| attachments | — | facultatif |
| replyToId | — | facultatif |
| senderId | — | facultatif |
Erreurs
- 400senderId requis
- 404Salon introuvable dans ce serveur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/messages" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"…"}'Modifie un message de salon.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/messages/{messageId}
Corps JSON
| content | texte · longueur 1–4000 | obligatoire |
| senderId | — | facultatif |
Erreurs
- 404Message introuvable
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/messages/<messageId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"…","senderId":"…"}'Supprime un message de salon.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/messages/{messageId}
Erreurs
- 404Message introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/messages/<messageId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Ajoute une réaction.
POST https://gateway.alfychat.app/api/servers/{serverId}/messages/{messageId}/reactions
Corps JSON
| emoji | texte · longueur 1–50 | obligatoire |
| userId | — | facultatif |
Erreurs
- 400userId requis
- 404Message introuvable
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/messages/<messageId>/reactions" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"emoji":"…","userId":"…"}'Retire une réaction.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/messages/{messageId}/reactions/{emoji}
Erreurs
- 400userId requis
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/messages/<messageId>/reactions/<emoji>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Forums
Publications d'un salon forum.
GET https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/posts
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/posts" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée une publication de forum.
POST https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/posts
Corps JSON
| title | texte · longueur 1–200 | obligatoire |
| content | texte · longueur 1–10000 | obligatoire |
| tags | tableau | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/posts" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"…","content":"…","tags":"…"}'Détail d'une publication de forum.
GET https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/posts/{postId}
Erreurs
- 404Post introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/posts/<postId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Modifie une publication de forum.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/posts/{postId}
Corps JSON
| title | texte · longueur 1–200 | facultatif |
| content | texte · longueur 1–10000 | facultatif |
| tags | tableau | facultatif |
| isLocked | booléen | facultatif |
| isPinned | booléen | facultatif |
Erreurs
- 400Rien à modifier
- 404Post introuvable
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/posts/<postId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Supprime une publication de forum.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/posts/{postId}
Erreurs
- 404Post introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/posts/<postId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Évènements planifiés
Évènements planifiés du serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/events
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/events" \
-H "Authorization: Bearer $ACCESS_TOKEN"Planifie un évènement.
POST https://gateway.alfychat.app/api/servers/{serverId}/events
Corps JSON
| title | texte · longueur 1–200 | obligatoire |
| startsAt | date ISO 8601 | obligatoire |
| type | ∈ {voice, stage, external} | obligatoire |
| description | texte · longueur 0–1000 | facultatif |
| channelId | texte | facultatif |
| location | texte · longueur 0–200 | facultatif |
| endsAt | date ISO 8601 | facultatif |
| recurrence | ∈ {none, daily, weekly, monthly} | facultatif |
| coverUrl | — | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/events" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"…","startsAt":"…","type":"…"}'Marque son intérêt pour un évènement.
POST https://gateway.alfychat.app/api/servers/{serverId}/events/{eventId}/interest
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/events/<eventId>/interest" \
-H "Authorization: Bearer $ACCESS_TOKEN"Modifie un évènement.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/events/{eventId}
Corps JSON
| status | ∈ {scheduled, active, ended, canceled} | facultatif |
| title | texte · longueur 0–200 | facultatif |
| description | — | facultatif |
| startsAt | — | facultatif |
| endsAt | — | facultatif |
Erreurs
- 400Rien à modifier
- 404Événement introuvable
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/events/<eventId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Supprime un évènement.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/events/{eventId}
Erreurs
- 404Événement introuvable
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/events/<eventId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"AutoMod
Règles AutoMod.
GET https://gateway.alfychat.app/api/servers/{serverId}/automod
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/automod" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée une règle AutoMod.
POST https://gateway.alfychat.app/api/servers/{serverId}/automod
Corps JSON
| name | texte · longueur 1–100 | obligatoire |
| triggerType | ∈ {keyword, spam, mention_spam, link, invite} | obligatoire |
| actionType | ∈ {block, alert, timeout, delete} | obligatoire |
| triggerMetadata | objet | facultatif |
| actionMetadata | objet | facultatif |
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/automod" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","triggerType":"…","actionType":"…"}'Modifie une règle AutoMod.
PATCH https://gateway.alfychat.app/api/servers/{serverId}/automod/{ruleId}
Corps JSON
| enabled | booléen | facultatif |
| name | texte · longueur 0–100 | facultatif |
| triggerMetadata | objet | facultatif |
| actionMetadata | objet | facultatif |
Erreurs
- 400Rien à modifier
- 404Règle introuvable
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/<serverId>/automod/<ruleId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled":"…","name":"…","triggerMetadata":"…","actionMetadata":"…"}'Supprime une règle AutoMod.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/automod/{ruleId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/automod/<ruleId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Évalue un contenu contre les règles AutoMod (appel du gateway).
POST https://gateway.alfychat.app/api/servers/{serverId}/automod/check
Corps JSON
| content | — | facultatif |
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/automod/check" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"…"}'Scènes
État d'une scène.
GET https://gateway.alfychat.app/api/servers/{serverId}/stage/{channelId}
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/stage/<channelId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Démarre une scène.
POST https://gateway.alfychat.app/api/servers/{serverId}/stage/{channelId}/start
Corps JSON
| topic | texte · longueur 0–200 | facultatif |
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/stage/<channelId>/start" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"topic":"…"}'Termine une scène.
POST https://gateway.alfychat.app/api/servers/{serverId}/stage/{channelId}/end
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/stage/<channelId>/end" \
-H "Authorization: Bearer $ACCESS_TOKEN"Rejoint une scène.
POST https://gateway.alfychat.app/api/servers/{serverId}/stage/{channelId}/join
Corps JSON
| role | ∈ {listener, speaker} | obligatoire |
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/stage/<channelId>/join" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role":"…"}'Quitte une scène.
POST https://gateway.alfychat.app/api/servers/{serverId}/stage/{channelId}/leave
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/stage/<channelId>/leave" \
-H "Authorization: Bearer $ACCESS_TOKEN"Émojis personnalisés
Émojis personnalisés utilisables par l'appelant.
GET https://gateway.alfychat.app/api/servers/emojis/available
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/emojis/available" \
-H "Authorization: Bearer $ACCESS_TOKEN"Émojis personnalisés d'un serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/emojis
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/emojis"Ajoute un émoji personnalisé.
POST https://gateway.alfychat.app/api/servers/{serverId}/emojis
Corps JSON
| name | texte · longueur 2–32 · format imposé | obligatoire |
| imageUrl | texte · longueur ≥ 1 | obligatoire |
| animated | — | facultatif |
Erreurs
- 400Nom invalide (lettres/chiffres/_ uniquement)
- 409Un émoji porte déjà ce nom sur ce serveur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/emojis" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","imageUrl":"…","animated":"…"}'Supprime un émoji personnalisé.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/emojis/{emojiId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/emojis/<emojiId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Webhooks, journal d’audit et sécurité
Un webhook entrant permet à un service externe de poster dans un salon avec une simple requête, sans compte : POST /api/servers/webhooks/{webhookId}/{token} — le jeton de l’URL fait foi. Limite : quelques messages par fenêtre de 2 secondes, au-delà 429 avec Retry-After.
Journal d'audit du serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/audit-logs
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/audit-logs" \
-H "Authorization: Bearer $ACCESS_TOKEN"Réglages de sécurité du serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/security
Erreurs
- 404Serveur non trouvé
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/security" \
-H "Authorization: Bearer $ACCESS_TOKEN"Webhooks entrants du serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/webhooks
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/webhooks" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée un webhook entrant pour un salon.
POST https://gateway.alfychat.app/api/servers/{serverId}/channels/{channelId}/webhooks
Corps JSON
| name | texte · longueur 1–80 | obligatoire |
| avatarUrl | — | facultatif |
Erreurs
- 400Nom invalide
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/channels/<channelId>/webhooks" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","avatarUrl":"…"}'Supprime un webhook.
DELETE https://gateway.alfychat.app/api/servers/{serverId}/webhooks/{webhookId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/<serverId>/webhooks/<webhookId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Poste un message via un webhook (sans authentification, le jeton fait foi).
POST https://gateway.alfychat.app/api/servers/webhooks/{webhookId}/{token}
Corps JSON
| content | texte · longueur 1–4000 | obligatoire |
| username | — | facultatif |
| avatarUrl | — | facultatif |
Erreurs
- 400Contenu invalide
- 401Webhook invalide
Succès : 201, 400
curl -X POST "https://gateway.alfychat.app/api/servers/webhooks/<webhookId>/<token>" \
-H "Content-Type: application/json" \
-d '{"content":"…","username":"…","avatarUrl":"…"}'Domaine, fichiers et nœuds
Démarre la liaison d'un domaine personnalisé.
POST https://gateway.alfychat.app/api/servers/{serverId}/domain/start
Erreurs
- 400Domaine invalide
- 409Domaine déjà utilisé
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/domain/start" \
-H "Authorization: Bearer $ACCESS_TOKEN"Vérifie la configuration DNS du domaine.
POST https://gateway.alfychat.app/api/servers/{serverId}/domain/check
Erreurs
- 400Aucune vérification en attente
- 404Serveur non trouvé
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/domain/check" \
-H "Authorization: Bearer $ACCESS_TOKEN"Crée un serveur depuis un server-node (appel du gateway).
POST https://gateway.alfychat.app/api/servers/nodes/register
Corps JSON
| name | — | facultatif |
Erreurs
- 401Un utilisateur identifié est requis pour enregistrer un serveur
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/nodes/register" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…"}'Valide un jeton de node (appel du gateway).
POST https://gateway.alfychat.app/api/servers/nodes/validate
Corps JSON
| nodeToken | — | facultatif |
Erreurs
- 400Token requis
- 401Token invalide
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/nodes/validate" \
-H "Content-Type: application/json" \
-d '{"nodeToken":"…"}'Envoie un fichier dans un serveur.
POST https://gateway.alfychat.app/api/servers/{serverId}/files
Erreurs
- 400Aucun fichier fourni
Succès : 201
curl -X POST "https://gateway.alfychat.app/api/servers/<serverId>/files" \
-H "Authorization: Bearer $ACCESS_TOKEN"Télécharge un fichier d'un serveur.
GET https://gateway.alfychat.app/api/servers/{serverId}/files/{filename}
Erreurs
- 404Fichier non trouvé
curl -X GET "https://gateway.alfychat.app/api/servers/<serverId>/files/<filename>"Annuaire, découverte et badges
Annuaire des serveurs publics.
GET https://gateway.alfychat.app/api/servers/public/list
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/public/list"Fiche publique d'un serveur.
GET https://gateway.alfychat.app/api/servers/public/{serverId}
Erreurs
- 404Serveur introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/public/<serverId>"Tous les serveurs (administration).
GET https://gateway.alfychat.app/api/servers/admin/all
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/admin/all" \
-H "Authorization: Bearer $ACCESS_TOKEN"Met un serveur en avant (administration).
POST https://gateway.alfychat.app/api/servers/admin/feature/{serverId}
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/admin/feature/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Retire la mise en avant (administration).
DELETE https://gateway.alfychat.app/api/servers/admin/feature/{serverId}
Succès : 200
curl -X DELETE "https://gateway.alfychat.app/api/servers/admin/feature/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN"Serveurs de la découverte.
GET https://gateway.alfychat.app/api/servers/discover/list
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/discover/list"Candidate à la découverte.
POST https://gateway.alfychat.app/api/servers/discover/apply
Corps JSON
| serverId | — | facultatif |
| reason | — | facultatif |
Erreurs
- 400serverId et userId requis
- 409Candidature déjà en attente
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/discover/apply" \
-H "Content-Type: application/json" \
-d '{"serverId":"…","reason":"…"}'Candidatures à la découverte (équipe).
GET https://gateway.alfychat.app/api/servers/discover/applications
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/discover/applications" \
-H "Authorization: Bearer $ACCESS_TOKEN"Accepte ou refuse une candidature (équipe).
POST https://gateway.alfychat.app/api/servers/discover/review/{applicationId}
Corps JSON
| action | — | facultatif |
Erreurs
- 400Action invalide
Succès : 200
curl -X POST "https://gateway.alfychat.app/api/servers/discover/review/<applicationId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"…"}'Attribue des badges à un serveur (équipe).
PATCH https://gateway.alfychat.app/api/servers/badges/{serverId}
Corps JSON
| isCertified | — | facultatif |
| isPartnered | — | facultatif |
Erreurs
- 400Rien à modifier
- 404Serveur introuvable
Succès : 200
curl -X PATCH "https://gateway.alfychat.app/api/servers/badges/<serverId>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"isCertified":"…","isPartnered":"…"}'Badges d'un serveur.
GET https://gateway.alfychat.app/api/servers/badges/{serverId}
Erreurs
- 404Serveur introuvable
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/badges/<serverId>"Statistiques agrégées (appel interne).
GET https://gateway.alfychat.app/api/servers/internal/stats
Erreurs
- 401Non autorisé
Succès : 200
curl -X GET "https://gateway.alfychat.app/api/servers/internal/stats"