mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 04:30:10 +01:00
1848 lines
50 KiB
JSON
1848 lines
50 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"version": "1.0.0",
|
|
"title": "AnythingLLM Developer API",
|
|
"description": "API endpoints that enable programmatic reading, writing, and updating of your AnythingLLM instance. UI supplied by Swagger.io."
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http:///api/"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/v1/auth": {
|
|
"get": {
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"description": "Verify the attached Authentication header contains a valid API token.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Valid auth token was found.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"authenticated": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/is-multi-user-mode": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"isMultiUser": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/users": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"users": [
|
|
{
|
|
"username": "sample-sam",
|
|
"role": "default"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/users/new": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Create a new user with username and password. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"user": {
|
|
"id": 1,
|
|
"username": "sample-sam",
|
|
"role": "default"
|
|
},
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Key pair object that will define the new user to add to the system.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"username": "sample-sam",
|
|
"password": "hunter2",
|
|
"role": "default | admin"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/users/{id}": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Update existing user settings. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "id of the user in the database."
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Key pair object that will update the found user. All fields are optional and will not update unless specified.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"username": "sample-sam",
|
|
"password": "hunter2",
|
|
"role": "default | admin",
|
|
"suspended": 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Delete existing user by id. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "id of the user in the database."
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/invites": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "List all existing invitations to instance regardless of status. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"invites": [
|
|
{
|
|
"id": 1,
|
|
"status": "pending",
|
|
"code": "abc-123",
|
|
"claimedBy": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/invite/new": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Create a new invite code for someone to use to register with instance. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"invite": {
|
|
"id": 1,
|
|
"status": "pending",
|
|
"code": "abc-123"
|
|
},
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/invite/{id}": {
|
|
"delete": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Deactivates (soft-delete) invite by id. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "id of the invite in the database."
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/workspaces/{workspaceId}/update-users": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Overwrite workspace permissions to only be accessible by the given user ids and admins. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "workspaceId",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "id of the workspace in the database."
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Entire array of user ids who can access the workspace. All fields are optional and will not update unless specified.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"userIds": [
|
|
1,
|
|
2,
|
|
4,
|
|
12
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/workspace-chats": {
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "All chats in the system ordered by most recent. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Page offset to show of workspace chats. All fields are optional and will not update unless specified.",
|
|
"required": false,
|
|
"type": "integer",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"offset": 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/admin/preferences": {
|
|
"get": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Show all multi-user preferences for instance. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"settings": {
|
|
"users_can_delete_workspaces": true,
|
|
"limit_user_messages": false,
|
|
"message_limit": 10
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"Admin"
|
|
],
|
|
"description": "Update multi-user preferences for instance. Methods are disabled until multi user mode is enabled via the UI.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Instance is not in Multi-User mode. Method denied"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Object with setting key and new value to set. All keys are optional and will not update unless specified.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"users_can_delete_workspaces": false,
|
|
"limit_user_messages": true,
|
|
"message_limit": 5
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/document/upload": {
|
|
"post": {
|
|
"tags": [
|
|
"Documents"
|
|
],
|
|
"description": "Upload a new file to AnythingLLM to be parsed and prepared for embedding.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"success": true,
|
|
"error": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "File to be uploaded.",
|
|
"required": true,
|
|
"type": "file",
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/documents": {
|
|
"get": {
|
|
"tags": [
|
|
"Documents"
|
|
],
|
|
"description": "List of all locally-stored documents in instance",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"localFiles": {
|
|
"name": "documents",
|
|
"type": "folder",
|
|
"items": [
|
|
{
|
|
"name": "my-stored-document.json",
|
|
"type": "file",
|
|
"id": "bb07c334-4dab-4419-9462-9d00065a49a1",
|
|
"url": "file://my-stored-document.txt",
|
|
"title": "my-stored-document.txt",
|
|
"cached": false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/document/accepted-file-types": {
|
|
"get": {
|
|
"tags": [
|
|
"Documents"
|
|
],
|
|
"description": "Check available filetypes and MIMEs that can be uploaded.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"types": {
|
|
"application/mbox": [
|
|
".mbox"
|
|
],
|
|
"application/pdf": [
|
|
".pdf"
|
|
],
|
|
"application/vnd.oasis.opendocument.text": [
|
|
".odt"
|
|
],
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
|
|
".docx"
|
|
],
|
|
"text/plain": [
|
|
".txt",
|
|
".md"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found"
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/new": {
|
|
"post": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Create a new workspace",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"workspace": {
|
|
"id": 79,
|
|
"name": "Sample workspace",
|
|
"slug": "sample-workspace",
|
|
"createdAt": "2023-08-17 00:45:03",
|
|
"openAiTemp": null,
|
|
"lastUpdatedAt": "2023-08-17 00:45:03",
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": null
|
|
},
|
|
"message": "Workspace created"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "JSON object containing new display name of workspace.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"name": "My New Workspace"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspaces": {
|
|
"get": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "List all current workspaces",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"workspaces": [
|
|
{
|
|
"id": 79,
|
|
"name": "Sample workspace",
|
|
"slug": "sample-workspace",
|
|
"createdAt": "2023-08-17 00:45:03",
|
|
"openAiTemp": null,
|
|
"lastUpdatedAt": "2023-08-17 00:45:03",
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/{slug}": {
|
|
"get": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Get a workspace by its unique slug.",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Unique slug of workspace to find"
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"workspace": {
|
|
"id": 79,
|
|
"name": "My workspace",
|
|
"slug": "my-workspace-123",
|
|
"createdAt": "2023-08-17 00:45:03",
|
|
"openAiTemp": null,
|
|
"lastUpdatedAt": "2023-08-17 00:45:03",
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": null,
|
|
"documents": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Deletes a workspace by its slug.",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Unique slug of workspace to delete"
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
},
|
|
"400": {
|
|
"description": "Bad Request"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/{slug}/update": {
|
|
"post": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Update workspace settings by its unique slug.",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Unique slug of workspace to find"
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"workspace": {
|
|
"id": 79,
|
|
"name": "My workspace",
|
|
"slug": "my-workspace-123",
|
|
"createdAt": "2023-08-17 00:45:03",
|
|
"openAiTemp": null,
|
|
"lastUpdatedAt": "2023-08-17 00:45:03",
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": null,
|
|
"documents": []
|
|
},
|
|
"message": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "JSON object containing new settings to update a workspace. All keys are optional and will not update unless provided",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"name": "Updated Workspace Name",
|
|
"openAiTemp": 0.2,
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": "Respond to all inquires and questions in binary - do not respond in any other format."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/{slug}/chats": {
|
|
"get": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Get a workspaces chats regardless of user by its unique slug.",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Unique slug of workspace to find"
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"history": [
|
|
{
|
|
"role": "user",
|
|
"content": "What is AnythingLLM?",
|
|
"sentAt": 1692851630
|
|
},
|
|
{
|
|
"role": "assistant",
|
|
"content": "AnythingLLM is a platform that allows you to convert notes, PDFs, and other source materials into a chatbot. It ensures privacy, cites its answers, and allows multiple people to interact with the same documents simultaneously. It is particularly useful for businesses to enhance the visibility and readability of various written communications such as SOPs, contracts, and sales calls. You can try it out with a free trial to see if it meets your business needs.",
|
|
"sources": [
|
|
{
|
|
"source": "object about source document and snippets used"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/{slug}/update-embeddings": {
|
|
"post": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Add or remove documents from a workspace by its unique slug.",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Unique slug of workspace to find"
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"workspace": {
|
|
"id": 79,
|
|
"name": "My workspace",
|
|
"slug": "my-workspace-123",
|
|
"createdAt": "2023-08-17 00:45:03",
|
|
"openAiTemp": null,
|
|
"lastUpdatedAt": "2023-08-17 00:45:03",
|
|
"openAiHistory": 20,
|
|
"openAiPrompt": null,
|
|
"documents": []
|
|
},
|
|
"message": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "JSON object of additions and removals of documents to add to update a workspace. The value should be the folder + filename with the exclusions of the top-level documents path.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"adds": [],
|
|
"deletes": [
|
|
"custom-documents/anythingllm-hash.json"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/workspace/{slug}/chat": {
|
|
"post": {
|
|
"tags": [
|
|
"Workspaces"
|
|
],
|
|
"description": "Execute a chat with a workspace",
|
|
"parameters": [
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"id": "chat-uuid",
|
|
"type": "abort | textResponse",
|
|
"textResponse": "Response to your query",
|
|
"sources": [
|
|
{
|
|
"title": "anythingllm.txt",
|
|
"chunk": "This is a context chunk used in the answer of the prompt by the LLM,"
|
|
}
|
|
],
|
|
"close": true,
|
|
"error": "null | text string of the failure mode."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "prompt to send to the workspace and the type of conversation (query or chat).",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"message": "What is AnythingLLM?",
|
|
"mode": "query | chat"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/system/env-dump": {
|
|
"get": {
|
|
"tags": [
|
|
"System Settings"
|
|
],
|
|
"description": "Dump all settings to file storage",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/system": {
|
|
"get": {
|
|
"tags": [
|
|
"System Settings"
|
|
],
|
|
"description": "Get all current system settings that are defined.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"settings": {
|
|
"VectorDB": "pinecone",
|
|
"PineConeEnvironment": "us-west4-gcp-free",
|
|
"PineConeKey": true,
|
|
"PineConeIndex": "my-pinecone-index",
|
|
"LLMProvider": "azure",
|
|
"[KEY_NAME]": "KEY_VALUE"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/system/vector-count": {
|
|
"get": {
|
|
"tags": [
|
|
"System Settings"
|
|
],
|
|
"description": "Number of all vectors in connected vector database",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"vectorCount": 5450
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/system/update-env": {
|
|
"post": {
|
|
"tags": [
|
|
"System Settings"
|
|
],
|
|
"description": "Update a system setting or preference.",
|
|
"parameters": [
|
|
{
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"example": {
|
|
"newValues": {
|
|
"[ENV_KEY]": "Value"
|
|
},
|
|
"error": "error goes here, otherwise null"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
},
|
|
"application/xml": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/InvalidAPIKey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error"
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"description": "Key pair object that matches a valid setting and value. Get keys from GET /v1/system or refer to codebase.",
|
|
"required": true,
|
|
"type": "object",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"VectorDB": "lancedb",
|
|
"AnotherKey": "updatedValue"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"InvalidAPIKey": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string",
|
|
"example": "Invalid API Key"
|
|
}
|
|
},
|
|
"xml": {
|
|
"name": "InvalidAPIKey"
|
|
}
|
|
}
|
|
},
|
|
"securitySchemes": {
|
|
"BearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer",
|
|
"bearerFormat": "JWT"
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
]
|
|
} |