ZBrain Documentation
  • ZBrain Documentation
    • Components of ZBrain
    • Getting started with ZBrain
    • 📚Knowledge base
      • How to create a knowledge base?
      • Knowledge source
      • Information schema
      • File summary
      • Automated reasoning
      • Retrieval testing
      • Knowledge base settings
    • 📱APP
      • How to create a new app?
      • How to set up and customize your app?
      • How to access the app reporting dashboard?
    • 🤖ZBrain AI agents
      • Get started with agents on ZBrain
      • Deploying pre-built agents
      • Creating custom AI agents
        • Agent setup
        • Define input sources
        • Define Flow
          • Key elements of a Flow
          • Flow Components
            • Activepieces Platform
            • AITable
            • Airtable
            • Amazon S3
            • Amazon SNS
            • Amazon SQS
            • Amazon Textract
            • Apify
            • Apollo
            • Approval
            • Asana
            • Azure Communication Services
            • Azure Cosmos DB
            • Azure Document Intelligence
            • Azure OpenAI
            • Azure Translation
            • Bannerbear
            • Baserow
            • Beamer
            • Bedrock Claude
            • Bettermode
            • Binance
            • Bing Search
            • Blackbaud
            • Bonjoro
            • Box
            • Brevo
            • Brilliant Directories
            • Bubble
            • CSV
            • Calendly
            • Certopus
            • Clearout
            • Clockodo
            • Code
            • Confluence
            • Connections
            • Constant Contact
            • Contiguity
            • Contentful
            • Customer.io
            • Crypto
            • Databricks
            • Data Mapper
            • Date Helper
            • DeepL
            • Delay
            • Discord
            • Discourse
            • Drip
            • Dropbox
            • Dust
            • Facebook Pages
            • Figma
            • Files Helper
            • Flowise
            • Flowlu
            • Formbricks
            • Frame
            • Freshdesk
            • Freshsales
            • GCloud Pub/Sub
            • GenerateBanners
            • GhostCMS
            • GitHub
            • GitLab
            • Gmail
            • Google Calendar
            • Google Contacts
            • Google Docs
            • Google Drive
            • Google Forms
            • Google Gemini
            • Google My Business
            • Google Search
            • Google Search Console
            • Google Sheets
            • Google Tasks
            • Groq
            • Hacker News
            • Heartbeat
            • HubSpot
            • HTTP
            • Image Helper
            • Inputs
            • Instagram for Business
            • Intercom
            • Invoice Ninja
            • Jira Cloud
            • Jotform
            • Kimai
            • Kizeo Forms
            • LeadConnector
            • Line Bot
            • Linear
            • LinkedIn
            • LinkedIn Actions
            • LLMRails
            • Lusha
            • MailerLite
            • Mailchimp
            • Mautic
            • Microsoft Dynamics 365 Business Central
            • Microsoft Dynamics CRM
            • Microsoft Excel 365
            • Microsoft OneDrive
            • Microsoft Outlook Calendar
            • Microsoft Teams
            • Mixpanel
            • MongoDB
            • Notion
            • Odoo
            • OpenAI
            • OpenRouter
            • Pastebin
            • PDF
            • Postgres
            • PostHog
            • Pushover
            • Qdrant
            • Queue
            • Razorpay
            • Router
            • Salesforce
            • SendGrid
            • ServiceNow
            • SFTP
            • SharePoint
            • Slack
            • SMTP
            • Snowflake
            • SOAP
            • Spotify
            • Stability AI
            • Stable Diffusion Web UI
            • Storage
            • Stripe
            • SurrealDB
            • SurveyMonkey
            • Taskade
            • Telegram Bot
            • Text Helper
            • Trello
            • Twilio
            • Twitter
            • Utilities
            • WhatsApp Business
            • WordPress
            • XML
            • YouTube
            • ZBrain
            • Zendesk
            • ZeroBounce
            • Zoho Books
            • Zoho CRM
            • Zoho Invoice
            • Zoom
          • How to Define a Flow?
          • How to Test Each Step in the Flow?
        • Configure Additional Settings
        • Test and Deploy Agents
        • How to access, monitor, and manage agent performance and tasks?
    • Settings
    • 📖API Tutorials
      • 📚Knowledge base
        • Automated Reasoning
      • 📱APP
      • 🤖Agents
