API Reference
De Axoverna REST API laat je AI-powered product Q&A integreren in elke applicatie. Alle endpoints accepteren JSON en retourneren JSON.
Base URL: https://axoverna.com/api/v1
Quick Start
Start in drie stappen:
- 1Maak een account aan en genereer een API key via Settings.
- 2Voeg content toe via de dashboard of de Ingest API.
- 3Stel je eerste vraag via
POST /v1/ask.
curl -X POST https://axoverna.com/api/v1/ask \
-H "Authorization: Bearer nx_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "Which supplement helps with joint pain?"
}'Authentication
Alle API requests vereisen een Bearer token in de Authorization header.
Authorization: Bearer nx_live_YOUR_API_KEYEr zijn drie typen API keys met verschillende toegangsniveaus:
| Key Prefix | Scope | Use Case |
|---|---|---|
| nx_live_ | Queries | Frontend widget, /ask, /feedback |
| nx_ing_ | Ingestion | Content sync, /ingest/* endpoints |
| nx_adm_ | Admin | Full access to all endpoints |
/v1/ask
Auth: nx_live_ or nx_adm_
Stel een vraag over je productcatalogus. Retourneert een AI-gegenereerd antwoord met bronvermeldingen en confidence score.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | The question to ask (max 500 chars) |
| sources | string[] | No | Filter by item types (e.g. ["products", "manuals"]) |
| session_id | string | No | Session ID for conversation context |
| stream | boolean | No | Enable SSE streaming (default: false) |
| language | string | No | Response language (ISO 639-1, e.g. "nl", "en") |
Response
{
"answer": "Joint Formula with glucosamine, MSM, and vitamin C...",
"confidence": 0.94,
"sources": [
{ "type": "product", "id": "JF-001", "title": "Joint Formula", "score": 0.96 },
{ "type": "manual", "page": 12, "title": "Product Guide", "score": 0.91 }
],
"tokens_used": 342,
"session_id": "sess_abc123"
}Streaming (SSE)
Wanneer stream: true, retourneert de API een Server-Sent Events stream:
data: {"type":"chunk","text":"Joint Formula"}
data: {"type":"chunk","text":" with glucosamine..."}
data: {"type":"sources","sources":[...]}
data: {"type":"done","tokens_used":342}/v1/feedback
Auth: nx_live_ or nx_adm_
Stuur feedback over een antwoord. Wordt gebruikt om de kwaliteit te meten en het model te verbeteren.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| query_log_id | string (uuid) | Yes | ID of the query log entry to rate |
| rating | 1 | -1 | Yes | Positive (1) or negative (-1) feedback |
| session_id | string | No | Session ID for deduplication |
| comment | string | No | Optional feedback text (max 2000 chars) |
Response
{ "success": true }/v1/ingest/items
Auth: nx_ing_ or nx_adm_
Voeg items toe aan je knowledge base. Ondersteunt JSON batch (max 100 items) en multipart/form-data voor PDF uploads.
JSON Batch - Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| items | object[] | Yes | Array of items to ingest (1-100) |
| items[].external_id | string | No | Your unique identifier for the item |
| items[].type | string | Yes | Item type (e.g. "product", "manual", "faq") |
| items[].title | string | Yes | Item title |
| items[].content | string | No | Plain text content |
| items[].metadata | object | No | Arbitrary key-value metadata |
| items[].file_url | string (url) | No | URL to a PDF file for processing |
JSON Batch - Response
{
"items_queued": 3,
"job_ids": ["job_abc", "job_def", "job_ghi"],
"status": "queued"
}PDF Upload (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | PDF file to upload |
| type | string | Yes | Item type |
| title | string | Yes | Item title |
| external_id | string | No | Your unique identifier |
| metadata | string (JSON) | No | Metadata as JSON string |
curl -X POST https://axoverna.com/api/v1/ingest/items \
-H "Authorization: Bearer nx_ing_YOUR_KEY" \
-F "file=@product-guide.pdf" \
-F "type=manual" \
-F "title=Product Guide 2025"/v1/ingest/sync
Auth: nx_ing_ or nx_adm_
Synchroniseer je volledige catalogus. Items worden vergeleken op external_id. Nieuwe items worden toegevoegd, gewijzigde items geüpdatet, en ontbrekende items verwijderd.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| items | object[] | Yes | Complete set of items to sync |
| items[].external_id | string | Yes | Required for sync - your unique identifier |
| items[].type | string | Yes | Item type |
| items[].title | string | Yes | Item title |
| items[].content | string | No | Plain text content |
| items[].metadata | object | No | Arbitrary key-value metadata |
| items[].file_url | string (url) | No | URL to a PDF file |
Response
{
"to_add": 5,
"to_update": 2,
"to_delete": 1,
"job_ids": ["job_abc", "job_def"],
"status": "queued"
}Items die niet in het request voorkomen maar wel in je workspace bestaan worden soft-deleted. Wijzigingen worden gedetecteerd op basis van content, title en metadata.
/v1/jobs/:id
Auth: nx_live_, nx_ing_ or nx_adm_
Controleer de status van een ingestion job. Poll dit endpoint na het aanmaken van items om te weten wanneer de content geïndexeerd is.
Response
{
"id": "job_abc123",
"type": "embed_item",
"status": "done",
"item_title": "Joint Formula",
"item_type": "product",
"attempts": 1,
"error": null,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:05Z"
}Mogelijke statussen: queued, running, done, failed.
Widget Embed
Voeg de Axoverna chat widget toe aan je website met een enkel script tag. De widget is volledig aanpasbaar via data-attributen.
<script
src="https://axoverna.com/widget.js"
data-api-key="nx_live_YOUR_KEY"
data-api-url="https://axoverna.com"
data-title="Product Assistant"
data-placeholder="Ask a question..."
data-position="bottom-right"
data-accent="#00D4C8"
></script>Data Attributes
| Field | Type | Required | Description |
|---|---|---|---|
| data-api-key | string | Yes | Your live API key (nx_live_...) |
| data-api-url | string | No | API base URL (default: https://axoverna.com) |
| data-title | string | No | Chat window title |
| data-placeholder | string | No | Input field placeholder text |
| data-position | string | No | "bottom-right" (default) or "bottom-left" |
| data-accent | string | No | Accent color in hex (e.g. #00D4C8) |
Error Codes
De API retourneert standaard HTTP status codes. Foutresponses bevatten altijd een error veld.
{
"error": "Query limit exceeded for this billing period"
}| Status | Code | Description |
|---|---|---|
| 400 | Bad Request | Invalid JSON or missing required fields |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | API key lacks permission for this endpoint |
| 404 | Not Found | Resource not found (e.g. job ID) |
| 429 | Too Many Requests | Rate limit or query limit exceeded |
| 500 | Internal Error | Unexpected server error |
Rate Limiting
De API gebruikt een sliding window rate limiter. Limieten zijn afhankelijk van je plan en gelden per API key.
| Endpoint | Window | Limit |
|---|---|---|
| /v1/ask | 1 minute | 60 requests |
| /v1/feedback | 1 minute | 120 requests |
| /v1/ingest/* | 1 minute | 30 requests |
| /v1/jobs/:id | 1 minute | 120 requests |
Bij overschrijding ontvang je een 429 Too Many Requests response. De Retry-After header geeft aan hoeveel seconden je moet wachten.
Naast rate limiting geldt ook een maandelijks query budget op basis van je plan. Controleer je gebruik via het Usage dashboard.