Chat API Endpoint
Enable programmatic interaction with Ottogrid’s AI chat assistant. This API allows users to create and modify tables dynamically by sending structured messages, facilitating automated workflows and AI-driven table configurations.
Endpoint
POST https://api.ottogrid.ai/api/v1/bases/ai-configure-base
Headers
X-API-Key
: Your API key
Request Body
{
"baseName": "Example Base Name",
"baseId": "optional_base_id",
"messages": [
{
"role": "user",
"content": "I want a company name primary column, then using the company name retrieve the company website, another column to search for the CEO name."
}
]
}
Request Parameters
Each message object contains:
role
: Defines the sender. Can be"user"
,"assistant"
, or"tool"
.content
: The message text. If AI actions are triggered, responses may contain structured objects such as column configurations.
Response
A successful request returns the base ID and a history of exchanged messages.
Example Response
{
"baseId": "8tjiVYpT",
"messages": [
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "I'll help you create a workflow with three columns: a document input, its summary, and publication date."
},
{
"type": "tool-call",
"toolCallId": "toolu_01JHzwSqU6bvReSmGK1yH6Mi",
"toolName": "manageColumn",
"args": {
"columnOperation": "create"
}
}
]
},
{
"role": "tool",
"content": [
{
"type": "tool-result",
"toolCallId": "toolu_01JHzwSqU6bvReSmGK1yH6Mi",
"toolName": "manageColumn",
"result": {
"message": "Column created successfully",
"column": {
"id": "scol_A6UYtgm5vL988Hbv",
"name": "Document",
"type": "file",
"instructions": "Upload the document you want to analyze",
"isAiEnabled": false,
"isPrimary": true,
"inputColumnIds": [],
"tools": [
{
"name": "file-analysis"
}
]
}
}
}
]
}
]
}
Response Details
Each message object contains:
role
:"assistant"
,"user"
, or"tool"
.content
: The message body, which can include textual responses or structured tool calls.
Important Note on API Usage
🔹 Be Explicit with Your Requests: When defining table structures through the API, clarity in your instructions is crucial. Clearly outline:
Primary Column: Specify which column should be the main entity (e.g.,
Company Name
).Dependencies: Explicitly state which columns should reference others.
Tools to Use: If you have a preference on which tools a column should use like
scrape-url
, include this in your prompt when describing the column.
📌 Example Instruction for Clarity:
"I want a primary column for
Company Name
. Create aCompany Website
column usingWeb Search
which uses theCompany Name
column as input. Then, usingCompany Website
, create aPricing Model
column using theScrape URL
tool."
🔸 Why This Matters:
AI will follow your structure exactly as described.
Reduces the risk of incorrect column dependencies.
Ensures AI selects the correct tools for data extraction.
Capabilities
This API allows you to dynamically interact with Ottogrid’s AI to create and modify tables. You can:
Create Tables Dynamically: Generate new tables and assign them custom base names.
Modify Existing Tables: Add, update, or reconfigure columns in an existing base.
Create New Columns: Define new columns, their types, and dependencies using structured commands.
Modify Existing Columns: Update instructions, dependencies, or AI settings for existing columns.
💡 Tip: If you are dynamically creating tables, store the baseId
from the response to ensure you can modify the same table in future API calls.
Cost Breakdown
Creating a new table:
5 credits
General API interactions (e.g., modifying an existing base):
2 credits
Best Practices & Considerations
Use
baseId
when modifying existing tables. If omitted, a new base will be created.Extract structured outputs from the
tool
role.Store
baseId
for ongoing API interactions. This ensures consistency when making modifications over multiple API calls.Review
tool-call
results. If creating a column, verify the column details using the correct path in the response. Reference the provided example output to find the exact key structure.