API Reference
Référence complète de l’API REST Wagoo SaaS.
Base URL
http://localhost:3000/api (Développement)
https://wagoo.app/api (Production)Authentification
Toutes les requêtes protégées nécessitent un token Bearer :
curl http://localhost:3000/api/projects \
-H "Authorization: Bearer YOUR_TOKEN"Voir Authentification pour obtenir un token.
Conventions
RequĂŞte
METHOD /api/resource/{id}
Content-Type: application/json
Authorization: Bearer TOKENRéponse (2xx)
{
"data": { ... },
"meta": { "total": 10 }
}Erreur (4xx/5xx)
{
"error": "Unauthorized",
"message": "Token invalid",
"code": "AUTH_ERROR"
}Status codes
| Code | Signification |
|---|---|
| 200 | OK - Succès |
| 201 | Created - Créé |
| 204 | No Content - Pas de contenu |
| 400 | Bad Request - RequĂŞte invalide |
| 401 | Unauthorized - Non authentifié |
| 403 | Forbidden - Accès refusé |
| 404 | Not Found - Non trouvé |
| 429 | Too Many Requests - Rate limité |
| 500 | Internal Server Error - Erreur serveur |
Pagination
GET /api/projects?page=1&limit=10Réponse :
{
"data": [...],
"meta": {
"total": 100,
"page": 1,
"limit": 10,
"pages": 10
}
}Filtrage
GET /api/articles?status=PUBLISHED&projectId=proj_123Tri
GET /api/articles?sort=createdAt&order=descSections API
- Authentification - Sign in, Sign up, Sessions
- Projets - CRUD Projets et membres
- Blog - Articles et gestion de contenu
- Avis - Récupérer et modérer les avis
- Festivals - Gestion des événements
- Tickets - Support et demandes
- Administration - Admin API
- Webhooks - Intégrations Stripe
Erreurs courantes
401 Unauthorized
Token invalide ou expiré. Reconnectez-vous.
curl -X POST http://localhost:3000/api/auth/sign-in \
-d '{"email": "...", "password": "..."}'403 Forbidden
Permission insuffisante. Vous devez être propriétaire du projet.
404 Not Found
Resource n’existe pas ou n’a pas accès.
429 Too Many Requests
Rate limité. Attendez avant de recommencer.
Rate Limiting
- Endpoints publics : 100 req/min
- Endpoints authentifiés : 1000 req/min
- Webhooks : Pas de limite
Headers :
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1234567890Exemples avec cURL
Tous les exemples utilisent cURL, mais fonctionnent avec n’importe quel client HTTP.
Avec Token
# Stocker le token
TOKEN="YOUR_TOKEN"
# Utiliser le token
curl http://localhost:3000/api/projects \
-H "Authorization: Bearer $TOKEN"Avec jq (parser JSON)
curl http://localhost:3000/api/projects \
-H "Authorization: Bearer $TOKEN" | jq '.data'SDKs
Wagoo fournit des SDKs (Ă venir) pour :
- JavaScript/TypeScript
- Python
- Go
Voir aussi
Last updated on