# Knowledge AI

{% hint style="info" %}
**API SUBPATH**: eva-al
{% endhint %}

## Collections

### Pagination and Listing

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/pagination

> Get paginated collections

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/pagination":{"get":{"tags":["Collections"],"summary":"Get paginated collections","operationId":"pagination_2","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"linesPerPage","in":"query","description":"Lines per page","required":false,"schema":{"type":"integer","format":"int32","default":5}},{"name":"orderBy","in":"query","description":"Order by field","required":false,"schema":{"type":"string","default":"updatedAt"}},{"name":"direction","in":"query","description":"Sorting direction","required":false,"schema":{"type":"string","default":"DESC"}},{"name":"searchTerm","in":"query","description":"Optional search term","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionPaginationDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionPaginationDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Unique identifier for the collection"},"name":{"type":"string","description":"Name of the collection"},"isDefault":{"type":"boolean","description":"A boolean indicating if this collection is default or not"},"documentCount":{"type":"integer","description":"Count of documents in the collection","format":"int32"},"questionCount":{"type":"integer","description":"Count of questions in the collection","format":"int32"},"updateAt":{"type":"integer","description":"Timestamp of the last update (in milliseconds)","format":"int64"},"trainingStatus":{"type":"string","description":"Training status of the collection"},"user":{"$ref":"#/components/schemas/UserDTO"},"agents":{"type":"array","description":"List of agents associated with the collection","items":{"$ref":"#/components/schemas/AgentDTO"}}},"description":"Data Transfer Object for collection pagination"},"UserDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Unique identifier for the user."},"name":{"type":"string","description":"The name of the user."},"imageUrl":{"type":"string","description":"URL for the user's profile image."}},"description":"Data Transfer Object for User Details."},"AgentDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Unique identifier for the agent"},"name":{"type":"string","description":"Name of the agent."}},"description":"Represents an agent, encapsulating the UUID and the name of the agent"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/list

> List all collections

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/list":{"get":{"tags":["Collections"],"summary":"List all collections","operationId":"list_1","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionListDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionListDTO":{"type":"object","properties":{"collections":{"type":"array","description":"A list of simple collection DTOs.","items":{"$ref":"#/components/schemas/CollectionSimpleDTO"}}},"description":"DTO for a list of collections."},"CollectionSimpleDTO":{"required":["name"],"type":"object","properties":{"uuid":{"type":"string","description":"Universally Unique Identifier for the collection."},"name":{"type":"string","description":"Name of the collection."},"trainingStatus":{"type":"string","description":"Collection current status"}},"description":"Represents a simple collection DTO with uuid and name."},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/quicksearch

