FAQ API
import { Badge } from ‘@astrojs/starlight/components’;
FAQs are displayed in the dashboard and also used by the chatbot to answer patient questions via WhatsApp.
GET /api/faq
Section titled “GET /api/faq”List all active FAQs for the clinic.
Response 200:
[ { "id": "uuid", "clinic_id": "uuid", "category": "parking", "question": "¿Dónde puedo estacionarme?", "answer": "Contamos con estacionamiento gratuito frente a la clínica...", "keywords": ["estacionamiento", "parqueo", "parking"], "is_active": true, "created_at": "2026-05-01T00:00:00Z" }]Categories: parking, prices, payment, hours, general
Keywords are used by the chatbot: if a patient’s message contains any of these words, this FAQ is surfaced as a candidate answer.
POST /api/faq
Section titled “POST /api/faq”Create a new FAQ.
Request:
{ "category": "prices", "question": "¿Cuánto cuesta la consulta?", "answer": "La consulta general tiene un costo de $20...", "keywords": ["precio", "costo", "cuánto", "cobran"]}Response 201: FAQ object with id
PUT /api/faq/:id
Section titled “PUT /api/faq/:id”Update an existing FAQ.
Request: Same fields as POST (all optional).
Response 200: Updated FAQ object
DELETE /api/faq/:id
Section titled “DELETE /api/faq/:id”Delete a FAQ.
Auth: Admin only
Response 200:
{ "message": "FAQ deleted successfully" }