Public API for integration
The public API is exposed as part of the BusinessGPT Firewall.
- 1 How to get your API KEY
- 2 How to find CollectionID or ContentId?
- 3 1. Chat Service
- 4 2. Create Collection
- 5 3. Upload File
- 6 4. Get classifications
- 7 5. Get Content Status
- 8 6. Alive request
- 9 7. Search files in knowledgebase
- 10 8. Get Topics
- 11 9. Similar Words
- 12 10. Get Structured Data
- 13 11. Extract Text
- 14 Postman Samples for all APIs
How to get your API KEY
The API allows sending requests to AI service through HTTP requests.
Each user has a unique API key to authenticate the API. The API key is viewed on the User Settings page in the BusinessGPT dashboard here:
You can select the value, copy it, and use it in your API calls.
How to find CollectionID or ContentId?
Several API require PrvaiteDataID . To find the ID select the collection or document line and click on collection info
For a document:
For a SharePoint folder:
1. Chat Service
URL: https://[firewall API address]/firewallApi/v1/chat
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/chat
Method: POST
Description: Allows to send a prompt to the AI and receive a response based on some particular content or all company data
Request Body:
{
"APIKey": "see above",
"Prompt": "the question",
"DataSource ": "PrivateAndPublic" / "Public" / "Private",
OPTIONAL FIELDS:
"PrivateDataSource": "Content / "Collection" / "All",
"PrivateDataID ": "ID of the content or the collection",
"AIModel ": "",
"ChatId ": "",
"MaxWordsInAnswer ": "",
"User ": "",
"ChatAIService ": "",
"Context ": "",
}
All input parameters should be sent to the body in JSON format.
The URL is not the same as the Dashboard. Please get in touch with support to get the URL of your environment.
Parameters notes
APIKey- see here
DataSource - When the DataSource is set to public, the chat will use the pre-trained LLM knowledge, while the private value will use the uploaded company data.
PrivateDataSource- The PrivateDataSource values are not needed for public-only data
PrivateDataID is not needed when PrivateDataSource=All and for public-only data
AIModel (optional. Default will be as for the user. Available values: GPT3_5, GPT4, WizardLM, GPT4o, GPT_4o_Mini)
ChatId (optional): If provided, the question will be added to the existing chat with an external chat ID that equals the provided value. If no chat exists, a new one will be created.
MaxWordsInAnswer (optional) - If provided it should limit the number of words in the answer. The min word limit is 5.
User (optional) - the user that has asked the question
ChatAIService (optional. Default will be BusinessGPTDashboard . Available values: ChatGPT, Gemini, BusinessGPTDashboard , MicrosoftCopilot , Cohere, Claude, SlackBot)
Context (Optional) - the context of the chat. For example, the name of the Slack channel or Word document that the prompt was used from.
ChatName (optional) - the name of the chat in the auditing
Response:
Status Code: 200 OK
Response
PromptId
SuggestedQuestions
DataSources
Use collection in the source and the collection ID in the PrivateDataID to get answers from the content of a SharePoint folder, Site root, or Google Folder.
In case of an error, it will return an error message.
2. Create Collection
URL: https://[firewall API address]/firewallApi/v1/createcollection
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/createcollection
Method: POST
Description: Creates a collection
Request Body:
{
"APIKey": "",
"Collection name": "",
OPTIONAL FIELDS:
"CollectionId": "",
"AllowedGroups ": "{}"
"AllowedEmails ": ""
"Action": ""
}
All input parameters should be sent to the body in JSON format.
The URL is not the same as the Dashboard. Please get in touch with support to get the URL of your environment.
Parameters notes
APIKey- see here
Action (string, optional, default: "Add")
The action to be performed on the collection. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
Response:
Status Code: 200 OK
CollectionID
3. Upload File
URL: https://[firewall API address]/firewallApi/v1/upload
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/upload
Method: Post
Description: Allows to send file to the AI to be saved in BusinessGPT and receive its ID.
Request Body:
{
"APIKey": "",
"FileName": "",
"FileContent:": "in binary!",
OPTIONAL FIELDS:
"ContentSourceName:" "",
"ContentSourceIP": "",
"CollectionId": "",
"ContentId": "string",
"AllowedGroups ": ""
"AllowedEmails ": ""
"FilePath": ""
"Action": ""
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
FileName - with the extension as will be displayed in the UI for the user.
ContentSourceName (optional)- The name of the client using the API (for example, File loader)
ContentSourceIP (optional)- The IP of the client using the API (for example the host of the File loader)
Action (string, optional, default: "Add")
The action to be performed on the file. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
ContentId (string, required for
UpdatePermissions
,Rename
, orDelete
)CollectionID (Optional)
Response:
Status Code: 200 OK
ContentId
In case of an error, it will return an error message.
4. Get classifications
URL: GET: https://[firewall API address]/firewallApi/v1/getClassifications
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/getClassifications
Method: Get
Description: Allows user to get status and classifications of content
Request Body:
{
"APIKey": "",
"FileName": "",
"FileContent:": "in binary!",
OPTIONAL FIELDS:
"ContentSourceName:" "",
"ContentSourceIP": "",
"CollectionId": "",
"ContentId": "string",
"AllowedGroups ": ""
"AllowedEmails ": ""
"FilePath": ""
"Action": ""
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
Response:
Status Code: 200 OK
EmbeddingStatus- of the content (document) - New/SentToQueue/Processing/Done/Failed
Classifications(only if embedding status is Done) - list of classifications found for the content, by rule type (AI/Regular). Each classification contains the following fields:
RuleType - AI/Regular
Status - New/Processing/Done/Error/Skip
ClassificationRules (only if status is Done) - list of rules of the specified type that were matched for the content. Each rule contains the following fields:
RuleName
RuleDescription
RulePurpose
RuleType
SensitivityLevel
RuleValue
In case of an error, it will return an error message.
5. Get Content Status
URL: https://[firewall API address]/firewallApi/v1/content_status
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/content_status
Method: Get
Description: Allow user to get the current status of the content
Request Body:
{
"APIKey": "",
"AccountId": "",
"UserId": "",
"ContentId": ""
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
Action (string, optional, default: "Add")
The action to be performed on the collection. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
Response:
Status Code: 200 OK
Status
6. Alive request
URL: GET: https://[firewall API address]/firewallApi/v1/alive
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com
/firewallApi/v1/alive
Method: Get
Description: Allows user to get the status of the Firewall
Request Body: This request does not have a body
7. Search files in knowledgebase
URL:https://[firewall API address]/firewallApi/v1/search_knowledge_base_for_files
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com
/firewallApi/v1/search_knowledge_base_for_files
Method: Post
Description: Allow user to get a list of relevant files from the the database saved in BusinessGPT
Request Body:
{
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"APIKey": "",
"Query": "<Search term>",
"SimilaritySearchProvider": "for exmple- BusinessGPT",
OPTIONAL FIELDS:
"AIModel": "",
"AIServerType": "",
"UserProfile": "",
"MaxResults": "",
"KRequested": ""
}
All input parameters should be sent to the body in JSON format.
APIKey- see here
"SimilaritySearchProvider": "for exmple- BusinessGPT"
AIModel (optional. Default will be as for the user. Available values: GPT3_5, GPT4, WizardLM, GPT4o, GPT_4o_Mini)
"AIServerType": "for exmple- gpt"
"UserProfile" - (dictionary with 2 string fields: DisplayName and Email) - represent user information
"MaxResults": (int) - amount of maximum results for the request
"KRequested": (int)
Response:
Status Code: 200 OK
Response Content: JSON object with file_name link to S3, search score and relevant text chunk.
Response example:
{ "files_and_scores": [ { "file_name": "s3://bgpt-base-testing-files/FILES for BGPT testing/VC investor reach out scripts.pdf", "score": "", "text": "I really relate – I had a similar story that happened just before Yom Kippur! Or 190 chars Linkedin invite AGAT is a bootstrapped company offering ChatGPT-Like capabilities across all company data with an on-prem option to address business needs. Are you open to discussing possible investment? 291 chars Linkedin invite Based on your evident enthusiasm in the AI field, I believe you will be interested in learning about AGAT. AGAT is a bootstrapped company offering ChatGPT-Like capabilities across all company data with an on-prem option to address business needs. Are you open to discussing possible investment?" }, { "file_name": "s3://bgpt-base-testing-files/FILES for BGPT testing/AGAT Software Security and Privacy statement 8329.pdf", "score": "", "text": "This document and the information contained therein is proprietary and confidential. No part of this document may be disclosed in any manner to a third party without the prior written consent of AGAT Software Development LTD CONFIDENTIAL Privacy Policy and Data processing notice Agat Software (“We”) are committed to protecting and respecting your privacy. This privacy and security statement explains what measures we take to secure your data, the personal data we collect from you through our product, and how we use that data. This notice sets out the basis on which personal data we collect from you, or that you provide to us, will be processed by us. Please read the following document carefully to understand our views and practices regarding your personal data protection. Who are we and what do we do AGAT Software Development LTD is an innovative security provider specializing in security, compliance, governance, management, and productivity solutions for Unified Communication and Collaboration (UCC) services. SphereShield, AGAT`s flagship product, handles security threats related to authentication and identity as well as communication control, data protection, and content inspection. Securing your data All data is encrypted in transit to and from the internet, mitigating the risk of third parties accessing your data. Data can also be encrypted at rest if requested. We store data in data centers around the globe in accordance with the need of our customers." } ]
8. Get Topics
URL: GET: https://[firewall API address]/firewallApi/v1/topics
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/topics
Method: Post
Description: Allows user to get the 5-top topics of a document or a conversation
Request Body:
{
"APIKey": "",
"AccountId": "",
"UserId": "",
"InputType": "qa",
"InputData": [{"question": "___", "answer": "___"}],
OPTIONAL FIELDS:
"AIModel": " "
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
InputType - the only possible value is ‘qa’
InputData - the data for the topic request in a structure of questions and answers.
AIModel(optional. Default will be as for the user. Available values: GPT3_5, GPT4, GPT4o, GPT_4o_Mini)
Response:
Status Code: 200 OK
Topcis
Usage
In case of an error, it will return an error message.
9. Similar Words
URL: GET: https://[firewall API address]/firewallApi/v1/similar_words
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/similar_words
Method: Post
Description: Allows user to get the the similar words to the query in the provided terms
Request Body:
{
"APIKey": "",
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"Terms": "<terms>",
"Texts": [<optional - only if chunk_ids not provided>]
OPTIONAL FIELDS:
"ChunkIds": [<list of the chunk ids>]
"ModelName": ""
"Temperature": ""
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
Terms - (string), The model will provide similar words for this given terms.
Texts - (list of strings) the text that the model will provide the similar words from
Chunk_ids and texts can’t be provided together but one of them must be in the request
Response:
Status Code: 200 OK
Response Content:
Words array
Usage
In case of an error, it will return an error message.
10. Get Structured Data
URL: GET: https://[firewall API address]/firewallApi/v1/structured_data
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/structured_data
Method: Post
Description: Allows user to parse documents based on a specific structure.
Request Body:
option 1:
{
"APIKey": "","
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"ContentId": "{unique identifier of the document}",
"Structure": [a structure of the desierd table]
}
option 2:
{
"APIKey": "","
"ContentText": "{the content of the ducument to parse}""
"Structure": [a structure of the desierd table]
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
Response:
Status Code: 200 OK
Response Content:
Structure -the parsed data according to the given structure
Usage
In case of an error, it will return an error message.
11. Extract Text
URL: GET: https://[firewall API address]/firewallApi/v1/extract_text
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/extract_text
Method: Post
Description: Allows user to extract text from base-64 file content
Request Body:
{
"APIKey": "",
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"FileContent": """,
"FileName": ""
}
All input parameters should be sent to the body in JSON format.
Parameters notes
APIKey- see here
FileContent- (string)
Response:
Status Code: 200 OK
Response Content:
ExtractText -the readable file text
In case of an error, it will return an error message.
Postman Samples for all APIs
Attached is the Postman collection with example requests.