Chat Endpoint
POST
/ai/chat/
const url = 'https://example.com/ai/chat/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"history":[{"content":"example","role":"user"}],"language":"example","layers":[{"column_info":[{}],"dataset_id":"example","dataset_table_name":"example","dataset_title":"example","feature_count":1,"filter":{},"geometry_type":"example","id":"example","label_config":{},"layer_type":"example","name":"example","paint":{},"sample_values":{},"style_config":{},"visible":true}],"map_id":"example","message":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/ai/chat/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "history": [ { "content": "example", "role": "user" } ], "language": "example", "layers": [ { "column_info": [ {} ], "dataset_id": "example", "dataset_table_name": "example", "dataset_title": "example", "feature_count": 1, "filter": {}, "geometry_type": "example", "id": "example", "label_config": {}, "layer_type": "example", "name": "example", "paint": {}, "sample_values": {}, "style_config": {}, "visible": true } ], "map_id": "example", "message": "example" }'Chat-based map editing: send a message and get back edit actions.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
ChatRequest
object
history
History
Array<object>
ChatHistoryMessageA single message in the conversation history.
object
content
required
Content
string
role
required
Role
string
layers
required
Layers
Array<object>
ChatMapLayerLayer state sent from frontend for chat context.
object
column_info
Any of:
Array<object>
object
key
additional properties
any
null
dataset_id
required
Dataset Id
string
dataset_table_name
required
Dataset Table Name
string
id
required
Id
string
name
required
Name
string
visible
Visible
boolean
map_id
required
Map Id
string
message
required
Message
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
ChatResponse
object
actions
required
Actions
Array<object>
ChatActionobject
bbox
Any of:
Array<number>
null
clear_paint
Any of:
Array<string>
null
columns
Any of:
Array<string>
null
geojson
Any of:
GeoJSONFeatureCollection
A GeoJSON FeatureCollection.
object
features
Features
Array<object>
GeoJSONFeatureA single GeoJSON Feature.
object
geometry
Any of:
GeoJSONGeometry
A GeoJSON geometry object (RFC 7946).
object
coordinates
required
Coordinates
Array
type
required
Type
string
null
id
required
Id
integer
properties
required
Properties
object
key
additional properties
any
type
Type
string
type
Type
string
key
additional properties
any
null
rows
Any of:
Array<Array>
null
type
required
Type
string
explanation
required
Explanation
string
Example
{ "actions": [ { "geojson": { "features": [], "type": "FeatureCollection" }, "type": "set_filter" } ]}Bad request — invalid query parameters or payload
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}Unauthorized — missing or invalid credentials
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}Forbidden — caller lacks access to this resource
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}Not found
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}Validation error
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}Internal server error
ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
Example
{ "type": "about:blank"}