Public API for integration
The public API is exposed as part of the BusinessGPT Firewall.
Getting 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 dashboard. You need to copy it and send in the request.
Chat API service - POST request
POST: https://[firewall API address]/firewallApi/v1/chat
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/chat
Allows to send a prompt to the AI and receive a response based on some particular content or all company data
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.
APIKey
Prompt
DataSource - Possible values: PrivateAndPublic, Public, Private.
When the DataSource is set to public, the chat will use the pre-trained LLM knowledge, while the private value will use the company data uploaded.PrivateDataSource- Possible values - Content, Collection, All
The PrivateDataSource values are not needed for public-only dataPrivateDataID - The ID of the content or the collection
The PrivateDataID is not needed when privateDataSource =All.
Use collection in the source and the collection ID in the PraiveDataID to get answers from the content of a SharePoint folder, Site root, or Google Folder.
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
Output - for HTTP status OK (200):
PromptId
Response
In case of an error, it will return an error message.
How do you find the ID of the collection or content item for the “PromptScopeId” parameter?
To find the ID triple-click the line to get some system info:
ProjectID is the collection ID:
For a document it is the contentID as in the image below
Create Collection API service - POST request
POST: https://[firewall API address]/firewallApi/v1/createcollection
Creates a collection
Input parameters
APIKey
Collection name
Collection id (optional id)
AllowedGroups (optional)
AllowedEmails (optional)
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.
Output - for HTTP status OK (200):
CollectionID
Upload API service - POST request
POST: https://[firewall API address]/firewallApi/v1/upload
Sample URL for BGD15 environment:
https://https://bgd15-firewall.agatdemo.com/firewallApi/v1/upload
Allows to send file to the AI to be saved in BusinessGPT and receive its ID.
Input parameters - should be sent as form-data:
APIKey
FileName
FileContent - binary
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)
AllowedGroups (optional)
AllowedEmails (optional)
FilePath (optional)
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)
Output - for HTTP status OK (200):
ContentId
In case of an error, it will return an error message.
Get classifications service - GET request
GET: https://[firewall API address]/firewallApi/v1/getClassifications
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/getClassifications
Allows to get status and classifications of content.
Input parameters - should be sent as JSON:
APIKey
ContentId
Output - for HTTP status OK (200):
EmbeddingStatus
- of the content (document) - New/SentToQueue/Processing/Done/FailedClassifications
(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/RegularStatus
- New/Processing/Done/Error/SkipClassificationRules
(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.
Healthcheck service - GET request
GET: https://[firewall API address]/firewallApi/v1/alive
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com
/firewallApi/v1/alive
Postman Samples for all APIs
Attached is the Postman collection with example requests.