API Modèles d'E-mail
Gérez les modèles d'e-mail utilisés pour les notifications système (Bienvenue, Réinitialisation de mot de passe, etc.).
Créer un Modèle
Crée un nouveau modèle d'e-mail.
Requête
curl -X POST https://api.syauth.com/e/v1/developer/templates/ \
-H "X-Developer-Token: syat_..." \
-H "Content-Type: application/json" \
-d '{
"name": "custom_welcome",
"subject": "Welcome to Our Service!",
"html_content": "<h1>Welcome</h1><p>Thanks for joining.</p>",
"workspace": "78047707-5f8f-472b-a065-3d3dc48ba80a"
}'
Réponse
{
"id": "e131df86-725f-49b8-98cd-ed3c62536e1c",
"name": "custom_welcome",
"subject": "Welcome to Our Service!",
"is_active": true,
"created_at": "2026-01-07T10:20:00Z",
"updated_at": "2026-01-07T10:20:00Z"
}
Lister les Modèles
Requête
curl -X GET https://api.syauth.com/e/v1/developer/templates/ \
-H "X-Developer-Token: syat_..."
Réponse
[
{
"id": "e131df86-725f-49b8-98cd-ed3c62536e1c",
"name": "registration_confirmation",
"subject": "Welcome to SyAuth!",
"is_active": true,
"updated_at": "2026-01-01T22:35:00Z"
}
]
Obtenir les Détails d'un Modèle
Requête
curl -X GET https://api.syauth.com/e/v1/developer/templates/e131df86-725f-49b8-98cd-ed3c62536e1c/ \
-H "X-Developer-Token: syat_..."
Réponse
{
"id": "e131df86-725f-49b8-98cd-ed3c62536e1c",
"name": "custom_welcome",
"subject": "Welcome to Our Service!",
"html_content": "<h1>Welcome</h1><p>Thanks for joining.</p>",
"is_active": true,
"created_at": "2026-01-07T10:20:00Z",
"updated_at": "2026-01-07T10:20:00Z"
}
Mettre à Jour un Modèle
Modifie un modèle d'e-mail.
Requête
curl -X PATCH https://api.syauth.com/e/v1/developer/templates/e131df86-725f-49b8-98cd-ed3c62536e1c/ \
-H "X-Developer-Token: syat_..." \
-H "Content-Type: application/json" \
-d '{"subject": "Welcome Invited User!"}'
Réponse
{
"id": "e131df86-725f-49b8-98cd-ed3c62536e1c",
"name": "custom_welcome",
"subject": "Welcome Invited User!",
"is_active": true,
"created_at": "2026-01-07T10:20:00Z",
"updated_at": "2026-01-07T10:25:00Z"
}
Supprimer un Modèle
Supprime définitivement un modèle d'e-mail.
Requête
curl -X DELETE https://api.syauth.com/e/v1/developer/templates/e131df86-725f-49b8-98cd-ed3c62536e1c/ \
-H "X-Developer-Token: syat_..."
Réponse
204 No Content