Brain Webhook Setup

Brain Webhook Integration allows you to upload structured data  directly into Brain using custom schemas.You define fields, set a primary key, and choose whether to append or overwrite data.Data can be uploaded via API using cURL with Basic Auth credentials.Once uploaded, the chat agent can retrieve specific information using the primary key.


Step 1  - Configure Webhook Details


1. Brain Tab

  • Go to the Brain tab in the sidebar menu.


2. Initiate Data Upload

Click the "Add" button located at the top-right corner of the Brain page.

You’ll see two options:

  • Upload File
  • Entity

Select Upload File to continue.

3. Open Webhook Configuration

After choosing Upload File, go to the Webhook tab.

This will take you to the Webhook Configuration page.

4. Configure Webhook Schema

On the configuration screen, fill in the following fields:

  • Name: Provide a name for your schema.
  • Description: Add a short description of the data.
  • Schema Fields: Define the structure of your data in JSON format.
  • Primary Key: Select a field from the schema to act as the primary key.

Note: The primary key must be included in the defined schema fields

You will also need to choose a data operation mode:

Operation Modes:
  • Append

    Adds new data while preserving existing records.

    When data is updated via the webhook, it is added in addition to the existing data.

  • Overwrite

    Replaces existing records that match the primary key.

    When data is updated, old entries with the same primary key are replaced by the new ones.

5. Save the Schema

After entering all required details, click the Save button.

Your webhook schema will now be created and ready to receive data uploads.


Step-2 Modifying or Managing Webhook Schemas in Brain

1. Access Recent Webhooks

If you need to modify any webhook fields:

  • Go to the Recent Webhook tab in the Brain section.
  • This tab displays all previously created webhook schema details in a list of cards.

2. Edit or Delete a Webhook Schema

  • Each webhook schema is displayed inside a card.
  • In the top-right corner of each card, you’ll see a three-dot menu (⋮).
  • Click the menu to reveal two options:
    • Edit – Modify the existing webhook schema fields.
    • Delete – Remove the webhook schema entirely.

Use the Edit option to make changes to any existing webhook configuration.


Step-3 Uploading Data to Brain via Webhook (Using cURL)

1. Copy cURL Command

  • Inside each webhook card in the Recent Webhook tab, you’ll find a “Show cURL” button.
  • Click it to reveal the cURL command for uploading data to Brain.
  • Click Copy to copy the full cURL command.



2. Use an API Tool (e.g., Postman)

  • Open your API testing tool (like Postman).
  • Paste the copied cURL command.


3. Set Authorization

  • In your API tool, go to the Authorization tab.
  • Choose Basic Auth.
    • Username: Your API Key
    • Password: Your Access Secret


To get these credentials:

  • Open the Thunai App.
  • Click your profile icon (top right of the navbar).
  • Select Settings.
  • You will be directed to the API Keys page.
  • Use the API Key as the username and the Access Secret as the password.



4. Update the Request Body

  • Modify the request body with the data you want to upload.
  • Then run the API call.

Based on the selected operation mode (Append or Overwrite), the data will be uploaded to Brain accordingly.


Step-4 Retrieving Uploaded Data in Chat (Based on Primary Key)

Once data is uploaded to Brain via webhook, you can retrieve it through the chat interface using queries that reference the primary key.

  • The chat agent is capable of fetching data linked to the primary key defined during schema creation.
  • When a user sends a query that matches or includes the primary key, the system will:
    • Look up the corresponding record in Brain.
    • Retrieve the associated data.
    • Provide a response using the stored content.


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us