Knowledge Box & Zone REST API (v1)
API documentation for managing Knowledge Boxes, NUA keys, and API Keys within designated zones.
Get Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Responses
Response samples
- 200
- 422
{- "id": "string",
- "slug": "string",
- "account_id": "string",
- "zone": "string",
- "title": "string",
- "description": "string",
- "state": "PUBLISHED",
- "created": "2019-08-24T14:15:22Z",
- "admin": true,
- "contrib": true,
- "allowed_origins": [
- "string"
], - "search_configs": { },
- "external_index_provider": "string"
}
Modify Knowledge Box
Modifies an existing Knowledge Box.
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Request Body schema: application/jsonrequired
Slug (string) or Slug (null) (Slug) | |
Title (string) or Title (null) (Title) | |
KbState (string) or null | |
Description (string) or Description (null) (Description) | |
Array of Allowed Origins (strings) or Allowed Origins (null) (Allowed Origins) | |
Search Configs (object) or Search Configs (null) (Search Configs) |
Responses
Request samples
- Payload
{- "slug": "string",
- "title": "string",
- "state": "PUBLISHED",
- "description": "string",
- "allowed_origins": [
- "string"
], - "search_configs": { }
}
Response samples
- 200
- 422
{ }
List Knowledge Boxes
List all region Knowledge Boxes that belongs to an specific account that the authenticated user can see
path Parameters
account_id required | string <uuid> (Account Id) |
Responses
Response samples
- 200
- 422
[- {
- "id": "string",
- "slug": "string",
- "zone": "string",
- "title": "string",
- "state": "PUBLISHED",
- "description": "string",
- "role_on_kb": "SOWNER",
- "allowed_origins": [
- "string"
], - "search_configs": { },
- "external_index_provider": "string"
}
]
Create Knowledge Box
Creates a new Knowledge Box. The accepted values for the learning_configuration
are dynamic and may be dependant of the account used. Accepted field values needs to be checked on the 'Learning configuration schema' endpoint
path Parameters
account_id required | string <uuid> (Account Id) |
Request Body schema: application/jsonrequired
slug | string (Slug) |
title | string (Title) |
Description (string) or Description (null) (Description) | |
Sentence Embedder (string) or Sentence Embedder (null) (Sentence Embedder) Deprecated | |
Anonymization (string) or Anonymization (null) (Anonymization) Deprecated | |
learning_configuration | object (Learning Configuration) |
Array of Allowed Origins (strings) or Allowed Origins (null) (Allowed Origins) | |
PineoneKBIndexProvider (object) or External index provider (null) (External index provider) External index provider configuration for the Knowledge Box. If not set, the default NucliaDB's index will be used. | |
search_configs | object (Search Configs) Default: {} |
Responses
Request samples
- Payload
{- "slug": "string",
- "title": "string",
- "description": "string",
- "sentence_embedder": "string",
- "anonymization": "string",
- "learning_configuration": { },
- "allowed_origins": [
- "string"
], - "external_index_provider": {
- "api_key": "<my-pinecone-api-key>",
- "serverless_cloud": "aws_us_east_1",
- "type": "pinecone"
}, - "search_configs": { }
}
Response samples
- 201
- 422
{- "id": "string"
}
Users
List of users of a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
query Parameters
include_user_detail | boolean (Include User Detail) Default: false |
Responses
Response samples
- 200
- 422
[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "role": "SOWNER",
- "email": "string",
- "name": "string"
}
]
Update Users
Assign or remove users from a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Request Body schema: application/jsonrequired
Array of Add (objects) or Add (null) (Add) | |
Array of Update (objects) or Update (null) (Update) | |
Array of Delete (strings) or Delete (null) (Delete) |
Responses
Request samples
- Payload
{- "add": [
- {
- "id": "string",
- "role": "SOWNER"
}
], - "update": [
- {
- "id": "string",
- "role": "SOWNER"
}
], - "delete": [
- "string"
]
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Invite To Knowledge Box
Send an invitation to join a Knowledge Box via email.
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Request Body schema: application/jsonrequired
email required | string <email> (Email) |
role required | string (KbRole) Enum: "SOWNER" "SMEMBER" "SCONTRIBUTOR" |
Responses
Request samples
- Payload
{- "email": "user@example.com",
- "role": "SOWNER"
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Delete Invite
Invalidate an invite to join a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
query Parameters
email required | string <email> (Email) |
Responses
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Invited Users
List of users invited to a Knowledge Box, but not yet joined
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Responses
Response samples
- 200
- 422
[- {
- "email": "string",
- "role": "SOWNER",
- "expires": "2019-08-24T14:15:22Z"
}
]
Delete Service Account
Delete a new Service Account for a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
sa_id required | string <uuid> (Sa Id) |
Responses
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Delete Api Key
Delete an API Key of a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
sa_id required | string <uuid> (Sa Id) |
sa_key_id required | string <uuid> (Sa Key Id) |
Responses
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Add Service Account Key
Create an API Key for a Service Account of a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
sa_id required | string <uuid> (Sa Id) |
Request Body schema: application/jsonrequired
expires required | string <date-time> (Expires) |
Responses
Request samples
- Payload
{- "expires": "2019-08-24T14:15:22Z"
}
Response samples
- 201
- 422
{- "id": "string",
- "token": "string"
}
List Service Accounts
List of Service Accounts of a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Responses
Response samples
- 200
- 422
[- {
- "id": "string",
- "title": "string",
- "role": "SOWNER",
- "keys": [
- {
- "id": "string",
- "created": "2019-08-24T14:15:22Z",
- "expires": "2019-08-24T14:15:22Z"
}
]
}
]
Add Service Account
Create a new Service Account for a Knowledge Box
path Parameters
account_id required | string <uuid> (Account Id) |
kb_id required | string <uuid> (Kb Id) |
Request Body schema: application/jsonrequired
title | string (Title) |
role required | string (KbRole) Enum: "SOWNER" "SMEMBER" "SCONTRIBUTOR" |
Responses
Request samples
- Payload
{- "title": "string",
- "role": "SOWNER"
}
Response samples
- 201
- 422
{- "id": "string"
}
Delete Nua Client By Id
Deletes an existing Nuclia Understanding API client
path Parameters
account_id required | string <uuid> (Account Id) |
client_id required | string (Client Id) ^[a-z0-9_-]+$ |
Responses
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Nua Client By Id
Gets the metadata of an existing Nuclia Understanding API
path Parameters
account_id required | string <uuid> (Account Id) |
client_id required | string (Client Id) ^[a-z0-9_-]+$ |
Responses
Response samples
- 200
- 422
{- "title": "string",
- "description": "",
- "contact": "string",
- "created": "2019-08-24T14:15:22Z",
- "partitions": 0,
- "client_id": "string",
- "account_id": "string",
- "processing_webhook": {
- "uri": "string",
- "headers": { }
}
}
Set Account Nua Client Key
Recreates a new session key for an existing Nuclia Understanding API client
path Parameters
account_id required | string <uuid> (Account Id) |
client_id required | string (Client Id) ^[a-z0-9_-]+$ |
Responses
Response samples
- 201
- 422
{- "token": "string",
- "client_id": "string"
}
Get Account Nua Clients
Gets the list of Nuclia Understanding API clients of an account
path Parameters
account_id required | string <uuid> (Account Id) |
query Parameters
Client Id (string) or Client Id (null) (Client Id) |
Responses
Response samples
- 200
- 422
{- "clients": [
- {
- "title": "string",
- "description": "",
- "contact": "string",
- "created": "2019-08-24T14:15:22Z",
- "partitions": 0,
- "client_id": "string",
- "account_id": "string",
- "processing_webhook": {
- "uri": "string",
- "headers": { }
}
}
]
}
Create Account Nua Client
Create a new Nuclia Understanding API client for an account
path Parameters
account_id required | string <uuid> (Account Id) |
Request Body schema: application/jsonrequired
contact required | string (Contact) |
title | string (Title) |
Description (string) or Description (null) (Description) Default: "" | |
Client Id (string) or Client Id (null) (Client Id) | |
ProcessingWebhook (object) or null | |
allow_kb_management | boolean (Allow Kb Management) Default: false |
Responses
Request samples
- Payload
{- "contact": "string",
- "title": "string",
- "description": "",
- "client_id": "string",
- "processing_webhook": {
- "uri": "string",
- "headers": { }
}, - "allow_kb_management": false
}
Response samples
- 201
- 422
{- "token": "string",
- "client_id": "string"
}
Get Download Status
Get the status of a download request by Knowledgebox ID and request ID
path Parameters
kb_id required | string (Kb Id) |
request_id required | string <uuid1> (Request Id) |
Responses
Response samples
- 200
- 422
{- "request_id": "string",
- "download_type": "query",
- "download_format": "ndjson",
- "event_type": "visited",
- "requested_at": "2019-08-24T14:15:22Z",
- "kb_id": "string",
- "download_url": "string"
}
Get Knowledgebox Activity Downloads List
Get the list of monthly activity audit files available to download
path Parameters
kb_id required | string (Kb Id) |
event_type required | string (EventType) Enum: "visited" "modified" "deleted" "new" "search" "suggest" "indexed" "chat" "started" "stopped" "processed" |
Responses
Response samples
- 200
- 422
{- "downloads": [
- "string"
]
}
Query Knowledgebox Activity Logs
Query Knowledgebox Activity Logs
path Parameters
kb_id required | string (Kb Id) |
event_type required | string (EventType) Enum: "visited" "modified" "deleted" "new" "search" "suggest" "indexed" "chat" "started" "stopped" "processed" |
Request Body schema: application/jsonrequired
object (Pagination) | |
year_month required | string (Year Month) |
show | Array of strings (Show) unique Default: ["date","id"] Items Enum: "id" "date" "user_id" "user_type" "client_type" "total_duration" "audit_metadata" "resource_id" |
required | object (QueryFiltersCommon) |
Responses
Request samples
- Payload
{- "pagination": {
- "limit": 10,
- "starting_after": 0,
- "ending_before": 0
}, - "year_month": "string",
- "show": [
- "date",
- "id"
], - "filters": {
- "id": {
- "eq": 0,
- "gt": 0,
- "ge": 0,
- "lt": 0,
- "le": 0,
- "ne": 0,
- "isnull": true
}, - "date": { },
- "user_id": {
- "eq": "string",
- "gt": "string",
- "ge": "string",
- "lt": "string",
- "le": "string",
- "ne": "string",
- "isnull": true
}, - "user_type": {
- "eq": "user",
- "gt": "user",
- "ge": "user",
- "lt": "user",
- "le": "user",
- "ne": "user",
- "isnull": true
}, - "client_type": {
- "eq": "api",
- "gt": "api",
- "ge": "api",
- "lt": "api",
- "le": "api",
- "ne": "api",
- "isnull": true
}, - "total_duration": {
- "eq": 0,
- "gt": 0,
- "ge": 0,
- "lt": 0,
- "le": 0,
- "ne": 0,
- "isnull": true
}, - "audit_metadata": [
- {
- "eq": "string",
- "gt": "string",
- "ge": "string",
- "lt": "string",
- "le": "string",
- "ne": "string",
- "isnull": true,
- "like": "string",
- "ilike": "string",
- "key": "string"
}
], - "resource_id": { }
}
}
Response samples
- 200
- 422
"{\"id\":0,\"date\":null,\"user_id\":null,\"user_type\":null,\"client_type\":null,\"total_duration\":null,\"audit_metadata\":null,\"resource_id\":null,\"question\":null,\"resources_count\":null,\"filter\":null,\"learning_id\":null,\"rephrased_question\":null,\"answer\":null,\"retrieved_context\":null,\"chat_history\":null,\"feedback_good\":null,\"feedback_comment\":null,\"feedback_good_all\":null,\"feedback_good_any\":null,\"feedback\":null,\"model\":null,\"rag_strategies_names\":null,\"rag_strategies\":null,\"status\":null,\"time_to_first_char\":null}\n"
Request The Preparation Of Knowledgebox Activity Logs Download
Request Knowledgebox Activity Logs download
path Parameters
kb_id required | string (Kb Id) |
event_type required | string (EventType) Enum: "visited" "modified" "deleted" "new" "search" "suggest" "indexed" "chat" "started" "stopped" "processed" |
header Parameters
accept required | string (Accept) Enum: "application/x-ndjson" "text/csv" |
Request Body schema: application/jsonrequired
year_month required | string (Year Month) |
show | Array of strings (Show) unique Default: ["date","id"] Items Enum: "id" "date" "user_id" "user_type" "client_type" "total_duration" "audit_metadata" "resource_id" |
required | object (QueryFiltersCommon) |
Email Address (string) or Email Address (null) (Email Address) | |
notify_via_email | boolean (Notify Via Email) Default: false |
Responses
Request samples
- Payload
{- "year_month": "string",
- "show": [
- "date",
- "id"
], - "filters": {
- "id": {
- "eq": 0,
- "gt": 0,
- "ge": 0,
- "lt": 0,
- "le": 0,
- "ne": 0,
- "isnull": true
}, - "date": { },
- "user_id": {
- "eq": "string",
- "gt": "string",
- "ge": "string",
- "lt": "string",
- "le": "string",
- "ne": "string",
- "isnull": true
}, - "user_type": {
- "eq": "user",
- "gt": "user",
- "ge": "user",
- "lt": "user",
- "le": "user",
- "ne": "user",
- "isnull": true
}, - "client_type": {
- "eq": "api",
- "gt": "api",
- "ge": "api",
- "lt": "api",
- "le": "api",
- "ne": "api",
- "isnull": true
}, - "total_duration": {
- "eq": 0,
- "gt": 0,
- "ge": 0,
- "lt": 0,
- "le": 0,
- "ne": 0,
- "isnull": true
}, - "audit_metadata": [
- {
- "eq": "string",
- "gt": "string",
- "ge": "string",
- "lt": "string",
- "le": "string",
- "ne": "string",
- "isnull": true,
- "like": "string",
- "ilike": "string",
- "key": "string"
}
], - "resource_id": { }
}, - "email_address": "user@example.com",
- "notify_via_email": false
}
Response samples
- 202
- 422
{- "request_id": "string",
- "download_type": "query",
- "download_format": "ndjson",
- "event_type": "visited",
- "requested_at": "2019-08-24T14:15:22Z",
- "kb_id": "string",
- "download_url": "string"
}
Download Knowledgebox Activity
Download the csv file for the activity audit for a given month
path Parameters
kb_uuid required | string (Kb Uuid) |
query Parameters
type required | string (EventType) Enum: "visited" "modified" "deleted" "new" "search" "suggest" "indexed" "chat" "started" "stopped" "processed" Audit event type |
month required | string (Month) ^\d+-(0[1-9]|1[012])$ Month in YYYY-MM format |
Responses
Response samples
- 200
- 422
null
Get Knowledgebox Activity Downloads List
Get the list of monthly activity audit files available to download
path Parameters
kb_uuid required | string (Kb Uuid) |
query Parameters
type required | string (EventType) Enum: "visited" "modified" "deleted" "new" "search" "suggest" "indexed" "chat" "started" "stopped" "processed" Audit event type |
Responses
Response samples
- 200
- 422
{- "downloads": [
- "string"
]
}
Query Rag Requests By Scores
Get a list of rag request that matches a remi scores query
path Parameters
kb_uuid required | string (Kb Uuid) |
Request Body schema: application/jsonrequired
ContextRelevanceQuery (object) or null | |
month required | string (Month) |
Feedback Good (boolean) or Feedback Good (null) (Feedback Good) | |
Status (string) or null | |
object (Pagination) |
Responses
Request samples
- Payload
{- "context_relevance": {
- "value": 0,
- "operation": "gt",
- "aggregation": "average"
}, - "month": "string",
- "feedback_good": true,
- "status": "SUCCESS",
- "pagination": {
- "limit": 10,
- "starting_after": 0,
- "ending_before": 0
}
}
Response samples
- 200
- 422
{- "data": [
- {
- "id": 0,
- "question": "string",
- "answer": "string",
- "remi": {
- "answer_relevance": {
- "score": 0,
- "reason": "string"
}, - "context_relevance": [
- 0
], - "groundedness": [
- 0
]
}
}
], - "has_more": true
}
Aggregated Remi Scores Across Time
Get the evolution of remi scores of a kb on a period of time
path Parameters
kb_uuid required | string (Kb Uuid) |
query Parameters
aggregation | string (Aggregation) Enum: "hour" "day" "week" "month" "quarter" "year" "millennium" |
from required | string <date-time> (From) |
To (string) or To (null) (To) Default: "2024-12-13T13:30:17.887597" |
Responses
Response samples
- 200
- 422
[- {
- "timestamp": "2019-08-24T14:15:22Z",
- "metrics": [
- {
- "name": "string",
- "min": 0,
- "max": 0,
- "average": 0
}
]
}
]