Skip to content
citizensupport

CitizenSupport documentation

Overview

CitizenSupport is an AI-powered platform purpose-built for municipalities and public-sector organizations. It enables local governments to deliver 24/7 citizen support, streamline issue reporting, and make public documents instantly searchable — all through a single, easy-to-manage dashboard.

The platform consists of three core product modules that work independently or together:

  • AI Chatbot (24/7 Support)

    An always-on conversational agent trained on your municipality's own content. Answers citizen questions in seconds, any time of day.

  • Issues Reporting

    A structured, conversational flow that lets citizens report problems (broken streetlights, potholes, noise complaints) directly through the chat widget.

  • Document Search

    AI-powered search across uploaded municipal documents, enabling citizens to find and download forms, permits, and regulations instantly.

Each module integrates seamlessly with the embeddable chat widget, your dashboard, and your existing workflows.

Getting Started

Setting up CitizenSupport takes just a few steps:

1. Create Your Organization

After signing up, you'll create an organization profile with your municipality's name, logo, and primary branding color. This information is used throughout the chat widget and public-facing interfaces.

2. Import Your Knowledge Base

Feed the AI with your municipality's content. You have two options:

  • Website Import — Provide your website URL and CitizenSupport will automatically crawl and index all public pages, extracting structured content for the AI to learn from.

  • Manual Documents — Upload individual documents (PDF, DOCX, TXT) through the dashboard. The AI processes and indexes them automatically.

3. Configure Your Chatbot

Customize the chatbot's name, greeting message, tone of voice, and default language. You can choose from multiple tone presets (Professional, Friendly, Concise) or define your own.

4. Embed the Widget

Copy the embed code from your dashboard and add it to your website. The widget is a single <script> tag that loads asynchronously and won't affect your page performance.

Example embed code:

HTML
<script
  src="https://your-domain.com/widget.js"
  data-chatbot-id="your-chatbot-slug"
  async
></script>

AI Chatbot

The AI chatbot is the cornerstone of CitizenSupport. It uses advanced language models to understand citizen questions and provide accurate, contextual responses based on your municipality's own knowledge base.

How It Works

  1. Step 1: A citizen types a question in the chat widget on your website.

  2. Step 2: The AI searches your indexed knowledge base using semantic search to find the most relevant content.

  3. Step 3: It generates a natural, conversational response based on the matched content.

  4. Step 4: Sources are cited so citizens can verify the information.

Key Capabilities

  • Contextual memory — The chatbot remembers context within a conversation, allowing natural follow-up questions.

  • Source attribution — Every response includes links to the original source documents.

  • Unanswered question tracking — When the AI cannot confidently answer, the question is logged in your dashboard for review.

  • Human handoff — Conversations can be escalated to a live agent with full context preserved.

  • Quick replies — Suggested follow-up questions help citizens explore related topics.

Response Quality

The AI only answers based on your indexed content. If it doesn't have enough information, it will transparently let the citizen know and suggest alternative ways to get help, rather than hallucinating answers.

Issues Reporting

The Issues Reporting module transforms the chat widget into a structured intake system for citizen complaints and service requests.

Supported Categories

  • Roads & Infrastructure
  • Street Lighting
  • Garbage & Sanitation
  • Parks & Recreation
  • Water & Sewage
  • Noise & Nuisance
  • Public Safety
  • Building Permits
  • Other

Report Flow

  1. Step 1: The citizen describes the issue through natural conversation.

  2. Step 2: The AI automatically categorizes and prioritizes the report.

  3. Step 3: Citizens can attach photos to document the issue.

  4. Step 4: A unique reference number is generated for tracking.

  5. Step 5: Optional contact details (email or WhatsApp) are collected for follow-ups.

For Municipal Staff

  • All reports appear in the dashboard with status tracking (New → In Progress → Resolved → Closed).

  • Reports can be assigned to specific staff members.

  • Internal notes can be attached for team collaboration.

  • Email notifications alert assigned staff of new reports.

  • Priority levels (Low, Medium, High, Urgent) help triage workload.

Knowledge Base

The Knowledge Base is the foundation that powers all AI responses. It stores and organizes the content your chatbot uses to answer citizen questions.

Content Sources

  • Website Import — Crawls your municipal website and automatically extracts content from every accessible page. Pages are categorized using AI classification.

  • Manual Documents — Upload individual files for specific content not available on your website.

  • Content Overrides — Create priority content entries that take precedence over crawled content for specific topics.

Website Crawling

The crawler visits your website URL, discovers all linked pages, and processes them in batches. Each page is scraped, cleaned of navigation and boilerplate, and stored as a structured document. You can monitor progress in the dashboard and view individual page content.

Content Management

  • View and edit imported content directly in the dashboard.

  • Include or exclude specific pages from AI training.

  • Set priority weights to control which content the AI favors.

  • Re-crawl websites to capture updated content.

