EnglishIntegrationsAPI Keys

API Keys

Use an API key to integrate FAQSure directly into your own application — send chat messages, upload documents, search your knowledge base, or pull analytics.

Create an API Key

  1. Go to Settings → API Keys
  2. Click Create API Key
  3. Give it a name (e.g. “Production”) and optionally set:
    • Rate limit per minute (default: 60)
    • Rate limit per hour (default: 1,000)
    • Expiry date
  4. Copy the key immediately — it is only shown once
⚠️

Store your API key securely. Do not expose it in client-side code, public repositories, or browser console logs.

Authentication

Include your API key in the X-API-Key header of every request:

curl https://api.faqsure.io/api/v1/chat \
  -H "X-API-Key: faqsure_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"message": "What is your return policy?"}'

Send a Chat Message

POST /api/v1/chat
X-API-Key: faqsure_sk_...
Content-Type: application/json

Request:

{
  "message": "What is your return policy?",
  "conversation_id": "uuid (optional — omit to start a new conversation)",
  "agent_id": "uuid (optional — uses default agent if omitted)",
  "use_rag": true,
  "top_k": 5,
  "similarity_threshold": 0.7
}

Response:

{
  "conversation_id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Our return policy allows returns within 30 days of purchase...",
  "sources": [
    {
      "chunk_id": "uuid",
      "text": "Returns within 30 days...",
      "similarity_score": 0.92,
      "document_filename": "return-policy.pdf"
    }
  ],
  "confidence": 0.92,
  "fallback_triggered": false,
  "tokens_used": {
    "prompt": 150,
    "completion": 200,
    "total": 350
  },
  "processing_time_ms": 1245
}

Search Your Knowledge Base

POST /api/v1/search
X-API-Key: faqsure_sk_...
Content-Type: application/json

Request:

{
  "query": "How do I reset my password?",
  "top_k": 5,
  "similarity_threshold": 0.7,
  "use_hybrid": false
}

Response:

{
  "results": [
    {
      "chunk_id": "uuid",
      "text": "To reset your password: 1. Click Forgot Password...",
      "similarity_score": 0.95,
      "document_filename": "help.pdf",
      "metadata": {"section": "Account Settings"}
    }
  ],
  "count": 1,
  "processing_time_ms": 234
}

Upload a Document

POST /api/v1/documents/upload
X-API-Key: faqsure_sk_...
Content-Type: multipart/form-data
curl https://api.faqsure.io/api/v1/documents/upload \
  -H "X-API-Key: faqsure_sk_..." \
  -F "file=@policies.pdf"

Response:

{
  "id": "uuid",
  "filename": "policies.pdf",
  "status": "processing"
}

Error Responses

StatusErrorMeaning
401invalid_api_keyKey is missing or invalid
402insufficient_balanceToken balance depleted
429rate_limit_exceededToo many requests

Rate limit exceeded (429):

{
  "error": "rate_limit_exceeded",
  "message": "60 requests per minute limit exceeded",
  "limit_per_minute": 60,
  "limit_per_hour": 1000
}

Key Endpoints

MethodEndpointDescription
POST/api/v1/chatSend a chat message
POST/api/v1/searchSearch the knowledge base
POST/api/v1/documents/uploadUpload a document
GET/api/v1/documentsList all documents
GET/api/v1/chat/conversationsList conversations
GET/api/v1/analytics/dashboardDashboard stats