> Quick search for collection names

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/quicksearch":{"get":{"tags":["Collections"],"summary":"Quick search for collection names","operationId":"quicksearch_2","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}},{"name":"searchTerm","in":"query","description":"Search term","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Limit for results","required":false,"schema":{"type":"integer","format":"int64","default":6}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

### CRUD Operations

## POST /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections

> Create a new collection

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections":{"post":{"tags":["Collections"],"summary":"Create a new collection","operationId":"create","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionRequestDTO"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionResponseDTO"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionRequestDTO":{"required":["name","previousUserInput","searchType","threshold","topK"],"type":"object","properties":{"name":{"maxLength":100,"type":"string","description":"Name of the collection"},"description":{"maxLength":250,"type":"string","description":"Description of the collection"},"searchType":{"$ref":"#/components/schemas/CollectionSearchTypeDTO"},"previousUserInput":{"maximum":5,"minimum":0,"type":"integer","description":"Previous user input rating","format":"int32"},"threshold":{"maximum":100,"minimum":1,"type":"integer","description":"Threshold value","format":"int32"},"topK":{"maximum":10,"minimum":1,"type":"integer","description":"Top K value for results","format":"int32"}},"description":"Data Transfer Object for Collection Requests"},"CollectionSearchTypeDTO":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"Type of the collection search. Possible values are 'semantic', 'full_text' and 'hybrid'"},"semanticWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Semantic weight associated with the search, indicating the importance of semantic matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"fullTextWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Full-text weight for the search, determining the weight of full text matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"weights":{"$ref":"#/components/schemas/Collection"}},"description":"Data Transfer Object representing the collection search type details."},"Collection":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"semanticWeight":{"type":"integer","format":"int32"},"previousUserInput":{"type":"integer","format":"int32"},"threshold":{"type":"integer","format":"int32"},"topK":{"type":"integer","format":"int32"},"trainingStatus":{"type":"string"},"removed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"documents":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}},"documentsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}}}},"Document":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"collection":{"$ref":"#/components/schemas/Collection"},"format":{"$ref":"#/components/schemas/DocumentFormat"},"storageFilename":{"type":"string"},"trainingStatus":{"type":"string"},"filename":{"type":"string"},"windowsLength":{"type":"integer","format":"int32"},"overlap":{"type":"integer","format":"int32"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questions":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"questionsSize":{"type":"integer","format":"int32"},"formatText":{"type":"string"},"deleted":{"type":"boolean"},"toUpdateCollection":{"type":"boolean"},"toRegister":{"type":"boolean"},"toDelete":{"type":"boolean"},"questionsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"formatId":{"type":"integer","format":"int64"},"registered":{"type":"boolean"},"active":{"type":"boolean"}}},"DocumentFormat":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"format":{"type":"string"},"description":{"type":"string"},"pdf":{"type":"boolean"}}},"Question":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"document":{"$ref":"#/components/schemas/Document"},"name":{"type":"string"},"description":{"type":"string"},"webhook":{"type":"string"},"headers":{"type":"string"},"transactional":{"type":"boolean"},"authType":{"type":"string"},"basicToken":{"type":"string"},"bearerToken":{"type":"string"},"grantType":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"authUsername":{"type":"string"},"authPassword":{"type":"string"},"evaluable":{"type":"boolean"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"updateContent":{"type":"boolean"},"trainingStatus":{"type":"string"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questionVariables":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/QuestionVariable"}},"variablesSize":{"type":"integer","format":"int32"},"oauthUrl":{"type":"string"},"active":{"type":"boolean"}}},"QuestionVariable":{"type":"object","properties":{"uuid":{"type":"string"},"question":{"$ref":"#/components/schemas/Question"},"variation":{"type":"string"}}},"CollectionResponseDTO":{"required":["name","previousUserInput","searchType","threshold","topK"],"type":"object","properties":{"name":{"maxLength":100,"type":"string","description":"Name of the collection"},"description":{"maxLength":250,"type":"string","description":"Description of the collection"},"searchType":{"$ref":"#/components/schemas/CollectionSearchTypeDTO"},"previousUserInput":{"maximum":5,"minimum":0,"type":"integer","description":"Previous user input rating","format":"int32"},"threshold":{"maximum":100,"minimum":1,"type":"integer","description":"Threshold value","format":"int32"},"topK":{"maximum":10,"minimum":1,"type":"integer","description":"Top K value for results","format":"int32"},"uuid":{"type":"string","description":"Universal Unique Identifier for the collection"},"isDefault":{"type":"boolean","description":"A boolean indicating if this collection is default or not"},"documentCount":{"type":"integer","description":"Count of documents in the collection","format":"int32"}},"description":"DTO for Collection response"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}

> Find a specific collection

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}":{"get":{"tags":["Collections"],"summary":"Find a specific collection","operationId":"find_1","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"path","description":"Collection UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionResponseDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionResponseDTO":{"required":["name","previousUserInput","searchType","threshold","topK"],"type":"object","properties":{"name":{"maxLength":100,"type":"string","description":"Name of the collection"},"description":{"maxLength":250,"type":"string","description":"Description of the collection"},"searchType":{"$ref":"#/components/schemas/CollectionSearchTypeDTO"},"previousUserInput":{"maximum":5,"minimum":0,"type":"integer","description":"Previous user input rating","format":"int32"},"threshold":{"maximum":100,"minimum":1,"type":"integer","description":"Threshold value","format":"int32"},"topK":{"maximum":10,"minimum":1,"type":"integer","description":"Top K value for results","format":"int32"},"uuid":{"type":"string","description":"Universal Unique Identifier for the collection"},"isDefault":{"type":"boolean","description":"A boolean indicating if this collection is default or not"},"documentCount":{"type":"integer","description":"Count of documents in the collection","format":"int32"}},"description":"DTO for Collection response"},"CollectionSearchTypeDTO":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"Type of the collection search. Possible values are 'semantic', 'full_text' and 'hybrid'"},"semanticWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Semantic weight associated with the search, indicating the importance of semantic matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"fullTextWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Full-text weight for the search, determining the weight of full text matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"weights":{"$ref":"#/components/schemas/Collection"}},"description":"Data Transfer Object representing the collection search type details."},"Collection":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"semanticWeight":{"type":"integer","format":"int32"},"previousUserInput":{"type":"integer","format":"int32"},"threshold":{"type":"integer","format":"int32"},"topK":{"type":"integer","format":"int32"},"trainingStatus":{"type":"string"},"removed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"documents":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}},"documentsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}}}},"Document":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"collection":{"$ref":"#/components/schemas/Collection"},"format":{"$ref":"#/components/schemas/DocumentFormat"},"storageFilename":{"type":"string"},"trainingStatus":{"type":"string"},"filename":{"type":"string"},"windowsLength":{"type":"integer","format":"int32"},"overlap":{"type":"integer","format":"int32"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questions":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"questionsSize":{"type":"integer","format":"int32"},"formatText":{"type":"string"},"deleted":{"type":"boolean"},"toUpdateCollection":{"type":"boolean"},"toRegister":{"type":"boolean"},"toDelete":{"type":"boolean"},"questionsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"formatId":{"type":"integer","format":"int64"},"registered":{"type":"boolean"},"active":{"type":"boolean"}}},"DocumentFormat":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"format":{"type":"string"},"description":{"type":"string"},"pdf":{"type":"boolean"}}},"Question":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"document":{"$ref":"#/components/schemas/Document"},"name":{"type":"string"},"description":{"type":"string"},"webhook":{"type":"string"},"headers":{"type":"string"},"transactional":{"type":"boolean"},"authType":{"type":"string"},"basicToken":{"type":"string"},"bearerToken":{"type":"string"},"grantType":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"authUsername":{"type":"string"},"authPassword":{"type":"string"},"evaluable":{"type":"boolean"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"updateContent":{"type":"boolean"},"trainingStatus":{"type":"string"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questionVariables":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/QuestionVariable"}},"variablesSize":{"type":"integer","format":"int32"},"oauthUrl":{"type":"string"},"active":{"type":"boolean"}}},"QuestionVariable":{"type":"object","properties":{"uuid":{"type":"string"},"question":{"$ref":"#/components/schemas/Question"},"variation":{"type":"string"}}},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## PUT /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}

