API reference
Libraries
Knowledge libraries and their files, the context a turn can attach.
List libraries
api.niucore.com/api/v1/librariesScope: libraries:read
Libraries accessible to the credential, ordered by name.
Query
pageintegerdefaults to 1Page number, starting at 1.
sizeintegerdefaults to 50Items per page. Maximum 200.
Returns
idintegerIdentifier.
slugstringInternal slug.
namestringName.
descriptionstring | nullDescription.
area_idsinteger[]Areas it is assigned to.
created_atstring (date-time)Created.
updated_atstring (date-time)Last edit.
curl -sS -X GET 'https://api.niucore.com/api/v1/libraries' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": [
{
"id": 31,
"slug": "procedimientos-de-soporte",
"name": "Procedimientos de soporte",
"description": "Manuales internos del equipo de soporte.",
"area_ids": [
4,
9
],
"created_at": "2026-06-11T09:31:00Z",
"updated_at": "2026-08-30T18:12:04Z"
}
],
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77",
"page": 1,
"size": 50,
"total": 1
}
}Create a library
api.niucore.com/api/v1/librariesScope: libraries:write
Creates the library, its area assignment and its default prompt in a single transaction. Returns 201.
Note
The embedding model is set by the server, not the client: choosing it from outside would break parity with the service that indexes documents.
Heads up
Uploading and deleting files is not in v1.0. The API reads libraries and files, and creates or edits libraries; document ingestion still belongs to the application.
Request body
namestringrequiredBetween 2 and 100 characters.
descriptionstringUp to 2000 characters.
area_idsinteger[]Areas it is assigned to. All of them must be within the credential's scope.
Errors
- 403
api_v1_resource_policy_create_deniedThe credential is limited to specific resources (allowlist) and cannot create new ones of this type. - 403
api_v1_resource_not_allowedAnarea_idis outside the scope. Here it is403and not404: the client named the resource explicitly. - 503
api_v1_library_embedding_unavailableNo embedding model is available to create libraries.
curl -sS -X POST 'https://api.niucore.com/api/v1/libraries' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Procedimientos de soporte",
"description": "Manuales internos del equipo de soporte.",
"area_ids": [
4,
9
]
}'{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 31,
"slug": "procedimientos-de-soporte",
"name": "Procedimientos de soporte",
"description": "Manuales internos del equipo de soporte.",
"area_ids": [
4,
9
],
"created_at": "2026-06-11T09:31:00Z",
"updated_at": "2026-08-30T18:12:04Z"
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}Retrieve a library
api.niucore.com/api/v1/libraries /{library_id}Scope: libraries:read
Detail of one library.
Path
library_idintegerrequiredIdentifier.
Errors
- 404
api_v1_not_foundIt does not exist, or it is outside the credential's scope. Both cases answer the same: a403would confirm the resource exists.
curl -sS -X GET 'https://api.niucore.com/api/v1/libraries/31' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 31,
"slug": "procedimientos-de-soporte",
"name": "Procedimientos de soporte",
"description": "Manuales internos del equipo de soporte.",
"area_ids": [
4,
9
],
"created_at": "2026-06-11T09:31:00Z",
"updated_at": "2026-08-30T18:12:04Z"
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}Update a library
api.niucore.com/api/v1/libraries /{library_id}Scope: libraries:write
Updates name, description and area assignment. Omitted fields are left untouched.
Path
library_idintegerrequiredIdentifier.
Request body
namestringNew name.
descriptionstringNew description.
area_idsinteger[]Replaces the whole list of areas.
Errors
- 404
api_v1_not_foundIt does not exist, or it is outside the credential's scope. Both cases answer the same: a403would confirm the resource exists.
curl -sS -X PATCH 'https://api.niucore.com/api/v1/libraries/31' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "Manuales internos del equipo de soporte (rev. 2026-09)."
}'{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 31,
"slug": "procedimientos-de-soporte",
"name": "Procedimientos de soporte",
"description": "Manuales internos del equipo de soporte (rev. 2026-09).",
"area_ids": [
4,
9
],
"created_at": "2026-06-11T09:31:00Z",
"updated_at": "2026-08-30T18:12:04Z"
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}List files
api.niucore.com/api/v1/libraries /{library_id} /filesScope: libraries:read
Files in the library, newest first.
Path
library_idintegerrequiredLibrary identifier.
Query
pageintegerdefaults to 1Page number, starting at 1.
sizeintegerdefaults to 50Items per page. Maximum 200.
Returns
idintegerIdentifier.
library_idintegerOwning library.
namestringInternal document name.
file_namestringOriginal file name.
titlestring | nullTitle.
document_typestringDocument type.
sizeintegerSize in bytes.
Errors
- 404
api_v1_not_foundIt does not exist, or it is outside the credential's scope. Both cases answer the same: a403would confirm the resource exists.
curl -sS -X GET 'https://api.niucore.com/api/v1/libraries/31/files' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": [
{
"id": 902,
"library_id": 31,
"name": "DOC2149_902.txt",
"file_name": "politica-devoluciones.pdf",
"title": "Política de devoluciones",
"description": "Vigente desde 2026-01",
"document_type": "pdf",
"size": 184320,
"created_at": "2026-06-12T10:02:44Z"
}
],
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77",
"page": 1,
"size": 50,
"total": 1
}
}Retrieve a file
api.niucore.com/api/v1/files /{file_id}Scope: libraries:read
Detail of one file. It inherits its library's scope: without that library allowed, the file does not exist for the credential.
Path
file_idintegerrequiredFile identifier.
Errors
- 404
api_v1_not_foundIt does not exist, or it is outside the credential's scope. Both cases answer the same: a403would confirm the resource exists.
curl -sS -X GET 'https://api.niucore.com/api/v1/files/902' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 902,
"library_id": 31,
"name": "DOC2149_902.txt",
"file_name": "politica-devoluciones.pdf",
"title": "Política de devoluciones",
"description": "Vigente desde 2026-01",
"document_type": "pdf",
"size": 184320,
"created_at": "2026-06-12T10:02:44Z"
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}