Add a source of the type file

Request parameters

The code field defines what a source can be used for in the AI agent.
The field helps the system understand how to use the data. For example, if a source contains a return policy, it should only be used in responses related to product returns.

  • If a source has a specific code, the AI ​​agent will not be able to use it in other contexts. For example, a document with code: "privacy_policy" will not be used to answer questions about shipping.
  • However, the suggested_reply feature does not take code into account, so all sources can be used to generate answers in the chat.

AI agent example

{
  "file_uuid": "550e8400-e29b-41d4-a716-446655440000",
  "lang": "en",
  "url": "https://drive-c.kommo.com/download/1e8b068c-0284-580a-a87d-71534b8fde41/550e8400-e29b-41d4-a716-446655440000/Testexample.docx",
  "available_functions": ["agent"],
  "code": "privacy_policy"
}

You added a source with available_functions: ["agent"] and code: "privacy_policy". This means that the AI ​​agent will only use it for responses about privacy policy and will not use it in other topics. The suggested_reply functionality will not index this source when searching for an answer.

AI Suggested Reply example


{
"file_uuid": "550e8400-e29b-41d4-a716-446655440000",
"lang": "en",
"url": "https://drive-c.kommo.com/download/1e8b068c-0284-580a-a87d-71534b8fde41/550e8400-e29b-41d4-a716-446655440000/Testexample.docx",
"available_functions": ["suggested_reply"],
"code": "shipping_policy"
}

You have added a source with available_functions: ["suggested_reply"]. When generating responses, this functionality does not check the value of the code field at all, but simply uses any sources available to it with the available functions field.

There are 5 unique policies in total:

  • contact information (contact_information)
  • personal data processing (privacy_policy)
  • return policy (return_and_refund_policy)
  • delivery policy (shipping_policy)
  • terms of service (terms_of_service)
_Displaying policies for AI Agent functionality in the interface_

Displaying policies for AI agent functionality in the interface

Response parameters

ParameterData typeDescription
idintID of the added source
namestringThe name of the added source.
updated_atintTime of the last source update. Time format is Unix Timestmp.
updated_byintID of the last user to perform an update on the source.
codestringAvailable values:

1. contact_information
2. privacy_policy
3. return_and_refund_policy
4. shipping_policy
5. terms_of_service
If the source does not have the code, this field does not come in the response.
Language
Credentials
OAuth2
Click Try It! to start a request and see the response here!