Skip to main content

Overview

DataGOL Custom Agents are fully configurable AI assistants that combine your company’s data sources (workspaces, knowledge bases, connectors), external tools (MCP servers), sub-agents, and voice capabilities into a single deployable interface. The lifecycle of a Custom Agent is organized into the following groups:

Create Agent

1

Create Agent

POST /customAgents/api/v1 — define the agent’s identity, data connectors, MCP tools, and UI behavior. Returns the agentId used in every subsequent call.

Create a thread

1

Create a thread

POST /ai/api/v2/conversations — create the conversation record, embedding the agent ID, selected model, and scope (PRIVATE / SHARED). Returns the conversationId required for streaming.

Converse

1

Stream Messages

POST /ai/api/v2/messages/streaming — send the user message and receive the agent’s SSE-streamed response. Pass selectedLlmModel to switch models per message.

Sharing and Permissions

1

Fetch Agent Permissions

GET /noCo/api/v2/elementPermissions/CUSTOM_AGENT/{agentId} — verify who currently has access to the agent.
2

List Team Members

GET /idp/api/v1/team — fetch the full team roster to populate the share dialog with user IDs and display names.
3

Share Team Members

POST /noCo/api/v2/elementPermissions/bulk — grant CREATOR, EDITOR, or VIEWER access to selected team members by userId.

Misc

1

Generate Conversation Name

POST /ai/api/v1/builder/chat/complete?resourceType=CUSTOM_AGENT&resourceId={agentId} — called client-side when the user types their first message. Uses gpt-4o-mini + a tool call to produce a concise 5-word conversation title before the conversation record is created.

Authentication

Every request to the DataGOL backend requires a signed JWT passed as a Bearer token.
Tokens are issued by the DataGOL Identity Provider (/idp) after login. They embed the user’s companyId, userId, roles, and permissions. Tokens are short-lived — refresh them before they expire.

Required headers for every request

