Documentation
Toutes les routes REST de Residual Publish. Authentification via JWT Supabase (header Authorization: Bearer <token>).
Base URL — https://publish.residual-labs.fr
Toutes les routes nécessitent un token JWT valide sauf /api/v1/webhook/typebot (webhook public signé).
/api/v1/generateGénère un article complet via streaming SSE. Utilise Mistral large (ou Groq en fallback) avec vos données d'audit comme contexte.
POST /api/v1/generate
Authorization: Bearer <token>
Content-Type: application/json
{
"topic": "agences SEO Paris 2026",
"tone": 70,
"audit_data": {
"sector": "agences-seo",
"sample_size": 50,
"avg_score": 62,
"critical_issues": ["LCP > 4s", "missing canonical", "no HTTPS"]
}
}/api/v1/publishPublie un article existant sur la plateforme choisie. La connexion doit être configurée dans /connections.
POST /api/v1/publish
Authorization: Bearer <token>
Content-Type: application/json
{
"article_id": "550e8400-e29b-41d4-a716-446655440000",
"platform": "wordpress",
"connection_id": "550e8400-e29b-41d4-a716-446655440001"
}/api/v1/articlesRetourne tous les articles de l'utilisateur authentifié, triés par date de création.
GET /api/v1/articles?status=published&limit=10
Authorization: Bearer <token>/api/v1/articles/:idOpérations CRUD sur un article. L'IDOR est vérifié — seul le propriétaire peut modifier.
PATCH /api/v1/articles/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
Content-Type: application/json
{
"title": "Nouveau titre optimisé",
"status": "published"
}/api/v1/connectionsGère les connexions aux plateformes (WordPress, Twitter, Mistral, Groq). Les credentials sont chiffrés AES-256-GCM avant stockage.
POST /api/v1/connections
Authorization: Bearer <token>
Content-Type: application/json
// WordPress
{
"provider": "wordpress",
"label": "Mon Blog",
"credentials": {
"url": "https://monblog.fr",
"username": "admin",
"password": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
// Mistral BYOK
{
"provider": "mistral",
"label": "Ma clé Mistral",
"credentials": { "api_key": "sk-..." }
}/api/v1/webhook/typebotReçoit les leads capturés par votre chatbot Typebot embarqué dans les articles WordPress. Score le lead via GoRules et l'envoie vers Residual Reach.
POST /api/v1/webhook/typebot
Content-Type: application/json
X-Article-Id: 550e8400-e29b-41d4-a716-446655440000
{
"email": "contact@agence.fr",
"name": "Marie Dupont",
"company": "Agence XYZ",
"source_url": "https://monblog.fr/article-seo-paris",
"answers": { "budget": "5k-10k", "timeline": "Q3 2026" }
}/api/v1/scheduleProgramme la publication d'un article à une date et heure précises. Le cron Trigger.dev exécute la publication automatiquement.
POST /api/v1/schedule
Authorization: Bearer <token>
Content-Type: application/json
{
"article_id": "550e8400-e29b-41d4-a716-446655440000",
"platform": "wordpress",
"scheduled_at": "2026-06-15T09:00:00Z"
}Residual Publish expose un MCP Server compatible Claude Code avec 4 outils. Configurez-le dans votre .mcp.json :
{
"mcpServers": {
"residual-publish": {
"url": "https://publish.residual-labs.fr/api/v1/mcp",
"headers": { "Authorization": "Bearer <votre-token>" }
}
}
}
// Outils disponibles :
// generate_article(topic, tone?, audit_data?)
// publish_article(article_id, platform, connection_id?)
// schedule_article(article_id, platform, scheduled_at)
// article_stats(article_id)