Widget Integration

The CitizenSupport widget is a lightweight, embeddable chat interface that you add to your municipal website.

Installation

Add the widget script tag to your website's HTML, typically before the closing </body> tag. The widget loads asynchronously and initializes automatically.

Customization Options

  • Position — Bottom-left or bottom-right of the screen.

  • Primary Color — Matches your municipality's brand color.

  • Logo — Display your organization's logo in the chat header.

  • Icon — Choose or upload a custom widget trigger icon.

  • Greeting Message — The first message citizens see when opening the chat.

Widget Features

  • Responsive design — works on desktop, tablet, and mobile.

  • Image upload support for issue reporting.

  • Document download cards with file previews.

  • Quick reply suggestions for guided conversations.

  • Markdown rendering for formatted responses.

  • Session persistence across page navigations.

Dashboard

The CitizenSupport dashboard is your central command center for managing all aspects of the platform.

Dashboard Sections

  • Overview — At-a-glance metrics: total conversations, resolution rate, unanswered questions, and active reports.

  • Conversations — Browse and review all citizen chat sessions. View full transcripts, satisfaction ratings, and escalation history.

  • Unanswered Questions — Review questions the AI couldn't answer confidently. Add content to address gaps in your knowledge base.

  • Reports — Manage citizen issue reports with status tracking, assignment, and internal notes.

  • Knowledge Base — Import websites, upload documents, and manage all training content.

  • Downloadable Documents — Upload and manage citizen-facing documents for search and download.

  • Settings — Configure your chatbot, organization profile, widget appearance, and team members.

User Roles

  • Admin — Full access to all settings, content management, and team management.

  • Member — Can manage conversations, reports, and content but cannot modify organization settings.

  • Viewer — Read-only access to the dashboard for monitoring purposes.

Analytics & Reports

Track performance and understand how citizens interact with your AI assistant.

Available Metrics

  • Total conversations and messages over time.

  • Average response time and resolution rate.

  • Most frequently asked topics and questions.

  • Unanswered question trends.

  • Citizen satisfaction ratings.

  • Report volume by category and priority.

  • Document download statistics.

  • Language distribution across conversations.

All analytics data is accessible from the dashboard and can help identify content gaps, peak usage times, and areas for improvement.

Customization

CitizenSupport is designed to blend seamlessly with your municipality's brand and communication style.

Branding

  • Upload your organization's logo (displayed in the widget header and dashboard).

  • Set a primary brand color that tints the entire widget UI.

  • Custom widget icon — choose from presets or upload your own.

  • Customize the chatbot's name displayed to citizens.

Tone of Voice

Control how the AI communicates. Available presets include:

  • Professional — Formal, clear, and authoritative.

  • Friendly — Warm, approachable, and conversational.

  • Concise — Direct and to-the-point, minimal filler.

  • Custom — Define your own tone instructions for the AI to follow.

Multilingual Support

CitizenSupport automatically detects the language a citizen is writing in and responds in the same language. This happens without any configuration — the AI handles language detection and translation natively.

How It Works

  1. Step 1: The AI detects the input language from the citizen's first message.

  2. Step 2: All responses are generated in the detected language.

  3. Step 3: The knowledge base content is searched and matched regardless of the original language.

  4. Step 4: A default language can be set per chatbot as a fallback.

This is especially valuable for municipalities serving diverse communities with multiple language needs.

Security & Compliance

CitizenSupport is built with public-sector security requirements in mind.

Data Protection

  • GDPR Compliant — All data processing follows GDPR guidelines. Citizens are informed about data usage through configurable cookie consent.

  • Row-Level Security — Database-level access controls ensure organizations can only access their own data. No cross-tenant data leakage is possible.

  • Encrypted Storage — All data at rest and in transit is encrypted using industry-standard protocols.

  • EU Data Residency — Data is stored in European data centers to comply with local data sovereignty requirements.

Access Control

  • Role-based access (Admin, Member, Viewer) with granular permissions.

  • Organization-level isolation — complete data separation between municipalities.

  • Secure authentication with email verification.

Compliance Pages

CitizenSupport includes built-in compliance pages that you can link from your website:

  • Privacy Policy
  • Terms of Service
  • GDPR Compliance
  • Accessibility Statement

API Reference

CitizenSupport provides a RESTful API for advanced integrations and custom workflows.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Admins create keys in Settings › API & webhooks. A key starts with cs_live_, is shown once when it is created and is stored only as a hash. Keys can have an expiry date and can be revoked at any time. The API is server-to-server: never put a key in a website or mobile app (browser requests are blocked by CORS).

bash
curl "https://app.citizensupport.ai/api/v1/reports?status=new" \
  -H "Authorization: Bearer cs_live_…"

Scopes

  • chat — send citizen messages to the assistant (POST /v1/chat).

  • conversations:read — list conversations and read transcripts.

  • reports:read — list reports and read report details.

  • reports:write — change report status, priority and assignee (includes reports:read).

  • knowledge:read — search the knowledge base.