> Update a specific collection

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}":{"put":{"tags":["Collections"],"summary":"Update a specific collection","operationId":"update","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"path","description":"Collection UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionRequestDTO"}}},"required":true},"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionResponseDTO"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionRequestDTO":{"required":["name","previousUserInput","searchType","threshold","topK"],"type":"object","properties":{"name":{"maxLength":100,"type":"string","description":"Name of the collection"},"description":{"maxLength":250,"type":"string","description":"Description of the collection"},"searchType":{"$ref":"#/components/schemas/CollectionSearchTypeDTO"},"previousUserInput":{"maximum":5,"minimum":0,"type":"integer","description":"Previous user input rating","format":"int32"},"threshold":{"maximum":100,"minimum":1,"type":"integer","description":"Threshold value","format":"int32"},"topK":{"maximum":10,"minimum":1,"type":"integer","description":"Top K value for results","format":"int32"}},"description":"Data Transfer Object for Collection Requests"},"CollectionSearchTypeDTO":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"Type of the collection search. Possible values are 'semantic', 'full_text' and 'hybrid'"},"semanticWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Semantic weight associated with the search, indicating the importance of semantic matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"fullTextWeight":{"maximum":100,"minimum":0,"type":"integer","description":"Full-text weight for the search, determining the weight of full text matching. When type is 'hybrid', ensure that the sum of semanticWeight and fullTextWeight equals 100.","format":"int32"},"weights":{"$ref":"#/components/schemas/Collection"}},"description":"Data Transfer Object representing the collection search type details."},"Collection":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"semanticWeight":{"type":"integer","format":"int32"},"previousUserInput":{"type":"integer","format":"int32"},"threshold":{"type":"integer","format":"int32"},"topK":{"type":"integer","format":"int32"},"trainingStatus":{"type":"string"},"removed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"documents":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}},"documentsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Document"}}}},"Document":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"collection":{"$ref":"#/components/schemas/Collection"},"format":{"$ref":"#/components/schemas/DocumentFormat"},"storageFilename":{"type":"string"},"trainingStatus":{"type":"string"},"filename":{"type":"string"},"windowsLength":{"type":"integer","format":"int32"},"overlap":{"type":"integer","format":"int32"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questions":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"questionsSize":{"type":"integer","format":"int32"},"formatText":{"type":"string"},"deleted":{"type":"boolean"},"toUpdateCollection":{"type":"boolean"},"toRegister":{"type":"boolean"},"toDelete":{"type":"boolean"},"questionsNotRemoved":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Question"}},"formatId":{"type":"integer","format":"int64"},"registered":{"type":"boolean"},"active":{"type":"boolean"}}},"DocumentFormat":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"format":{"type":"string"},"description":{"type":"string"},"pdf":{"type":"boolean"}}},"Question":{"type":"object","properties":{"uuid":{"type":"string"},"botUuid":{"type":"string"},"document":{"$ref":"#/components/schemas/Document"},"name":{"type":"string"},"description":{"type":"string"},"webhook":{"type":"string"},"headers":{"type":"string"},"transactional":{"type":"boolean"},"authType":{"type":"string"},"basicToken":{"type":"string"},"bearerToken":{"type":"string"},"grantType":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"authUsername":{"type":"string"},"authPassword":{"type":"string"},"evaluable":{"type":"boolean"},"enabled":{"type":"boolean"},"removed":{"type":"boolean"},"updateContent":{"type":"boolean"},"trainingStatus":{"type":"string"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"questionVariables":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/QuestionVariable"}},"variablesSize":{"type":"integer","format":"int32"},"oauthUrl":{"type":"string"},"active":{"type":"boolean"}}},"QuestionVariable":{"type":"object","properties":{"uuid":{"type":"string"},"question":{"$ref":"#/components/schemas/Question"},"variation":{"type":"string"}}},"CollectionResponseDTO":{"required":["name","previousUserInput","searchType","threshold","topK"],"type":"object","properties":{"name":{"maxLength":100,"type":"string","description":"Name of the collection"},"description":{"maxLength":250,"type":"string","description":"Description of the collection"},"searchType":{"$ref":"#/components/schemas/CollectionSearchTypeDTO"},"previousUserInput":{"maximum":5,"minimum":0,"type":"integer","description":"Previous user input rating","format":"int32"},"threshold":{"maximum":100,"minimum":1,"type":"integer","description":"Threshold value","format":"int32"},"topK":{"maximum":10,"minimum":1,"type":"integer","description":"Top K value for results","format":"int32"},"uuid":{"type":"string","description":"Universal Unique Identifier for the collection"},"isDefault":{"type":"boolean","description":"A boolean indicating if this collection is default or not"},"documentCount":{"type":"integer","description":"Count of documents in the collection","format":"int32"}},"description":"DTO for Collection response"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}}}}}
```

## DELETE /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}

> Delete a specific collection

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/{collectionUUID}":{"delete":{"tags":["Collections"],"summary":"Delete a specific collection","operationId":"delete","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"path","description":"Collection UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionSimpleDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionSimpleDTO":{"required":["name"],"type":"object","properties":{"uuid":{"type":"string","description":"Universally Unique Identifier for the collection."},"name":{"type":"string","description":"Name of the collection."},"trainingStatus":{"type":"string","description":"Collection current status"}},"description":"Represents a simple collection DTO with uuid and name."},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

### Auxiliary Methods

## POST /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/validation-name

> Validate collection name

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collections","description":"APIs for managing collections"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/collections/validation-name":{"post":{"tags":["Collections"],"summary":"Validate collection name","operationId":"validationName","parameters":[{"name":"orgUUID","in":"path","description":"Organization UUID","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"Environment UUID","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"Bot UUID","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionSimpleDTO"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionSimpleDTO":{"required":["name"],"type":"object","properties":{"uuid":{"type":"string","description":"Universally Unique Identifier for the collection."},"name":{"type":"string","description":"Name of the collection."},"trainingStatus":{"type":"string","description":"Collection current status"}},"description":"Represents a simple collection DTO with uuid and name."},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## Documents

### Pagination and Listing

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/pagination

> Returns the pagination of a Bot's Documents.\
> Pagination starts at page 1 instead of the standard 0.<br>

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/pagination":{"get":{"tags":["documents"],"summary":"Returns the pagination of a Bot's Documents.\nPagination starts at page 1 instead of the standard 0.\n","operationId":"pagination_1","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The number of page and the default is 1","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"linesPerPage","in":"query","description":"The number of services per pages and the default is 5","required":false,"schema":{"type":"integer","format":"int32","default":5}},{"name":"orderBy","in":"query","description":"Field want to ordernate, the default is 'updatedAt'","required":false,"schema":{"type":"string","default":"updatedAt"}},{"name":"direction","in":"query","description":"Direction of ordenation, ASC or DESC. The default is DESC","required":false,"schema":{"type":"string","default":"DESC"}},{"name":"searchTerms","in":"query","description":"Names or tags to filter the search","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageDocumentPageDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"PageDocumentPageDTO":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/DocumentPageDTO"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"unpaged":{"type":"boolean"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"}}},"SortObject":{"type":"object","properties":{"unsorted":{"type":"boolean"},"sorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"DocumentPageDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"storageFileName":{"type":"string","description":"Document storage filename"},"filename":{"type":"string","description":"Document name"},"collectionUUID":{"type":"string","description":"Optional. Symbolic collectionUUID for document organizing"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"},"questions":{"type":"integer","description":"Number of questions inside the document","format":"int32"},"questionsIds":{"type":"array","description":"Question uuids inside the document","items":{"type":"string","description":"Question uuids inside the document"}},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"selected":{"type":"boolean","description":"True if document is selected and false if not"},"date":{"type":"integer","description":"Document creation date","format":"int64"},"uploaded":{"$ref":"#/components/schemas/UserDTO"},"tags":{"type":"array","description":"Tags saved to the document","items":{"type":"string","description":"Tags saved to the document"}},"format":{"type":"string","description":"Format of the document. The possibles is inside enum DocumentFormat"},"availabilityActions":{"type":"array","description":"Representing the availability-related actions that can be applied to a Document.","items":{"type":"string","description":"Representing the availability-related actions that can be applied to a Document.","enum":["DISABLEABLE","DELETABLE"]}}},"description":"DTO response with documents page data"},"UserDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Unique identifier for the user."},"name":{"type":"string","description":"The name of the user."},"imageUrl":{"type":"string","description":"URL for the user's profile image."}},"description":"Data Transfer Object for User Details."},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/quicksearch

> Returns a list of possible words to autocomplete in a search for Document names

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/quicksearch":{"get":{"tags":["documents"],"summary":"Returns a list of possible words to autocomplete in a search for Document names","operationId":"quicksearch_1","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}},{"name":"searchTerm","in":"query","description":"Word or part of word to get suggestion names of documents","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The limit of suggestions names in the response. The default value is 6","required":false,"schema":{"type":"integer","format":"int64","default":6}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/list

> Returns a complete list containing all of the Bot's Documents

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/list":{"get":{"tags":["documents"],"summary":"Returns a complete list containing all of the Bot's Documents","operationId":"list","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentListDTO"}}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"DocumentListDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"filename":{"type":"string","description":"Document name"},"storageFileName":{"type":"string","description":"Document storage filename"},"collectionUUID":{"type":"string","description":"Optional. Symbolic collectionUUID for document organizing"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"},"questionSize":{"type":"integer","description":"Number of questions","format":"int32"},"enabled":{"type":"boolean","description":"Document enabled"},"removed":{"type":"boolean","description":"Document removed"},"updatedAt":{"type":"string","description":"Date of last document update","format":"date-time"},"trainingStatus":{"type":"string","description":"Document training status"},"format":{"type":"string","description":"Format of the document. The possibles is inside enum DocumentFormat"}},"description":"DTO response with documents data"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

### CRUD Operations

## POST /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents

> Upload new document

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents":{"post":{"tags":["documents"],"summary":"Upload new document","operationId":"upload","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"windowsLength","in":"query","description":"The length of windows for document processing, default value is 2000","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"overlap","in":"query","description":"The overlap length for document processing, default value is 0","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"tag","in":"query","description":"The tag name to save with document","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string"}}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"required":["document"],"type":"object","properties":{"document":{"type":"string","description":"The document to upload","format":"binary"},"name":{"type":"string","description":"The document name to save"},"collectionUUID":{"type":"string","description":"Optional. Symbolic collectionUUID for document organizing."}}}}}},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DocumentTagDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"DocumentTagDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"collectionUUID":{"type":"string","description":"Collection uuid for the document"},"storageFilename":{"type":"string","description":"Filename in minio"},"filename":{"type":"string","description":"Filename in database"},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"},"tags":{"uniqueItems":true,"type":"array","description":"Tags saved to the document","items":{"type":"string","description":"Tags saved to the document"}}},"description":"DTO response with document created with tags"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}

> Show a document

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}":{"get":{"tags":["documents"],"summary":"Show a document","operationId":"show_1","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"documentUUID","in":"path","description":"A valid service Uuid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DocumentContentDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"DocumentContentDTO":{"type":"object","properties":{"filename":{"type":"string","description":"Document name"},"enabled":{"type":"boolean","description":"Document enabled"},"lastEdition":{"$ref":"#/components/schemas/LastModifiedDTO"},"collectionUUID":{"type":"string","description":"Optional. Symbolic collectionUUID for document organizing."},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"},"questionCount":{"type":"integer","description":"Number of questions","format":"int32"},"questionsIds":{"type":"array","description":"Question uuids inside the document","items":{"type":"string","description":"Question uuids inside the document"}},"tags":{"type":"array","description":"Tags of the document","items":{"$ref":"#/components/schemas/TagDTO"}},"format":{"type":"string","description":"Format of the document. The possibles is inside enum DocumentFormat"}},"description":"DTO document content response"},"LastModifiedDTO":{"type":"object","properties":{"name":{"type":"string","description":"User name"},"image":{"type":"string","description":"User image url"},"date":{"type":"integer","description":"Last modification","format":"int64"}},"description":"Last modified DTO"},"TagDTO":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of tag"}},"description":"DTO user to request create or update of tags of transactional service and response with this data"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## PUT /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}/update

> Update one document, the file document or the data (name, tags...)

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}/update":{"put":{"tags":["documents"],"summary":"Update one document, the file document or the data (name, tags...)","operationId":"updateDocument","parameters":[{"name":"orgUUID","in":"path","description":"It is the organization uuid where the bot is.","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"It is the environment uuid where the bot is.","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"It is the identification of the bot.","required":true,"schema":{"type":"string"}},{"name":"documentUUID","in":"path","description":"It is the identification of the document","required":true,"schema":{"type":"string"}},{"name":"windowsLength","in":"query","description":"The length of windows for document processing, default value is 2000","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"overlap","in":"query","description":"The overlap length for document processing, default value is 0","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"tag","in":"query","description":"The tag name to save with document","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string"}}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"required":["name"],"type":"object","properties":{"document":{"type":"string","description":"It is the new file to update","format":"binary"},"name":{"type":"string","description":"It is the new document name to update"},"collectionUUID":{"type":"string","description":"Optional. Symbolic collectionUUID for document organizing. Sending this as null will overwrite existing repository Id."}}}}}},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DocumentTagDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"DocumentTagDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"collectionUUID":{"type":"string","description":"Collection uuid for the document"},"storageFilename":{"type":"string","description":"Filename in minio"},"filename":{"type":"string","description":"Filename in database"},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"},"tags":{"uniqueItems":true,"type":"array","description":"Tags saved to the document","items":{"type":"string","description":"Tags saved to the document"}}},"description":"DTO response with document created with tags"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

{% openapi src="<https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0>" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}" method="put" %}
[eva-al-4.7.0.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media\&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0)
{% endopenapi %}

{% openapi src="<https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0>" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/{documentUUID}" method="delete" %}
[eva-al-4.7.0.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media\&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0)
{% endopenapi %}

### Bulk Operations

{% openapi src="<https://content.gitbook.com/content/n6zS4HeuuVpRHZEvDiFU/blobs/e6ZpNGRimZh4bDxD8xRT/eva-al-4.1.0.yaml>" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/export" method="post" %}
[eva-al-4.1.0.yaml](https://content.gitbook.com/content/n6zS4HeuuVpRHZEvDiFU/blobs/e6ZpNGRimZh4bDxD8xRT/eva-al-4.1.0.yaml)
{% endopenapi %}

## DELETE /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/massive-delete

> Bulk removes Documents with the provided uuid list.

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"documents","description":"Management for uploading, view, listing, removing and enabling documents"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/documents/massive-delete":{"delete":{"tags":["documents"],"summary":"Bulk removes Documents with the provided uuid list.","operationId":"massiveRemove","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocumentRequestDTO"}}},"required":true},"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MassiveDeleteResponseDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"ListDocumentRequestDTO":{"type":"object","properties":{"uuids":{"type":"array","description":"A list of Uuid of question","items":{"type":"string","description":"A list of Uuid of question"}}},"description":"Document uuids to delete"},"MassiveDeleteResponseDTO":{"type":"object","properties":{"success":{"type":"array","description":"Name of files deleted successfully","items":{"type":"string","description":"Name of files deleted successfully"}},"errors":{"type":"array","description":"name of files with error in deletion","items":{"type":"string","description":"name of files with error in deletion"}}},"description":"DTO response with massive document deletion data"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## Questions

### Paginations and Listings

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/pagination

> Returns the pagination of a Bot's Questions. Pagination starts at page 1 instead of the standard 0.

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/pagination":{"get":{"tags":["Questions"],"summary":"Returns the pagination of a Bot's Questions. Pagination starts at page 1 instead of the standard 0.","operationId":"pagination","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The number of page and the default is 1","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"linesPerPage","in":"query","description":"The number of services per pages and the default is 5","required":false,"schema":{"type":"integer","format":"int32","default":5}},{"name":"orderBy","in":"query","description":"Field want to ordernate, the default is 'updatedAt'","required":false,"schema":{"type":"string","default":"updatedAt"}},{"name":"direction","in":"query","description":"Direction of ordenation, ASC or DESC. The default is DESC","required":false,"schema":{"type":"string","default":"DESC"}},{"name":"filenames","in":"query","description":"Filename to filter the search","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"searchTerms","in":"query","description":"Names or tags to filter the search","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageQuestionPageDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"PageQuestionPageDTO":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/QuestionPageDTO"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"unpaged":{"type":"boolean"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"}}},"SortObject":{"type":"object","properties":{"unsorted":{"type":"boolean"},"sorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"QuestionPageDTO":{"type":"object","properties":{"id":{"type":"string","description":"Question id"},"name":{"type":"string","description":"Question name"},"description":{"type":"string","description":"Question description"},"variables":{"type":"integer","description":"Number of variables in this question","format":"int32"},"document":{"$ref":"#/components/schemas/DocumentDTO"},"enabled":{"type":"boolean","description":"Question enable status"},"selected":{"type":"boolean","description":"Question selected status"},"lastModified":{"$ref":"#/components/schemas/LastModifiedDTO"},"tags":{"type":"array","description":"Question tags list","items":{"type":"string","description":"Question tags list"}},"updatedAt":{"type":"string","description":"Question last updated","format":"date-time"}}},"DocumentDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"collectionUUID":{"type":"string","description":"Collection uuid for the document"},"storageFilename":{"type":"string","description":"Filename in minio"},"filename":{"type":"string","description":"Filename in database"},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"}},"description":"DTO response with document created"},"LastModifiedDTO":{"type":"object","properties":{"name":{"type":"string","description":"User name"},"image":{"type":"string","description":"User image url"},"date":{"type":"integer","description":"Last modification","format":"int64"}},"description":"Last modified DTO"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/quicksearch

> Returning a list of possible words to autocomplete in search

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/quicksearch":{"get":{"tags":["Questions"],"summary":"Returning a list of possible words to autocomplete in search","operationId":"quicksearch","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}},{"name":"searchTerm","in":"query","description":"Word or part of word to get suggestion names of documents","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The limit of suggestions names in the response. The default value is 6","required":false,"schema":{"type":"integer","format":"int64","default":6}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

### CRUD Operations

{% openapi src="<https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FZoxZZMHoTU9cDM9a4xhJ%2Feva-al-4.7.1.yaml?alt=media&token=0d73d336-c674-4ea5-a161-ab1277c74a78>" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions" method="post" %}
[eva-al-4.7.1.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FZoxZZMHoTU9cDM9a4xhJ%2Feva-al-4.7.1.yaml?alt=media\&token=0d73d336-c674-4ea5-a161-ab1277c74a78)
{% endopenapi %}

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/{questionUUID}

> Retrieves information from a specific Question, provided its UUID.

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/{questionUUID}":{"get":{"tags":["Questions"],"summary":"Retrieves information from a specific Question, provided its UUID.","operationId":"findQuestion","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"questionUUID","in":"path","description":"A valid question Uuid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResponseQuestionDTO"}}}},"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResponseQuestionDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"ResponseQuestionDTO":{"type":"object","properties":{"id":{"type":"string","description":"Question id"},"botId":{"type":"string","description":"A uuid of bot assigned to this question"},"document":{"$ref":"#/components/schemas/DocumentDTO"},"name":{"type":"string","description":"Question name"},"description":{"type":"string","description":"Question description"},"variables":{"uniqueItems":true,"type":"array","description":"Question variables list","items":{"$ref":"#/components/schemas/QuestionVariableDTO"}},"webhook":{"type":"string","description":"Answer endpoint webhook"},"headers":{"type":"string","description":"Webhook headers"},"transactional":{"type":"boolean","description":"Question transactional status"},"enabled":{"type":"boolean","description":"Question enabled status"},"removed":{"type":"boolean","description":"Question removed status"},"updateContent":{"type":"boolean","description":"True if the question content can be predict again because document update"},"evaluable":{"type":"boolean","description":"Question evaluable status"},"tags":{"type":"array","description":"Question tags","items":{"$ref":"#/components/schemas/TagDTO"}},"answerTemplates":{"uniqueItems":true,"type":"array","description":"Question answer templates","items":{"$ref":"#/components/schemas/AnswerTemplateRequestDTO"}},"transactionalAuth":{"$ref":"#/components/schemas/AuthDTO"},"createdAt":{"type":"string","description":"When question was created","format":"date-time"},"updatedAt":{"type":"string","description":"When question was updated","format":"date-time"},"updatedBy":{"type":"string","description":"User uuid that changed"}}},"DocumentDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"collectionUUID":{"type":"string","description":"Collection uuid for the document"},"storageFilename":{"type":"string","description":"Filename in minio"},"filename":{"type":"string","description":"Filename in database"},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"}},"description":"DTO response with document created"},"QuestionVariableDTO":{"type":"object","properties":{"id":{"type":"string","description":"Variable id"},"variable":{"type":"string","description":"The variable value"}},"description":"Question variables"},"TagDTO":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of tag"}},"description":"DTO user to request create or update of tags of transactional service and response with this data"},"AnswerTemplateRequestDTO":{"required":["channelId","channelTypeId"],"type":"object","properties":{"id":{"type":"string","description":"A Uuid of answaer template"},"content":{"type":"object","description":"A Structure containing usages of this template. This is a freeform JSON."},"type":{"type":"string","description":"The answer template's type."},"channelTypeId":{"type":"integer","description":"The UUID of the assigned channel's type.","format":"int64"},"channelId":{"type":"string","description":"A Uuid of a channel assigned to this template."},"technicalText":{"type":"string","description":"A freeform text with technical configurations."}},"description":"Question answer templates"},"AuthDTO":{"type":"object","properties":{"authType":{"$ref":"#/components/schemas/AuthTypeEnum"},"basicToken":{"type":"string","description":"Basic Token for Basic Auth Header"},"bearerToken":{"type":"string","description":"Bearer Token for Bearer Token Auth Header"},"oauthUrl":{"type":"string","description":"URL for authentication with oAuth Method"},"grantType":{"$ref":"#/components/schemas/GrantTypeEnum"},"clientId":{"type":"string","description":"Client Id to be used with oAuth Method"},"clientSecret":{"type":"string","description":"Client Secret to be used with oAuth Method and grant type 'client_credentials'"},"authUsername":{"type":"string","description":"Username to be used with oAuth Method and grant type 'password'"},"authPassword":{"type":"string","description":"Password to be used with oAuth Method and grant type 'password'"}},"description":"This class contains all the necessary information for different authentication types. It validates whether the provided authentication data is complete based on the specified type."},"AuthTypeEnum":{"type":"string","description":"Enum describing if cell uses an auth method, and which.","enum":["AUTH_NONE","AUTH_BASIC","AUTH_BEARER","AUTH_OAUTH"]},"GrantTypeEnum":{"type":"string","description":"Grant type to be used with oAuth Method","enum":["CLIENT_CREDENTIALS","PASSWORD","REFRESH_TOKEN"]},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## PUT /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/{questionUUID}

> Updates a Question.

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/{questionUUID}":{"put":{"tags":["Questions"],"summary":"Updates a Question.","operationId":"updateQuestion","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}},{"name":"questionUUID","in":"path","description":"A valid question Uuid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestQuestionDTO"}}},"required":true},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResponseQuestionDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"RequestQuestionDTO":{"required":["answerTemplates","documentId","enabled","name"],"type":"object","properties":{"documentId":{"type":"string","description":"A Uuid of a document assigned to this question."},"name":{"type":"string","description":"Question name"},"description":{"type":"string","description":"Question description"},"variables":{"type":"array","description":"List of examples of question","items":{"type":"string","description":"List of examples of question"}},"enabled":{"type":"boolean","description":"Question enabled/disabled status"},"evaluable":{"type":"boolean","description":"Question evaluable status"},"transactional":{"type":"boolean","description":"Question transactional status"},"transactionalAuth":{"$ref":"#/components/schemas/AuthDTO"},"webhook":{"type":"string","description":"Webhook address endpoint"},"headers":{"type":"object","description":"Webhook headers"},"answerTemplates":{"uniqueItems":true,"type":"array","description":"Questions answer templates","items":{"$ref":"#/components/schemas/AnswerTemplateRequestDTO"}},"tags":{"type":"array","description":"Questions tags","items":{"$ref":"#/components/schemas/TagDTO"}}}},"AuthDTO":{"type":"object","properties":{"authType":{"$ref":"#/components/schemas/AuthTypeEnum"},"basicToken":{"type":"string","description":"Basic Token for Basic Auth Header"},"bearerToken":{"type":"string","description":"Bearer Token for Bearer Token Auth Header"},"oauthUrl":{"type":"string","description":"URL for authentication with oAuth Method"},"grantType":{"$ref":"#/components/schemas/GrantTypeEnum"},"clientId":{"type":"string","description":"Client Id to be used with oAuth Method"},"clientSecret":{"type":"string","description":"Client Secret to be used with oAuth Method and grant type 'client_credentials'"},"authUsername":{"type":"string","description":"Username to be used with oAuth Method and grant type 'password'"},"authPassword":{"type":"string","description":"Password to be used with oAuth Method and grant type 'password'"}},"description":"This class contains all the necessary information for different authentication types. It validates whether the provided authentication data is complete based on the specified type."},"AuthTypeEnum":{"type":"string","description":"Enum describing if cell uses an auth method, and which.","enum":["AUTH_NONE","AUTH_BASIC","AUTH_BEARER","AUTH_OAUTH"]},"GrantTypeEnum":{"type":"string","description":"Grant type to be used with oAuth Method","enum":["CLIENT_CREDENTIALS","PASSWORD","REFRESH_TOKEN"]},"AnswerTemplateRequestDTO":{"required":["channelId","channelTypeId"],"type":"object","properties":{"id":{"type":"string","description":"A Uuid of answaer template"},"content":{"type":"object","description":"A Structure containing usages of this template. This is a freeform JSON."},"type":{"type":"string","description":"The answer template's type."},"channelTypeId":{"type":"integer","description":"The UUID of the assigned channel's type.","format":"int64"},"channelId":{"type":"string","description":"A Uuid of a channel assigned to this template."},"technicalText":{"type":"string","description":"A freeform text with technical configurations."}},"description":"Question answer templates"},"TagDTO":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of tag"}},"description":"DTO user to request create or update of tags of transactional service and response with this data"},"ResponseQuestionDTO":{"type":"object","properties":{"id":{"type":"string","description":"Question id"},"botId":{"type":"string","description":"A uuid of bot assigned to this question"},"document":{"$ref":"#/components/schemas/DocumentDTO"},"name":{"type":"string","description":"Question name"},"description":{"type":"string","description":"Question description"},"variables":{"uniqueItems":true,"type":"array","description":"Question variables list","items":{"$ref":"#/components/schemas/QuestionVariableDTO"}},"webhook":{"type":"string","description":"Answer endpoint webhook"},"headers":{"type":"string","description":"Webhook headers"},"transactional":{"type":"boolean","description":"Question transactional status"},"enabled":{"type":"boolean","description":"Question enabled status"},"removed":{"type":"boolean","description":"Question removed status"},"updateContent":{"type":"boolean","description":"True if the question content can be predict again because document update"},"evaluable":{"type":"boolean","description":"Question evaluable status"},"tags":{"type":"array","description":"Question tags","items":{"$ref":"#/components/schemas/TagDTO"}},"answerTemplates":{"uniqueItems":true,"type":"array","description":"Question answer templates","items":{"$ref":"#/components/schemas/AnswerTemplateRequestDTO"}},"transactionalAuth":{"$ref":"#/components/schemas/AuthDTO"},"createdAt":{"type":"string","description":"When question was created","format":"date-time"},"updatedAt":{"type":"string","description":"When question was updated","format":"date-time"},"updatedBy":{"type":"string","description":"User uuid that changed"}}},"DocumentDTO":{"type":"object","properties":{"uuid":{"type":"string","description":"Document uuid"},"collectionUUID":{"type":"string","description":"Collection uuid for the document"},"storageFilename":{"type":"string","description":"Filename in minio"},"filename":{"type":"string","description":"Filename in database"},"enabled":{"type":"boolean","description":"True if document is enabled and false if not"},"windowsLength":{"type":"integer","description":"Length of windows used in processing","format":"int32"},"overlap":{"type":"integer","description":"Overlap value for document processing","format":"int32"}},"description":"DTO response with document created"},"QuestionVariableDTO":{"type":"object","properties":{"id":{"type":"string","description":"Variable id"},"variable":{"type":"string","description":"The variable value"}},"description":"Question variables"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## DELETE /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions

> &#x20;   Deletes a Question. The question is symbolically removed via the 'removed' parameter\
> &#x20;   rather than deleted from the database.<br>

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions":{"delete":{"tags":["Questions"],"summary":"    Deletes a Question. The question is symbolically removed via the 'removed' parameter\n    rather than deleted from the database.\n","operationId":"deleteQuestions","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocumentRequestDTO"}}},"required":true},"responses":{"200":{"description":"No Content","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MassiveDeleteResponseDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"ListDocumentRequestDTO":{"type":"object","properties":{"uuids":{"type":"array","description":"A list of Uuid of question","items":{"type":"string","description":"A list of Uuid of question"}}},"description":"Document uuids to delete"},"MassiveDeleteResponseDTO":{"type":"object","properties":{"success":{"type":"array","description":"Name of files deleted successfully","items":{"type":"string","description":"Name of files deleted successfully"}},"errors":{"type":"array","description":"name of files with error in deletion","items":{"type":"string","description":"name of files with error in deletion"}}},"description":"DTO response with massive document deletion data"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

### Auxiliary Methods

## POST /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/variable

> Validate sample availability. This endpoint returns if a variable/sample\
> for the question is not previously registered and still available. Variables\
> sent through the Create Question endpoint should be validated here beforehand.\
> The Question Creation endpoint will not inform you the cause of the error it\
> will throw otherwise.<br>

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/variable":{"post":{"tags":["Questions"],"summary":"Validate sample availability. This endpoint returns if a variable/sample\nfor the question is not previously registered and still available. Variables\nsent through the Create Question endpoint should be validated here beforehand.\nThe Question Creation endpoint will not inform you the cause of the error it\nwill throw otherwise.\n","operationId":"checkQuestionVariables","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableDTO"}}},"required":true},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuestionVariableDTO"}}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"VariableDTO":{"type":"object","properties":{"variable":{"type":"string","description":"Example of the question"}}},"QuestionVariableDTO":{"type":"object","properties":{"id":{"type":"string","description":"Variable id"},"variable":{"type":"string","description":"The variable value"}},"description":"Question variables"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## PUT /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/change-enable

> Bulk enables or disables Questions. All questions included whose\
> UUID are included in the body have their enabling field reversed.<br>

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Questions","description":"Management for create, view, listing, removing and enabling questions"}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/questions/change-enable":{"put":{"tags":["Questions"],"summary":"Bulk enables or disables Questions. All questions included whose\nUUID are included in the body have their enabling field reversed.\n","operationId":"changeEnableQuestions","parameters":[{"name":"orgUUID","in":"path","description":"A valid organization Uuid","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"A valid environment Uuid","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"A valid bot Uuid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionChangeEnableDTO"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"QuestionChangeEnableDTO":{"type":"object","properties":{"questionsIds":{"type":"array","description":"List the questions ids","items":{"type":"string","description":"List the questions ids"}}}},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## Knowledge AI

## GET /org/{orgUUID}/env/{envUUID}/collections/limits

> Retrieve collection limits for a specific organization and environment

```json
{"openapi":"3.0.1","info":{"title":"eva-al API Documentation","version":"4.8.0"},"tags":[{"name":"Collection Environment","description":"Handles operations for collections within environments"}],"paths":{"/org/{orgUUID}/env/{envUUID}/collections/limits":{"get":{"tags":["Collection Environment"],"summary":"Retrieve collection limits for a specific organization and environment","operationId":"limits","parameters":[{"name":"orgUUID","in":"path","description":"UUID of the organization","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"UUID of the environment","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CollectionLimitDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"CollectionLimitDTO":{"type":"object","properties":{"quantity":{"type":"integer","description":"Quantity indicating the limit of the collection per bot.","format":"int32"}},"description":"DTO for representing the collection limit."},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

{% openapi src="<https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0>" path="/org/{orgUUID}/env/{envUUID}/documents/limits" method="get" %}
[eva-al-4.7.0.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FJ2prOKVsd9tLuo0uo0Sa%2Feva-al-4.7.0.yaml?alt=media\&token=b5c129ee-50ba-4947-a4ae-d145ce6b20a0)
{% endopenapi %}
