CTRL K
Description
Engammo FAQ ingestion accepts signed FAQ upsert and delete events from Engammo, stores them as organization-scoped knowledge, and makes them available to the chatbot through the existing RAG path. The ingestion API verifies a bearer key, an HMAC signature, event idempotency, and organization ownership before writing FAQ data.
Prerequisites
- Engammo project configured to send FAQ reconciliation events.
- Kommander organization with Engammo ingestion enabled.
- Bearer API key and signing secret generated for Engammo.
ENGAMMO_INGEST_ENABLEDenabled where required.INTEGRATIONS_ENCRYPTION_KEYconfigured for encrypted signing-secret storage outside local development.
Setup
- Open Integrations > Engammo in Kommander.
- Generate the API key and signing secret. Copy them immediately because plaintext is shown once.
- In Engammo, paste the Kommander endpoint
/api/integrations/engammo/faqs, bearer key, signing secret, and organization ID. - Send a health check to
/api/integrations/engammo/health. - Send one FAQ upsert event and confirm the activity feed marks it accepted.
- Ask the assistant a question covered by the imported FAQ.
Architecture Diagram
Configuration
| Setting | Required | Notes |
|---|---|---|
ENGAMMO_INGEST_ENABLED | Yes for deployment | Gates ingestion endpoints. |
INTEGRATIONS_ENCRYPTION_KEY | Yes outside local development | Must be suitable for encrypted integration secrets. |
| Bearer API key | Yes | Stored hashed in Kommander; Engammo sends plaintext. |
| Signing secret | Yes | Used for X-Engammo-Signature. |
X-Engammo-Organization-Id | Yes per request | Must match the integration’s organization. |
X-Engammo-Event-Id | Yes per request | Used for duplicate event protection. |
Webhook Payload Example
FAQ upsert events carry one FAQ and its localized content. Delete events use the same authentication headers with type: "delete" and the externalId to remove from active retrieval.
{
"type": "upsert",
"externalId": "faq_123",
"projectId": "proj_456",
"projectSlug": "help-center",
"status": "published",
"tags": ["billing", "subscription"],
"occurredAt": "2026-05-17T10:30:00.000Z",
"content": [
{
"locale": "en",
"question": "How do I update my billing details?",
"answer": "Open Billing, update the billing profile, then save the new payment method."
}
]
}Webhook Handler Example
Engammo signs the raw request body. The timestamp and signature headers must be verified before parsing JSON, and X-Engammo-Event-Id must be treated as the idempotency key.
import { NextRequest, NextResponse } from 'next/server';
import { verifyEngammoWebhookSignature } from '@/backend/lib/engammoAuth';
export async function POST(request: NextRequest) {
const eventId = request.headers.get('x-engammo-event-id');
const rawBody = await request.text();
const verification = verifyEngammoWebhookSignature({
secret: process.env.ENGAMMO_SIGNING_SECRET,
rawBody,
signatureHeader: request.headers.get('x-engammo-signature'),
timestampHeader: request.headers.get('x-engammo-timestamp'),
});
if (!eventId) {
return NextResponse.json({ error: 'auth_missing' }, { status: 401 });
}
if (!verification.ok) {
return NextResponse.json({ error: verification.code }, { status: 401 });
}
const payload = JSON.parse(rawBody);
// Deduplicate by eventId, validate payload, then upsert or soft-delete the FAQ.
return NextResponse.json({ status: 'accepted', externalId: payload.externalId });
}Limitations
- The ingestion contract accepts one FAQ change per request.
- Delete events soft-delete FAQs to preserve audit history.
- Ingested FAQs stay separate from manually authored FAQs to keep ownership and edit history clear.
- Only transient 5xx and signature-related 401 errors should be retried by Engammo.
Troubleshooting
- If health checks fail, verify the bearer key and organization ID header.
- If FAQ ingestion returns
signature_invalid, recomputeHMAC-SHA256(secret, "t.rawBody")using the exact request body. - If events duplicate, confirm Engammo sends a stable
X-Engammo-Event-Idper source event. - If imported answers do not appear, check RAG indexing status and confirm the FAQ status is
published.