Core Endpoints

Base URL: https://app.citizensupport.ai/api/v1. A machine-readable OpenAPI 3.1 description is published at /api/v1/openapi.json.

API endpoints
MethodPathDescription
POST/v1/chatSend a citizen message and get the assistant's reply: text, sources, filed reports, documents and handoff. Add ?stream=true for the AI SDK UI message stream.
GET/v1/conversationsList conversations, newest first. Filter by status, channel, externalUserId or date.
GET/v1/conversations/{id}One conversation with its transcript as plain text and summarised tool results.
GET/v1/reportsList citizen reports with filtering (status, priority, category, date) and cursor pagination.
GET/v1/reports/{reference}One report, including the citizen's contact details if they left any.
PATCH/v1/reports/{reference}Change status, priority or assignee (by staff email). Recorded in the report's activity log.
GET/v1/knowledge/searchSearch the knowledge base with the same hybrid search the assistant uses (?q=…&limit=6).

POST /v1/chat takes { conversationId?, externalUserId, message }. externalUserId is your own id for the citizen and conversations are scoped to it: reuse the returned conversationId with the same externalUserId to continue a conversation. Conversations started through the API appear in the inbox with the channel API.

json
{
  "conversationId": "7c1e…",
  "reply": {
    "text": "Household waste is collected every Monday and Thursday…",
    "sources": [{ "title": "Waste collection", "url": "https://…" }],
    "tickets": [],
    "documents": []
  }
}

Pagination

List endpoints return { data, nextCursor, hasMore }, newest first. Pass nextCursor back as ?cursor= to get the next page. limit is 1–100 (default 25).

Errors

Errors always have the same shape, with a stable machine-readable code and a message you can log:

json
{ "error": { "code": "insufficient_scope", "message": "This API key doesn't have the \"reports:write\" scope." } }
  • 400 — invalid_request or invalid_cursor: the body or a parameter is invalid.

  • 401 — missing_api_key, invalid_api_key, api_key_revoked or api_key_expired.

  • 403 — insufficient_scope, or workspace_suspended.

  • 404 — conversation_not_found or report_not_found.

  • 422 — invalid_assignee: no staff member with that email.

  • 429 — rate_limited: wait for the number of seconds in the Retry-After header.

  • 503 — ai_unavailable or temporarily_unavailable: the assistant can't answer right now, try again later.

Rate Limits

Each key can make 120 requests per minute across all endpoints, including at most 30 chat messages per minute. Responses carry an X-RateLimit-Limit header. Over the limit you get 429 with a Retry-After header.

Webhooks

Webhooks send an HTTPS POST to your system when something happens in your workspace, so a ticketing system or CRM can react without polling. Add endpoints in Settings › API & webhooks and choose which events each one receives.

Events

  • issue.created — a citizen report was filed by the assistant or through the API.

  • issue.status_changed — a report moved to another status (includes previousStatus).

  • conversation.handoff_requested — a citizen asked to talk to a person.

  • conversation.resolved — staff marked a conversation as resolved.

Every request carries X-CitizenSupport-Event, X-CitizenSupport-Delivery (the same id on retries, so you can ignore duplicates) and X-CitizenSupport-Signature headers. The JSON body has id, type, createdAt, workspace and data, where data holds a report or conversation snapshot.

Citizens' names, emails and phone numbers are left out of webhook payloads unless an admin turns on “Include contact details” for that endpoint.

Verifying Signatures

Each endpoint has its own signing secret (whsec_…), shown once when you add it. The signature header looks like t=1794000000,v1=5f2c…, where v1 is the hex HMAC-SHA256 of the timestamp, a dot and the raw request body. Compute it with your secret, compare in constant time and reject requests older than five minutes.

javascript
import crypto from "node:crypto";

export function verifyCitizenSupport(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return v1?.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

// Express: use the raw body, not parsed JSON
app.post("/hooks/citizensupport", express.raw({ type: "application/json" }), (req, res) => {
  const ok = verifyCitizenSupport(req.body.toString(), req.get("X-CitizenSupport-Signature"), process.env.CS_WEBHOOK_SECRET);
  if (!ok) return res.sendStatus(400);
  res.sendStatus(200);
});

Retries

  1. Step 1: Respond with any 2xx status within 10 seconds to acknowledge a delivery.

  2. Step 2: Failed deliveries are retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, then marked as failed (6 attempts in total).

  3. Step 3: After 20 failed deliveries in a row the endpoint is disabled and admins are notified. Fix the endpoint, then enable it again in Settings.

  4. Step 4: The delivery log in Settings shows each delivery with its status, response code, attempts and error, and lets you send a test event or redeliver.

Need help getting started?

Our team is here to help you set up and configure CitizenSupport for your municipality.