HeaderValueRequired
AuthorizationBearer <jwt_token>Yes
Content-Typeapplication/jsonYes
Accept*/*Yes

Optional / contextual headers

HeaderValueWhen to send
Refererhttps://your-app.datagol.ai/Recommended — used for CORS validation
Originhttps://your-app.datagol.aiRequired for cross-origin browser requests
credentialsincludeRequired only for the Streaming API
Never include raw browser-only headers (sec-ch-ua, sec-fetch-*) in server-to-server calls. They are browser hints and will be ignored or may cause unexpected behavior.

Base URLs

ServiceEnvironmentBase URLPurpose
Backend APIProductionhttps://be.datagol.aiAgent CRUD, conversations, permissions
AI CoreProductionhttps://ai.datagol.aiChat completion, streaming

Reference APIs

Supporting Lookups

Before creating an agent you will typically fetch the IDs you need:

GET List All Custom Agents

curl 'https://be.datagol.ai/customAgents/api/v1' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'
GET /customAgents/api/v1 Returns all Custom Agents accessible to the authenticated user within their company tenant. Response — array of agent summaries including id, name, description, isPublished, and configs.

GET Get Custom Agent by ID

GET /customAgents/api/v1/{agentId}
agentId
string (UUID)
required
The UUID of the Custom Agent returned from the create or list endpoint.
curl 'https://be.datagol.ai/customAgents/api/v1/f1c6ff59-f4b7-476e-b306-f8531b42863d' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

GET List All Workspaces

GET /noCo/api/v2/workspaces Returns all workspaces in the company tenant. Use id values as workspaceId in connector objects.
curl 'https://be.datagol.ai/noCo/api/v2/workspaces' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

GET Search Workspaces and Workbooks

GET /noCo/api/v2/workspaces/search Used by the Knowledge Base section in the agent builder UI. Returns a flat list of all workbooks (type TABLE) across every workspace the authenticated user can access. Group the results by workspaceId / workspaceName to render the workspace → workbook tree shown in the UI.
This is the endpoint you should call when populating the workbook picker. Unlike GET /noCo/api/v2/workspaces (which returns workspace metadata only), this endpoint returns the individual workbooks inside each workspace in a single call.
Query parameters:
ParameterTypeRequiredDescription
querystringNoFree-text filter on workbook / workspace name. Pass empty string or omit for all.
typestringYesMust be TABLE to retrieve workbooks.
curl 'https://be.datagol.ai/noCo/api/v2/workspaces/search?query=&type=TABLE' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'
Response — flat array of workbook objects. Each item carries the parent workspaceId and workspaceName so you can group them client-side. Response item fields:
FieldTypeDescription
idUUIDWorkbook UUID — use as id in WORKBOOK_RAG connector objects
namestringWorkbook display name
descriptionstringOptional content description
workspaceIdUUIDParent workspace UUID — use to group workbooks by workspace
workspaceNamestringParent workspace display name
workspaceCreatedByintegerUser ID of the workspace owner
tableCreatedByintegerUser ID who created the workbook
uiMetadata.dataProviderstringStorage backend: JDBC, SPARK, SNOWFLAKE, BIGQUERY, REDSHIFT, ATHENA, MYSQL
uiMetadata.titlestringOptional display title override
uiMetadata.favoritebooleanWhether the workbook is marked as a favourite
Example response (trimmed):
[
  {
    "type": "TABLE",
    "isFolder": false,
    "id": "ec345675-06bf-4133-b8c3-f8fc1934b839",
    "name": "dg_order_item.csv",
    "description": "",
    "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
    "workspaceName": "Link_v2",
    "workspaceCreatedBy": 371,
    "tableCreatedBy": 371,
    "uiMetadata": { "dataProvider": "JDBC" }
  },
  {
    "type": "TABLE",
    "isFolder": false,
    "id": "ca45078d-ed26-4752-a7a7-4aed24af033c",
    "name": "dg_Order.csv",
    "description": "",
    "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
    "workspaceName": "Link_v2",
    "workspaceCreatedBy": 371,
    "tableCreatedBy": 371,
    "uiMetadata": { "dataProvider": "JDBC" }
  },
  {
    "type": "TABLE",
    "isFolder": false,
    "id": "bb3f3d22-bdef-45ec-8723-08f874e42247",
    "name": "Airbnb - SNOWFLAKE",
    "description": "",
    "workspaceId": "c50161cf-14dd-42a5-9b62-f8b6d89b48e9",
    "workspaceName": "BI Sanity (Bi team only)",
    "workspaceCreatedBy": 280,
    "tableCreatedBy": 41,
    "uiMetadata": { "dataProvider": "SNOWFLAKE" }
  }
  // ... more workbooks grouped across workspaces
]
To build the workspace → workbook tree, reduce the flat array by workspaceId:
const tree = results.reduce((acc, item) => {
  const ws = acc[item.workspaceId] ?? { name: item.workspaceName, workbooks: [] };
  ws.workbooks.push({ id: item.id, name: item.name });
  acc[item.workspaceId] = ws;
  return acc;
}, {});
The workbook id can then be used directly as the connector id in WORKBOOK_RAG objects.

GET List All Connectors

GET /connector/api/v1/instance Returns all AI connectors (type CONNECTOR / sourceType: AI) available to the tenant. Use connector id values in the configs.connectors array.
curl 'https://be.datagol.ai/connector/api/v1/instance' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

GET List Team Members

GET /idp/api/v1/team Returns all users in the company. Use userId values when sharing an agent.
curl 'https://be.datagol.ai/idp/api/v1/team' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

GET List All Conversations

GET /ai/api/v2/conversations Returns the list of all conversations for the authenticated user.

POST Create Custom Agent

POST /customAgents/api/v1 Creates a fully configured Custom AI Agent. This is the most complex endpoint — every field is documented below.
curl --location 'https://be.datagol.ai/customAgents/api/v1' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '<see full body below>'

uiMetadata — UI Presentation Layer

Controls how the agent looks and behaves in the DataGOL chat interface.
uiMetadata
object
required

configs — Agent Runtime Configuration

The configs object is the brain of the agent — it defines every data source, tool, and capability the agent can access at runtime.
configs
object
required

Top-Level Fields

isPublished
boolean
required
Controls whether the agent is visible and usable by team members beyond the creator.
  • false — Draft mode. Only the creator can access it.
  • true — Published. Users with shared permissions can open and chat with the agent.
prompt
string
required
The system prompt injected at the start of every conversation with this agent. This is the core instruction set — be specific about role, output format, and behavior.Example:
Scan this document and extract all key metrics, numbers, and quantitative statements
(such as revenue, costs, growth rates, counts, targets, and timelines). Organize them
into a structured table with columns for metric name, value, unit, date or period, and
a short description of what the metric represents.
description
string
required
A short human-readable description of what the agent does. Shown in the agent card in the UI.Example: "This Agent Details you through the Complete financial related Data"
name
string
required
Display name of the agent. Shown in the agent list and chat header.Example: "Financial Agent"

Complete Request Example

{
  "name": "Financial Agent",
  "description": "This Agent Details you through the Complete financial related Data",
  "prompt": "Scan this document and extract all key metrics, numbers, and quantitative statements (such as revenue, costs, growth rates, counts, targets, and timelines). Organize them into a structured table with columns for metric name, value, unit, date or period, and a short description of what the metric represents. If there are assumptions or caveats around specific numbers, briefly note those as well.",
  "isPublished": false,
  "uiMetadata": {
    "bestFor": [],
    "conversationStarters": [],
    "logo": null,
    "style": {
      "logo": {
        "bgColor": "",
        "textColor": ""
      }
    },
    "input": {
      "placeholder": "What is EBITDA? And How Its Calculated"
    },
    "capabilities": {
      "models": {
        "enabled": true,
        "supportedModels": [
          "gpt-5.2",
          "vertex_ai/claude-opus-4-7",
          "claude-sonnet-4-6",
          "claude-haiku-4-5-20251001",
          "o4-mini"
        ],
        "defaultValue": "gpt-5.2"
      },
      "allowDownload": true,
      "conversationFiles": {
        "enabled": true
      }
    }
  },
  "configs": {
    "mcpConfigs": [
      {
        "id": 18,
        "name": "Workspace MCP",
        "description": "",
        "url": "https://testing-mcp.datagol.ai/workspace/link-v2?workspace_id=a336506d-540e-4a78-809b-daf501687bca&token=<token>",
        "transport": "streamable_http",
        "serverType": "CUSTOM",
        "companyId": 1
      },
      {
        "id": 35,
        "name": "New MCP Server",
        "description": "",
        "url": "Financial Sub Agent",
        "transport": "streamable_http",
        "serverType": "CUSTOM",
        "companyId": 1
      },
      {
        "serverType": "WORKBOOK",
        "name": "dg_Order.csv",
        "description": "",
        "url": "",
        "transport": "streamable_http",
        "data": {
          "id": "ca45078d-ed26-4752-a7a7-4aed24af033c",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53"
        }
      },
      {
        "serverType": "WORKBOOK",
        "name": "Install Metrics",
        "description": "",
        "url": "",
        "transport": "streamable_http",
        "data": {
          "id": "3095f6c0-b399-4e0f-b367-7db38b0a8453",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53"
        }
      }
    ],
    "connectors": [
      {
        "id": "ec345675-06bf-4133-b8c3-f8fc1934b839",
        "type": "WORKBOOK_RAG",
        "sourceType": "BACKEND",
        "data": {
          "title": "dg_order_item.csv",
          "description": "",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
          "workspaceName": "Link_v2"
        }
      },
      {
        "id": "753bd2d1-3426-41f2-b78d-a24a5a4cb0dd",
        "type": "WORKBOOK_RAG",
        "sourceType": "BACKEND",
        "data": {
          "title": "dg_customer.csv",
          "description": "",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
          "workspaceName": "Link_v2"
        }
      },
      {
        "id": "ca45078d-ed26-4752-a7a7-4aed24af033c",
        "type": "WORKBOOK_RAG",
        "sourceType": "BACKEND",
        "data": {
          "title": "dg_Order.csv",
          "description": "",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
          "workspaceName": "Link_v2"
        }
      },
      {
        "id": "aff24e82-564b-468a-9727-392a08f017bc",
        "type": "WORKBOOK_RAG",
        "sourceType": "BACKEND",
        "data": {
          "title": "dg_products.csv",
          "description": "",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
          "workspaceName": "Link_v2"
        }
      },
      {
        "id": "3095f6c0-b399-4e0f-b367-7db38b0a8453",
        "type": "WORKBOOK_RAG",
        "sourceType": "BACKEND",
        "data": {
          "title": "Install Metrics",
          "description": "",
          "workspaceId": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
          "workspaceName": "Link_v2"
        }
      },
      {
        "id": "055b4db3-96e1-45e1-8ff5-3a911b779a53",
        "type": "WORKSPACE_DOCUMENTS",
        "sourceType": "BACKEND",
        "data": {
          "name": "Link_v2"
        }
      },
      {
        "id": "bca6c483-9205-4724-81e3-f4340b79efbc",
        "type": "KNOWLEDGE_BASE",
        "sourceType": "BACKEND",
        "data": {
          "id": "bca6c483-9205-4724-81e3-f4340b79efbc",
          "companyId": 1,
          "userId": 371,
          "type": "GOOGLE_DRIVE",
          "name": "Mahi Changes Verifications",
          "status": "ACTIVE",
          "lastSyncAt": "2026-05-01T18:56:45.544+0000",
          "lastSyncStatus": "SUCCESS",
          "sourceId": null,
          "credentialId": 7219087,
          "activeConfig": null,
          "latestRun": {
            "id": "036f1723-1b57-4e06-9295-17bb24fdbd58",
            "connectorId": "bca6c483-9205-4724-81e3-f4340b79efbc",
            "runType": "INCREMENTAL",
            "status": "SUCCESS",
            "temporalWorkflowId": "kb-sync-036f1723-1b57-4e06-9295-17bb24fdbd58",
            "startedAt": "2026-05-01T18:56:44.855+0000",
            "finishedAt": "2026-05-01T18:56:45.543+0000",
            "errorMessage": null,
            "statsJson": {},
            "checkpointJson": null
          }
        }
      },
      {
        "id": "315",
        "type": "CONNECTOR",
        "sourceType": "AI"
      }
    ],
    "webSearchEnabled": true,
    "skillIds": [
      10,
      11
    ]
  }
}

Response

{
  "id": "7bf5f4d6-743d-414f-aa4a-96f7a20ce0fd",
  "name": "Financial Agent",
  "description": "This Agent Details you through the Complete financial related Data",
  "isPublished": false,
  "prompt": "...",
  "configs": { "..." },
  "uiMetadata": { "..." },
  "skills": [ "..." ],
  "createdAt": "2026-05-18T10:00:00.000+0000",
  "updatedAt": "2026-05-18T10:00:00.000+0000"
}

POST Share Agent (Bulk Permissions)

POST /noCo/api/v2/elementPermissions/bulk Grants one or more users access to a Custom Agent.
curl --location 'https://be.datagol.ai/noCo/api/v2/elementPermissions/bulk' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "permissions": [
      {
        "elementId": "7bf5f4d6-743d-414f-aa4a-96f7a20ce0fd",
        "elementType": "CUSTOM_AGENT",
        "userId": 935,
        "permission": "CREATOR"
      }
    ]
  }'
permissions
array
required
Array of permission grants to apply in a single atomic operation.

GET Custom Agent Permissions

GET /noCo/api/v2/elementPermissions/CUSTOM_AGENT/{agentId} Returns all users who have access to the specified agent and their permission levels.
agentId
string (UUID)
required
UUID of the Custom Agent.
curl 'https://be.datagol.ai/noCo/api/v2/elementPermissions/CUSTOM_AGENT/7bf5f4d6-743d-414f-aa4a-96f7a20ce0fd' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

POST Generate Conversation Name

POST /ai/api/v1/builder/chat/complete (AI Core service) Generates a concise conversation name based on the user’s first message. Called automatically after the first message is sent. Query params:
ParamValue
resourceTypeCUSTOM_AGENT
resourceIdUUID of the Custom Agent
Request Body
{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "system",
      "content": "You are an advanced AI conversation assistant. Generate a clear and concise name for the conversation that accurately reflects its main topic. Keep it to max 5 words."
    },
    {
      "role": "user",
      "content": "First User Message:\n```\nSummarise the data\n```"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "generate_conversation_name",
        "description": "Use this function to generate a conversation name based on the first user message",
        "parameters": {
          "type": "object",
          "properties": {
            "conversation_name": {
              "type": "string",
              "description": "A clear and concise name for the conversation that reflects its main topic"
            }
          },
          "required": ["conversation_name"]
        }
      }
    }
  ],
  "tool_choice": "auto"
}

POST Initiate Conversation

POST /ai/api/v2/conversations Opens a new conversation session backed by a Custom Agent. Returns a conversationId required for the streaming endpoint.
curl --location 'https://be.datagol.ai/ai/api/v2/conversations' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Data Summary Request",
    "active": true,
    "scope": "PRIVATE",
    "userId": 371,
    "agentType": "CustomAgent",
    "uiMetadata": {
      "type": "CustomAgent",
      "parameters": {
        "customAgentId": "1526da2b-3264-4118-b141-87857369b0bd",
        "parameters": {
          "customAgentId": "1526da2b-3264-4118-b141-87857369b0bd"
        }
      },
      "configuration": {
        "llmModel": "gpt-5.2"
      }
    }
  }'
name
string
required
Display name for this conversation. Auto-generated by the naming API (step 3) or user-supplied.
active
boolean
required
Always true when creating a new conversation.
scope
string
required
Visibility of the conversation.
ValueBehavior
PRIVATEOnly the creating user can see this conversation
SHAREDVisible to all users with access to the agent
userId
integer
required
ID of the authenticated user creating the conversation. Must match the token’s userId claim.
agentType
string
required
Must be "CustomAgent" for custom agent conversations.
uiMetadata.parameters.customAgentId
string (UUID)
required
UUID of the Custom Agent that backs this conversation. Passed twice (at parameters and parameters.parameters) for backward compatibility.
uiMetadata.configuration.llmModel
string
required
Active LLM model for this conversation. Must be a value from uiMetadata.capabilities.models.supportedModels.
Response — returns a conversationId (UUID) used in the streaming endpoint.

POST Streaming Message

POST /ai/api/v2/messages/streaming (AI Core service) Sends a user message to the agent and streams the response as Server-Sent Events (SSE).
This endpoint hits ai.datagol.ai, not be.datagol.ai. Ensure your HTTP client supports streaming responses (SSE).
curl 'https://ai.datagol.ai/ai/api/v2/messages/streaming' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -H 'credentials: include' \
  -H 'Referer: https://app.datagol.ai/' \
  --data-raw '{
    "agentType": "CustomAgent",
    "type": "CustomAgent",
    "conversationId": "<conversationId>",
    "message": "Hi",
    "parameters": {
      "customAgentId": "<customAgentId>"
    },
    "uiMetadata": {
      "parameters": {}
    },
    "selectedLlmModel": "gpt-5.4"
  }'
agentType
string
required
Must be "CustomAgent".
type
string
required
Must be "CustomAgent". (Duplicates agentType for routing purposes.)
conversationId
string (UUID)
required
The conversation ID returned by POST /ai/api/v2/conversations.
message
string
required
The user’s message text to send to the agent.
parameters.customAgentId
string (UUID)
required
UUID of the Custom Agent. Must match the agent that backs this conversation.
selectedLlmModel
string
required
The model to use for this specific message. Can be changed per message to switch models mid-conversation.
uiMetadata
object
Pass as { "parameters": {} } unless overriding model-level parameters.
Response — SSE stream of delta tokens and tool call events. Parse events with data: prefix.
:heartbeat

{"content":17534,"response_type":"message_id","metadata":null}

:keep-alive
{"content":"Hi.","response_type":"text","metadata":null}

:keep-alive
FieldTypeDescription
contentstring | numberThe text delta (or message ID on the first event)
response_typestring"message_id" for the first event; "text" for content chunks
metadataobject | nullReserved for future use; currently null

GET Workspace by ID

GET /noCo/api/v2/workspaces/{workspaceId} Fetches workspace details scoped to the current Custom Agent. Called when a user opens the agent from the side panel to load context-specific workspace data. Query params:
ParamTypeDescription
resourceTypestringAlways CUSTOM_AGENT
resourceIdUUIDThe Custom Agent UUID
curl 'https://be.datagol.ai/noCo/api/v2/workspaces/055b4db3-96e1-45e1-8ff5-3a911b779a53?resourceType=CUSTOM_AGENT&resourceId=ac861ca7-d3c6-47ac-be63-abc49344b254' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'

Error Handling

All endpoints return standard HTTP status codes.
CodeMeaningCommon Cause
200Success
400Bad RequestMalformed JSON, missing required fields
401UnauthorizedMissing or expired JWT token
403ForbiddenUser lacks required permission (CREATE_COPILOT, EDIT_COPILOT, etc.)
404Not FoundAgent, workspace, or connector ID does not exist in this tenant
500Internal Server ErrorUpstream AI service error or unhandled exception

Connector Type Quick Reference

TypesourceTypeUse Case
WORKBOOK_RAGBACKENDRAG over a single CSV/Excel workbook
WORKSPACE_DOCUMENTSBACKENDRAG over all files in a workspace
KNOWLEDGE_BASEBACKENDSynced Google Drive or web knowledge base
CONNECTORAILive data via AI connector instance

Model ID Reference

Model IDProviderNotes
gpt-5.2OpenAIGPT-5 series, high capability
gpt-4.1OpenAIGPT-4.1
o4-miniOpenAIReasoning model, faster and cheaper
vertex_ai/claude-opus-4-7Anthropic via VertexClaude Opus on GCP
claude-opus-4-6AnthropicClaude Opus direct
claude-sonnet-4-6AnthropicClaude Sonnet, balanced
claude-haiku-4-5-20251001AnthropicClaude Haiku, fastest