import requests
url = "https://api.datagrid.com/v1/agents/{agent_id}"
payload = {
"knowledge_ids": ["<string>"],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"tools": ["<string>"],
"disabled_tools": ["<string>"],
"llm_model": "gemini-3.1-flash-lite",
"temperature": 0.5,
"agent_model": "magpie-2.5",
"mcp_servers": [
{
"server_id": "<string>",
"credential_id": "<string>"
}
],
"name": "<string>",
"emoji": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
knowledge_ids: ['<string>'],
corpus: [{type: 'knowledge', knowledge_id: '<string>'}],
system_prompt: '<string>',
custom_prompt: '<string>',
planning_prompt: '<string>',
tools: ['<string>'],
disabled_tools: ['<string>'],
llm_model: 'gemini-3.1-flash-lite',
temperature: 0.5,
agent_model: 'magpie-2.5',
mcp_servers: [{server_id: '<string>', credential_id: '<string>'}],
name: '<string>',
emoji: '<string>',
description: '<string>'
})
};
fetch('https://api.datagrid.com/v1/agents/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.datagrid.com/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"knowledge_ids": [
"<string>"
],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"tools": [
"<string>"
],
"disabled_tools": [
"<string>"
],
"llm_model": "gemini-3.1-flash-lite",
"temperature": 0.5,
"agent_model": "magpie-2.5",
"mcp_servers": [
{
"server_id": "<string>",
"credential_id": "<string>"
}
],
"name": "<string>",
"emoji": "<string>",
"description": "<string>"
}
'{
"object": "agent",
"id": "<string>",
"name": "<string>",
"emoji": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"knowledge_ids": [
"<string>"
],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"agent_model": "magpie-2.5",
"llm_model": "gemini-3.1-flash-lite",
"tools": [
{
"name": "<string>",
"connection_id": "<string>"
}
],
"mcp_servers": [
{
"object": "agent_mcp_server",
"server_id": "<string>",
"name": "<string>",
"base_url": "<string>",
"status": "<string>",
"credential_id": "<string>",
"tool_count": 123,
"last_synced_at": "2023-11-07T05:31:56Z"
}
],
"managed_by_app": {
"app_uuid": "<string>",
"app_name": "<string>"
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Update agent
Update an agent configuration
import requests
url = "https://api.datagrid.com/v1/agents/{agent_id}"
payload = {
"knowledge_ids": ["<string>"],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"tools": ["<string>"],
"disabled_tools": ["<string>"],
"llm_model": "gemini-3.1-flash-lite",
"temperature": 0.5,
"agent_model": "magpie-2.5",
"mcp_servers": [
{
"server_id": "<string>",
"credential_id": "<string>"
}
],
"name": "<string>",
"emoji": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
knowledge_ids: ['<string>'],
corpus: [{type: 'knowledge', knowledge_id: '<string>'}],
system_prompt: '<string>',
custom_prompt: '<string>',
planning_prompt: '<string>',
tools: ['<string>'],
disabled_tools: ['<string>'],
llm_model: 'gemini-3.1-flash-lite',
temperature: 0.5,
agent_model: 'magpie-2.5',
mcp_servers: [{server_id: '<string>', credential_id: '<string>'}],
name: '<string>',
emoji: '<string>',
description: '<string>'
})
};
fetch('https://api.datagrid.com/v1/agents/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.datagrid.com/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"knowledge_ids": [
"<string>"
],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"tools": [
"<string>"
],
"disabled_tools": [
"<string>"
],
"llm_model": "gemini-3.1-flash-lite",
"temperature": 0.5,
"agent_model": "magpie-2.5",
"mcp_servers": [
{
"server_id": "<string>",
"credential_id": "<string>"
}
],
"name": "<string>",
"emoji": "<string>",
"description": "<string>"
}
'{
"object": "agent",
"id": "<string>",
"name": "<string>",
"emoji": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"knowledge_ids": [
"<string>"
],
"corpus": [
{
"type": "knowledge",
"knowledge_id": "<string>"
}
],
"system_prompt": "<string>",
"custom_prompt": "<string>",
"planning_prompt": "<string>",
"agent_model": "magpie-2.5",
"llm_model": "gemini-3.1-flash-lite",
"tools": [
{
"name": "<string>",
"connection_id": "<string>"
}
],
"mcp_servers": [
{
"object": "agent_mcp_server",
"server_id": "<string>",
"name": "<string>",
"base_url": "<string>",
"status": "<string>",
"credential_id": "<string>",
"tool_count": 123,
"last_synced_at": "2023-11-07T05:31:56Z"
}
],
"managed_by_app": {
"app_uuid": "<string>",
"app_name": "<string>"
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Body
Array of the agent tools to enable. If not provided, or null is provided - default tools of the agent are used. If empty list provided - none of the tools are used. When connection_id is set for a tool, it will use that specific connection instead of the default one.
Structured outputs (Converse): All agent_model values support JSON Schema constrained responses via text.format on the Converse request. Responses are validated server-side against the schema and returned as a json content item; output that cannot be made schema-valid is rejected with a deterministic structured_output_generation_failed error instead of being returned as a success.
Tool availability by agent model (aligned with in-app Execute / Extended / direct LLM; see Converse chat_mode for Ask vs agent_model):
- Execute (
magpie-2.0,magpie-2.5,magpie-1.1): All tools below are available. - Extended (
magpie-1.1-flash): Onlysemantic_searchis supported. Requests specifying other tools will be rejected with a 400 error. - Direct LLM (
llm-only): No tools are executed. Requests specifying tools will be rejected with a 400 error.
Knowledge management tools:
- data_analysis: Answer statistical or analytical questions like "Show my quarterly revenue growth"
- semantic_search: Search knowledge through natural language queries.
- agent_memory: Agents can remember experiences, conversations and user preferences.
- schema_info: Helps the Agent understand column names and dataset purpose. Avoid disabling
- table_info: Allow the AI Agent to get information about datasets and schemas
- create_dataset: Agents respond with data tables
- charts: Agents render charts inline in the conversation (bar, line, area, combo, pie, funnel, gauge, treemap, scorecard).
Actions:
- calendar: Allow the Agent to access and make changes to your Google Calendar
- schedule_recurring_message_tool: Eliminate busywork such as: "Send a summary of today's meetings at 5pm on workdays"
Data processing tools:
- data_classification: Agents handle queries like "Label these emails as high, medium, or low priority"
- data_extraction: Helps the agent understand data from other tools. Avoid disabling
- image_detection: Extract information from images using AI
- pdf_extraction: Extraction of information from PDFs using AI
Enhanced response tools:
- connect_data: Agents provide buttons to import data in response to queries like "Connect Hubspot"
- download_data: Agents handle queries like "download the table as CSV"
Web tools:
- web_search: Agents search the internet, and provide links to their sources
- fetch_url: Fetch URL content
- company_prospect_researcher: Agents provide information about companies
- people_prospect_researcher: Agents provide information about people
- string
- object
The unique identifier for a tool.
Array of the agent tools to disable. Disabling is performed after the 'agent_tools' rules are applied. For example, agent_tools: null and disabled_tools: [data_analysis] will enable everything but the data_analysis tool. If nothing or [] is provided, nothing is disabled and therefore only the agent_tools setting is relevant.
- string
- object
The unique identifier for a tool.
The LLM used to generate responses. Any id returned by GET /v1/models with type: llm is accepted; the enum lists the ids known when this spec was generated. Deprecated Gemini 2.x Flash ids are accepted for backward compatibility and automatically run as gemini-3.1-flash-lite.
gemini-2.0-flash, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-flash-lite, gemini-3.1-pro-preview, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.6-flash, gemini-3.8-flash, gemini-live-2.5-flash-native-audio, gemini-1.5-flash-001, gemini-1.5-flash-002, gemini-2.0-flash-001, gemini-2.5-flash-preview-04-17, gemini-1.5-pro-001, gemini-1.5-pro-002, gemini-2.5-pro-preview-05-06, claude-haiku-4-5@20251001, claude-sonnet-4-6@default, claude-opus-4-6@default, claude-opus-4-7, claude-opus-4-8, claude-sonnet-5, claude-opus-5, claude-opus-5-5, anthropic.claude-haiku-4-5-20251001-v1:0, anthropic.claude-sonnet-4-5-20250929-v1:0, anthropic.claude-sonnet-4-6, anthropic.claude-opus-4-5-20251101-v1:0, anthropic.claude-opus-4-6-v1, anthropic.claude-opus-4-7, anthropic.claude-opus-4-8, anthropic.claude-sonnet-5, anthropic.claude-opus-5, anthropic.claude-opus-5-5, gpt-4o-mini, gpt-4o, gpt-4.1-mini, gpt-4.1, gpt-5-mini, gpt-5, gpt-5.1, chatgpt-4o-latest, gpt-4-turbo, gpt-4, openai.gpt-5.5, openai.gpt-5.6-luna, openai.gpt-5.6-sol, openai.gpt-5.6-terra, amazon.nova-2-lite-v1:0 The agent model determines the processing mode for Converse requests. The Datagrid web app exposes Ask, Extended, and Execute as Converse chat_mode (llm_router, light_agent, full_agent). The values below set config.agent_model (model tier and tool limits)—use both fields when mirroring in-app behavior.
Execute (full tool use, planning, and multi-step reasoning; aligns with Execute in the web app / full_agent):
magpie-2.0— Legacy full-agent model with proactive planning and reasoning.magpie-2.5— Default. Latest full-agent model — faster, more adaptable, and built to handle a broader range of real-world tasks.magpie-1.1— Previous-generation full agent model.
Extended (search-focused; aligns with Extended in the web app / light_agent; not Ask):
magpie-1.1-flash— Fast model optimized for RAG use cases. Only supports thesemantic_searchtool. A 400 error will be returned if other tools are specified.
Direct LLM (no tool execution; agent_model only—Ask in the web app is chat_mode: llm_router, not magpie-1.1-flash):
llm-only— Runs a direct LLM conversation with no planning or tool calls. A 400 error will be returned if tools are specified.
BETA: Magpie 3.0. Behavior and schema may change.
magpie-3.0— BETA. Available on the public Converse API. In-app rollout flags do not apply to this request.
Can also accept any custom string value for future model versions.
magpie-1.1, magpie-1.1-flash, magpie-2.0, magpie-2.5, magpie-2.5-flash, magpie-3.0, llm-only Response
Updated agent
The agent model determines the processing mode for Converse requests. The Datagrid web app exposes Ask, Extended, and Execute as Converse chat_mode (llm_router, light_agent, full_agent). The values below set config.agent_model (model tier and tool limits)—use both fields when mirroring in-app behavior.
Execute (full tool use, planning, and multi-step reasoning; aligns with Execute in the web app / full_agent):
magpie-2.0— Legacy full-agent model with proactive planning and reasoning.magpie-2.5— Default. Latest full-agent model — faster, more adaptable, and built to handle a broader range of real-world tasks.magpie-1.1— Previous-generation full agent model.
Extended (search-focused; aligns with Extended in the web app / light_agent; not Ask):
magpie-1.1-flash— Fast model optimized for RAG use cases. Only supports thesemantic_searchtool. A 400 error will be returned if other tools are specified.
Direct LLM (no tool execution; agent_model only—Ask in the web app is chat_mode: llm_router, not magpie-1.1-flash):
llm-only— Runs a direct LLM conversation with no planning or tool calls. A 400 error will be returned if tools are specified.
BETA: Magpie 3.0. Behavior and schema may change.
magpie-3.0— BETA. Available on the public Converse API. In-app rollout flags do not apply to this request.
Can also accept any custom string value for future model versions.
magpie-1.1, magpie-1.1-flash, magpie-2.0, magpie-2.5, magpie-2.5-flash, magpie-3.0, llm-only The LLM used to generate responses. Any id returned by GET /v1/models with type: llm is accepted; the enum lists the ids known when this spec was generated. Deprecated Gemini 2.x Flash ids are accepted for backward compatibility and automatically run as gemini-3.1-flash-lite.
gemini-2.0-flash, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-flash-lite, gemini-3.1-pro-preview, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.6-flash, gemini-3.8-flash, gemini-live-2.5-flash-native-audio, gemini-1.5-flash-001, gemini-1.5-flash-002, gemini-2.0-flash-001, gemini-2.5-flash-preview-04-17, gemini-1.5-pro-001, gemini-1.5-pro-002, gemini-2.5-pro-preview-05-06, claude-haiku-4-5@20251001, claude-sonnet-4-6@default, claude-opus-4-6@default, claude-opus-4-7, claude-opus-4-8, claude-sonnet-5, claude-opus-5, claude-opus-5-5, anthropic.claude-haiku-4-5-20251001-v1:0, anthropic.claude-sonnet-4-5-20250929-v1:0, anthropic.claude-sonnet-4-6, anthropic.claude-opus-4-5-20251101-v1:0, anthropic.claude-opus-4-6-v1, anthropic.claude-opus-4-7, anthropic.claude-opus-4-8, anthropic.claude-sonnet-5, anthropic.claude-opus-5, anthropic.claude-opus-5-5, gpt-4o-mini, gpt-4o, gpt-4.1-mini, gpt-4.1, gpt-5-mini, gpt-5, gpt-5.1, chatgpt-4o-latest, gpt-4-turbo, gpt-4, openai.gpt-5.5, openai.gpt-5.6-luna, openai.gpt-5.6-sol, openai.gpt-5.6-terra, amazon.nova-2-lite-v1:0