import requests
url = "https://api.datagrid.com/v1/search/ai"
payload = {
"query": "<string>",
"record_types": [],
"limit": 10,
"offset": 0,
"skip_ai_generation": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
record_types: [],
limit: 10,
offset: 0,
skip_ai_generation: false
})
};
fetch('https://api.datagrid.com/v1/search/ai', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/search/ai \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"record_types": [],
"limit": 10,
"offset": 0,
"skip_ai_generation": false
}
'{
"object": "search_ai_result",
"answer": "<string>",
"sources": [
{
"index": 123,
"node_id": "<string>",
"type": "file",
"title": "<string>",
"dataset_name": "<string>",
"table_name": "<string>",
"emoji": "<string>",
"url": "<string>",
"thumbnail_uri": "<string>",
"page_numbers": [
123
]
}
],
"search_results": {
"object": "search_tree",
"query": "<string>",
"data": [
{}
],
"nav_items": [
{}
],
"has_more": true,
"credits": {
"consumed": 123
},
"next": "<string>",
"total_count": 123,
"counts_by_display_type": {
"datasets": 123,
"documents": 123,
"images": 123,
"channels": 123
},
"display_items": [
{
"object": "search_display_item",
"id": "<string>",
"kind": "record",
"display_type": "dataset",
"table_id": "<string>",
"title": "<string>",
"body": "<string>",
"score": 123,
"created_at": "<string>",
"updated_at": "<string>",
"url": "<string>",
"dataset_name": "<string>",
"table_name": "<string>",
"table_fingerprint": "<string>",
"navigation_item_id": "<string>",
"emoji": "<string>",
"file_uri": "<string>",
"media_type": "<string>",
"data_lake_item_id": "<string>",
"page_number": 123,
"page_url": "<string>",
"total_pages": 123,
"parent_record": {
"id": "<string>",
"title": "<string>",
"body": "<string>"
},
"channel_data": {
"channel_type": "<string>",
"is_private": true,
"is_joined": true,
"participant_count": 123,
"people_count": 123,
"agent_count": 123
}
}
]
},
"credits": {
"consumed": 123
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}AI Search
AI-powered search that retrieves relevant knowledge from your teamspace, builds a merged context, and generates a natural language answer with numbered source citations. The response includes the generated answer, the sources cited (with links and metadata), and the full search tree results for reference. Use this when you want an AI-generated summary answer grounded in your team’s data.
import requests
url = "https://api.datagrid.com/v1/search/ai"
payload = {
"query": "<string>",
"record_types": [],
"limit": 10,
"offset": 0,
"skip_ai_generation": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
record_types: [],
limit: 10,
offset: 0,
skip_ai_generation: false
})
};
fetch('https://api.datagrid.com/v1/search/ai', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/search/ai \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"record_types": [],
"limit": 10,
"offset": 0,
"skip_ai_generation": false
}
'{
"object": "search_ai_result",
"answer": "<string>",
"sources": [
{
"index": 123,
"node_id": "<string>",
"type": "file",
"title": "<string>",
"dataset_name": "<string>",
"table_name": "<string>",
"emoji": "<string>",
"url": "<string>",
"thumbnail_uri": "<string>",
"page_numbers": [
123
]
}
],
"search_results": {
"object": "search_tree",
"query": "<string>",
"data": [
{}
],
"nav_items": [
{}
],
"has_more": true,
"credits": {
"consumed": 123
},
"next": "<string>",
"total_count": 123,
"counts_by_display_type": {
"datasets": 123,
"documents": 123,
"images": 123,
"channels": 123
},
"display_items": [
{
"object": "search_display_item",
"id": "<string>",
"kind": "record",
"display_type": "dataset",
"table_id": "<string>",
"title": "<string>",
"body": "<string>",
"score": 123,
"created_at": "<string>",
"updated_at": "<string>",
"url": "<string>",
"dataset_name": "<string>",
"table_name": "<string>",
"table_fingerprint": "<string>",
"navigation_item_id": "<string>",
"emoji": "<string>",
"file_uri": "<string>",
"media_type": "<string>",
"data_lake_item_id": "<string>",
"page_number": 123,
"page_url": "<string>",
"total_pages": 123,
"parent_record": {
"id": "<string>",
"title": "<string>",
"body": "<string>"
},
"channel_data": {
"channel_type": "<string>",
"is_private": true,
"is_joined": true,
"participant_count": 123,
"people_count": 123,
"agent_count": 123
}
}
]
},
"credits": {
"consumed": 123
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Body
Request body for AI-powered search.
Optional filter to restrict results to one display type (dataset, document, image, or channel). Applied before pagination, so pages cover the full filtered result pool. Honored when paginated search is enabled for the teamspace (Gen Search phase 3).
dataset, document, image, channel Response
An AI-generated answer with source citations and the underlying search tree results.
AI-generated answer with source citations and the underlying search results.