Powered by GitBook
On this page
  • Create APP
  • Get all APPs
  • Get APP by Id
  • Update APP
  • Delete APP
  • Query APP
  • Query stream APP
  • Get APP analytics
  • Get APP reports
  • Get filter options for the APP reports
  1. ZBrain Documentation
  2. API Tutorials

APP

Create APP

Creating an application with ZBrain is a streamlined process enabled by the platform's intuitive API. To create an app using ZBrain, initiate a POST request to the provided URL with the necessary headers and payload. This includes setting your app's configuration, description, email, knowledge base, and name.

  • Request URL: https://app.zbrain.ai:3000/api/manage-app

  • Request Method: POST

  • Request Headers:

    1. Authorization: Bearer <<API Key>>

    2. Content-Type: application/json

  • Request Payload:

    1. configuration: {type: <<"PUBLIC" or "PRIVATE">>}

    2. description: << "some description optional" >>

    3. email: << email >>

    4. knowledgeBases: << Array of KnowledgeBaseId's which are strings >>

    5. name: <Enter your app name>

Parameters

Authorization

configuration

type of app i.e., PUBLIC or PRIVATE

description

description about the app

email

registered email id of application creator email ( for PRIVATE app only)

name

name of the app

knowledgeBases

  • Sample Request Body payload:

    {
        "configuration": {"type": "PUBLIC"},
        "description": "App Description",
        "email": "", 
        "knowledgeBases": ["knowledgeBaseId"], 
        "name": "App Name",
    }
  • Code snippets:

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://app.zbrain.ai:3000/api/manage-app',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <API key>'
  },
  body: JSON.stringify({
    "configuration": {
      "type": "<PUBLIC or PRIVATE>"
    },
    "description": "<some description optional>",
    "email": "<email>",
    "knowledgeBases": [
      "<knowledgeBaseId>",
      "<knowledgeBaseId>"
    ],
    "name": "<name>"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests
import json

url = "https://services.zbrain.ai:3000/api/manage-app"

payload = json.dumps({
  "configuration": {
    "type": "<PUBLIC or PRIVATE>"
  },
  "description": "<some description optional>",
  "email": "<email>",
  "knowledgeBases": [
    "<knowledgeBaseId>",
    "<knowledgeBaseId>"
  ],
  "name": "<name>"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer <API key>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://services.zbrain.ai:3000/api/manage-app' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API key>' \
--data '{
    "configuration": {
        "type": "<PUBLIC or PRIVATE>"
    },
    "description": "<some description optional>",
    "email": "<email>",
    "knowledgeBases": [
        "<knowledgeBaseId>",
        "<knowledgeBaseId>"
    ],
    "name": "<name>"
}'
  • Sample Response:

    {
        "responseData": {
            "styles": {
                "headerColor": "string",
                "textColor": "string",
                "sideBarColor": "string",
                "sideBarText": "string",
                "backGroundColor": "string",
                "sampleQueryColor": "string",
                "botReplyBg": "string"
            },
            "configuration": {
                "id": number,
                "type": "string"
            },
            "logo": "string",
            "name": "string",
            "description": "string",
            "pageTitle": "string",
            "pageDescription": "string",
            "botName": "string",
            "botInstruction": "string",
            "botIcon": "string",
            "botType": "string",
            "model": "string",
            "tenantId": "string",
            "email": "string",
            "createdBy": "string",
            "knowledgeBases": [
                "string"
            ],
            "sampleQueries": ["string"],
            "suggestedQueries": ["string"],
            "_id": "string",
            "addedOn": number,
            "modifiedOn": number
        },
        "message": "App created successfully",
        "success": true,
        "responseCode": 200
    }

Get all APPs

The ZBrain get app API allows users to get all user active apps. To get a ZBrain apps, initiate a GET request to the provided URL with the necessary payload.

  • Request URL: https://app.zbrain.ai:3000/api/apps?skip=0&limit=10

  • Request Method: GET

  • Query strings:

    1. skip: << numeric value >>

    2. limit: << numeric value >>

  • Request Headers:

    1. Authorization: Bearer <<API Key >>

    2. Content-Type: application/json

Parameters

Authorization

skip

no.of apps to skip

limit

no.of apps to listout

  • Sample Query string:

?skip=0&limit=10
  • Code snippets:

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://app.zbrain.ai:3000/api/apps?skip=0&limit=10',
  'headers': {
    'Authorization': 'Bearer <API key>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://app.zbrain.ai:3000/api/apps?skip=0&limit=10"

payload = {}
headers = {
  'Authorization': 'Bearer <API key>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://app.zbrain.ai:3000/api/apps?skip=0&limit=10' \
--header 'Authorization: Bearer <API key>'
  • Sample Response:

    {
        "responseData": {
            "data": [
                {
                    "name": "string",
                    "createdByName": "string",
                    "_id": "string",
                    "configuration": {
                        "type": "string"
                    },
                    "createdBy": "string",
                    "isDeactivated": boolean,
                    "role": "string",
                    "addedOn": number,
                    "modifiedOn": number
                }
            ],
            "total": number
        },
        "message": "Information fetched successfully",
        "success": true,
        "responseCode": 200
    }

Get APP by Id

  • Request URL: https://app.zbrain.ai:3000/api/manage-app/<appId>

  • Request Method: GET

  • Path parameters:

    1. appId: << appId >>

  • Request Headers:

    1. Authorization: Bearer <<API Key >>

    2. Content-Type: application/json

Parameters

Authorization

appId

  • Sample Path parameters:

/manage-app/<appId>
  • Code snippets:

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://app.zbrain.ai:3000/api/manage-app/<appId>',
  'headers': {
    'Authorization': 'Bearer <API key>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://app.zbrain.ai:3000/api/manage-app/<appId>"

payload = {}
headers = {
  'Authorization': 'Bearer <API key>'
}var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://app.zbrain.ai:3000/api/manage-app/<appId>',
  'headers': {
    'Authorization': 'Bearer <API key>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});


response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://app.zbrain.ai:3000/api/manage-app/<appId>' \
--header 'Authorization: Bearer <API key>'
  • Sample Response:

    {
        "responseData": {
            "styles": {
                "headerColor": "string",
                "textColor": "string",
                "sideBarColor": "string",
                "sideBarText": "string",
                "backGroundColor": "string",
                "sampleQueryColor": "string",
                "botReplyBg": "string"
            },
            "configuration": {
                "id": number,
                "type": "string"
            },
            "logo": "string",
            "name": "string",
            "description": "string",
            "pageTitle": "string",
            "pageDescription": "string",
            "botName": "string",
            "botInstruction": "string",
            "botIcon": "string",
            "botType": "string",
            "model": "string",
            "tenantId": "string",
            "email": "string",
            "createdBy": "string",
            "knowledgeBases": [
                "string"
            ],
            "sampleQueries": ["string"],
            "suggestedQueries": ["string"],
            "_id": "string",
            "addedOn": number,
            "modifiedOn": number
        },
        "message": "Information fetched successfully",
        "success": true,
        "responseCode": 200
    }

Update APP

The ZBrain app update API allows for various modifications to your existing application. This includes the ability to change your app's name, add or adjust sample queries, modify the title and description of the chat page, alter the chatbot's instructions, or even rename the app. Additionally, it provides the flexibility to update the knowledge bases linked to your application. To update a ZBrain app, initiate a PUT request to the provided URL with the necessary payload.

  • Request URL:https://app.zbrain.ai:3000/api/manage-app

  • Request Method: PUT

  • Request Payload:

    1. name : << App name >>

    2. sampleQueries : << Array of questions >>

    3. pageTitle: << Chat screen tttle >>

    4. pageDescription: << Chat screen description >>

    5. appId: << appId>>

    6. knowledgeBases: << Array of knowledgebaseId's >>

    7. botInstruction: << Instruction to chatbot >>

    8. botName: << chatbot name >>

Authorization

name

name of the app

sampleQueries

sample queries for chatscreen

appId

pageTitle

name to the chat screen

pageDescription

description to the chatscreen

knowledgeBases

botInstruction

instruction to bot

botName

bot name

  • Sample Request Body payload:

{
    "name": "name of app",
    "sampleQueries": ["sample query 1","sample query 2"],
    "appId": "_id", 
    "pageTitle": "chat screen title", 
    "pageDescription": "chat screen description",
    "knowledgeBases": ["knowledgeBase1_id","knowledgeBase2_id"]
    "botInstruction": "bot instruction",
    "botName": "bot name"
}
  • Code snippets:

var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://app.zbrain.ai:3000/api/manage-app',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <API key>'
  },
  body: JSON.stringify({
    "name": "<name>",
    "sampleQueries": [
      "<add sample queries>"
    ],
    "pageTitle": "<pageTitle>",
    "pageDescription": "<pageDescription>",
    "appId": "<appId>",
    "knowledgeBases": [
      "knowledgeBaseId",
      "knowledgeBaseId"
    ],
    "botInstruction": "<instruction to bot>",
    "botName": "<bot name>"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests
import json

url = "https://app.zbrain.ai:3000/api/manage-app"

payload = json.dumps({
  "name": "<name>",
  "sampleQueries": [
    "<add sample queries>"
  ],
  "pageTitle": "<pageTitle>",
  "pageDescription": "<pageDescription>",
  "appId": "<appId>",
  "knowledgeBases": [
    "knowledgeBaseId",
    "knowledgeBaseId"
  ],
  "botInstruction": "<instruction to bot>",
  "botName": "<bot name>"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer <API key>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
curl --location --request PUT 'https://app.zbrain.ai:3000/api/manage-app' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API key>' \
--data '{
    "name": "<name>",
    "sampleQueries": [
        "<add sample queries>"
    ],
    "pageTitle": "<pageTitle>",
    "pageDescription": "<pageDescription>",
    "appId": "<appId>",
    "knowledgeBases": [
        "knowledgeBaseId",
        "knowledgeBaseId"
    ],
    "botInstruction": "<instruction to bot>",
    "botName": "<bot name>"
}'
  • Sample Response:

    {
        "responseData": {
            "styles": {
                "headerColor": "string",
                "textColor": "string",
                "sideBarColor": "string",
                "sideBarText": "string",
                "backGroundColor": "string",
                "sampleQueryColor": "string",
                "botReplyBg": "string"
            },
            "configuration": {
                "id": number,
                "type": "string"
            },
            "logo": "string",
            "name": "string",
            "description": "string",
            "pageTitle": "string",
            "pageDescription": "string",
            "botName": "string",
            "botInstruction": "string",
            "botIcon": "string",
            "botType": "string",
            "model": "string",
            "tenantId": "string",
            "email": "string",
            "createdBy": "string",
            "knowledgeBases": [
                "string"
            ],
            "sampleQueries": ["string"],
            "suggestedQueries": ["string"],
            "_id": "string",
            "addedOn": number,
            "modifiedOn": number
        },
        "message": "Information added successfully",
        "success": true,
        "responseCode": 200
    }

Delete APP

To delete an app on ZBrain, simply send a DELETE request to the provided URL, replacing '' with your specific application's ID. Ensure the required headers, including your Authorization Bearer and Content-Type, are correctly included in the request.

  • Request URL: https://app.zbrain.ai:3000/api/delete-app/<appId>

  • Request Method: DELETE

  • Request Headers:

    1. Authorization: Bearer <<API Key>>

    2. Content-Type: application/json

Authorization

appId

  • Sample Request Path Payload:

    /appId
  • Code snippets:

var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://app.zbrain.ai:3000/api/delete-app/<appId>',
  'headers': {
    'Authorization': 'Bearer <API key>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://app.zbrain.ai:3000/api/delete-app/<appId>"

payload = {}
headers = {
  'Authorization': 'Bearer <API key>'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
curl --location --request DELETE 'https://app.zbrain.ai:3000/api/delete-app/<appId>' \
--header 'Authorization: Bearer <API key>'
  • Sample Response:

    {
        "responseData": "App deleted successfully",
        "message": "App deleted successfully",
        "success": true,
        "responseCode": 200
    }

Query APP

The query API for ZBrain allows you to interact with your created application by sending a POST request to the provided URL. The request payload should include the specific app ID and the user's message content, facilitating the app to return responses in a paragraph format to the queries posed.

  • Request URL: https://app.zbrain.ai:3002/api/query

  • Request Method: POST

  • Request Headers:

    1. Authorization: Bearer <<API Key>>

    2. Content-Type: application/json

  • Request Payload:

    1. appId: << appId >>

    2. messages: [{role: "user", content: << Enter Query >>}

    3. conversationId: "timestamp-randomString"

Parameters

Authorization

appId

messages

Array of containing role and user query as content

Unique id required for each query for a session. It is combination of unix timestamp and random 13 character string. Format: (timestamp-randomString)

  • Sample Request Body Payload:

{
  "appId": "appId",
  "messages": [
        {
          "role": "user",
          "content": "query"
        }
      ],
   "conversationId":"timestamp-randomString"   
}
  • Code snippets:

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://app.zbrain.ai:3002/api/query',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <API key>'
  },
  body: JSON.stringify({
    "appId": "<appId>",
    "messages": [
      {
        "role": "user",
        "content": "<query>"
      }
    ]
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests
import json

url = "https://app.zbrain.ai:3002/api/query"

payload = json.dumps({
  "appId": "<appId>",
  "messages": [
    {
      "role": "user",
      "content": "<query>"
    }
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer <API key>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://app.zbrain.ai:3002/api/query' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API key>' \
--data '{
    "appId": "<appId>",
    "messages": [
        {
            "role": "user",
            "content": "<query>"
        }
    ]
}'
  • Sample Response:

    {
      "responseData": "string",
      "message": "Information fetched successfully",
      "success": true,
      "responseCode": 200
    }

Query stream APP

ZBrain’s query stream API responds to user queries in a real-time streaming format. By initiating a GET request with the specific app ID and query, the API facilitates a continuous, interactive conversation with the user, enhancing the chatbot experience.

  • Request URL: https://app.zbrain.ai:3002/api/stream-query?appId=<appId>&query=<query>&conversationId=<uuid>

  • Request Method: GET

  • Request Headers:

    1. Authorization: Bearer <<API Key>>

    2. Content-Type: text/event-stream

Parameters

Authorization

appId

query

Query to chatbot ("string")

conversationId

unique Id for a conversation session.

  • Sample Request query Payload:

?appId=<appId>&query=<query>&conversationId=<uuid>
  • Code snippets:

const EventSource = require('eventsource');

const es = new EventSource(
  'https://app.zbrain.ai:3002/api/stream-query?appId=<appId>&query=<query>&conversationId=<uuid>',
  {
    headers: {
      Authorization: 'Bearer <API key>',
    },
  }
);

let response = '';

es.addEventListener('message', ({ data }) => {
  const parsedMessage = JSON.parse(data);
  response += parsedMessage;
  console.log('Received content: ', parsedMessage);
});

es.addEventListener('error', ({ data = '""' }) => {
  const errorMessage = JSON.parse(data);
  console.log('Error occurred: ', errorMessage);

  if (errorMessage === 'DONE') {
    console.log('Final response: ', response);
  }

  es.close();
});
import requests
import json

url = 'https://app.zbrain.ai:3002/api/stream-query'
query_params = {
    'appId': '<appId>',
    'query': '<query>',
    'conversationId': '<uuid>'
}
headers = {
    'Authorization': 'Bearer <API key>'
}

result = ''

response = requests.get(url, headers=headers, params=query_params, stream=True)

client = response.iter_lines()

def handle_message(message):
    global result
    print('Received content:', message)

    message = json.loads(message)
    if message == 'DONE':
        print('Final result:', result)
        client.close()
        return
    
    result += message

for line in client:
    if line and line.startswith(b'data:'):
        handle_message(line[len(b'data:'):].strip().decode('utf-8'))
curl -X GET \
  'https://app.zbrain.ai:3002/api/stream-query?appId=<appId>&query=<query>&conversationId=<uuid>' \
  -H 'Authorization: Bearer <API key>' \
  -H 'Accept: text/event-stream'

Get APP analytics

To retrieve application analytics, send a GET request to the specified URL with the required parameters. Ensure the request includes the relevant application ID and tenant ID, and confirm that the necessary headers are correctly incorporated.

  • Request Method: GET

  • Query Strings: tenantId: <<Enter the ID of the tenant>> appId : <<Enter the ID of the app>> startTimestamp: << Enter the start timestamp for the analytics data>> endTimestamp: <<Enter the end timestamp for the analytics data>>

  • Request headers: "Authorization": "Bearer <your_access_token>" "Content-Type": "application/json"

  • Sample Request Query Parameters:

{
    "tenantId": "",
    "appId": "",
    "startTimestamp": "",
    "endTimestamp": ""
}
  • Sample Response:

{
    "responseData": {
        "sessions": [
            {
                "x": "2024-04-25",
                "y": 1
            },
            {
                "x": "2024-04-26",
                "y": 1
            }
        ],
        "queries": [
            {
                "x": "2024-04-26",
                "y": 1
            },
            {
                "x": "2024-04-25",
                "y": 2
            }
        ],
        "tokenUsage": [
            {
                "x": "2024-04-26",
                "y": 27
            },
            {
                "x": "2024-04-25",
                "y": 100
            }
        ]
    },
    "message": "Information fetched successfully",
    "success": true,
    "responseCode": 200
}

Get APP reports

To obtain app reports, send a GET request to the following URL with the specified query parameters. Required query parameters include the tenant ID and app ID. Optional query parameters include email, searchQuery, startDate, and endDate.

  • Request Method: GET

  • Query String: tenantId (string, required): <<Enter the ID of the tenant>> appId (string, required):<<Enter ID of the application>> email (string, optional): <<Enter the email of the user for filtering>> searchQuery (string, optional): <<Enter the search query>> startDate (timestamp, optional): << Enter the start date for filtering sessions>> endDate (timestamp, optional): <<Enter the end date for filtering sessions>>

  • Request Headers: Authorization: Bearer <your_access_token> Content-Type: application/json

  • Sample Request Query Parameters:

{
  "tenantId": "",
  "appId": "",
  "email": "",
  "searchQuery": "",
  "startDate":,
  "endDate":
}
  • Sample Response:

{
    "responseData": {
        "sessions": [
            {
                "_id": "session_id_1",
                "appId": "example_app_id",
                "queriesCount": 2,
                "tokenUsed": 12684,
                "user": null,
                "sessionStart": 1718082947067,
                "sessionEnd": 1718082933015,
                "timeTaken": 0,
                "likes": 0,
                "dislikes": 0,
                "averageTimeTaken": 0,
                "satisfactionScore": null
            },
            {
                "_id": "session_id_2",
                "appId": "example_app_id",
                "queriesCount": 3,
                "tokenUsed": 122,
                "user": {
                    "name": "",
                    "email": "",
                    "phoneNumber": "",
                    "chatUserId": ""
                },
                "sessionStart": 1717407595038,
                "sessionEnd": 1717407037654,
                "timeTaken": 0,
                "likes": 0,
                "dislikes": 0,
                "averageTimeTaken": 0,
                "satisfactionScore": null
            }
        ],
        "totals": {
            "totalSessions": 2,
            "totalQueriesCount": 15,
            "totalTokenUsed": 12806,
            "totalTimeTaken": 0,
            "totalLikes": 0,
            "totalDislikes": 0,
            "averageTimeTaken": 0,
            "satisfactionScore": null
        }
    },
    "message": "Information fetched successfully",
    "success": true,
    "responseCode": 200
}

Get filter options for the APP reports

To fetch app report filter options, send a GET request to the following URL with the specified parameters. These parameters specify the context for filtering options tailored to specific tenants, applications, and user emails. Ensure the request includes appropriate headers and any necessary authentication headers if the endpoint requires authentication.

  • Request Method: GET

  • Query String: tenantId: <<Enter the ID of the tenant>> appId: <<Enter the application's ID>> email: <<Enter the user's email address>>

  • Request Headers: Authorization: Bearer <your_access_token> Content-Type: application/json

  • Sample Request Query Parameters:

{
  "tenantId": "",
  "appId": "",
  "email": ""
}
  • Sample Response:

{
    "responseData": {
        "users": {
            "name": "John Doe",
            "email": "johndoe@example.com",
            "phoneNumber": "+1234567890",
            "chatUserId": "chat123"
        }
    },
    "message": "Information fetched successfully",
    "success": true,
    "responseCode": 200
}
PreviousAutomated ReasoningNextAgents

Last updated 9 months ago

Bearer API-Key (get it from settings > profile from )

Array of KnowledgeBaseId's which are strings (get the _id key of each knowledge base from response)

Bearer API-Key (get it from settings > profile from )

Bearer API-Key (get it from settings > profile from )

unique id of app (_id get it from the api response)

Bearer API-Key (get it from settings > profile from )

unique id of app (_id get it from the api response)

Array of KnowledgeBaseId's which are strings (get the _id key of each knowledge base from response)

Bearer API-Key (get it from settings > profile from )

unique id of app (_id get it from the api response)

provide Bearer API-Key (get it from settings > profile from )

unique id of the app _id (get it from the response of )

Bearer API-Key (get it from settings > profile from )

unique id of the app _id (get it from the response of )

Request:

Request URL:

Request URL:

📖
📱
conversationId
https://app.zbrain.ai:3000/v2/api/app-analytics
https://app.zbrain.ai:3000/v2/api/app-reports
https://app.zbrain.ai:3000/v2/api/app-reports/filter
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
https://app.zbrain.ai/settings/profile
get all APP's
get all APP's
get all APP's
get all APP's
get all APP's
Get knowledge bases
Get knowledge bases