Skip to content
getgeolens.com

Chat Endpoint

POST
/ai/chat/
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.

Media type application/json
ChatRequest
object
history
History
Array<object>
<= 20 items
ChatHistoryMessage

A single message in the conversation history.

object
content
required
Content
string
role
required
Role
string
Allowed values: user assistant
language
Any of:
string
layers
required
Layers
Array<object>
ChatMapLayer

Layer state sent from frontend for chat context.

object
column_info
Any of:
Array<object>
object
key
additional properties
any
dataset_id
required
Dataset Id
string
dataset_table_name
required
Dataset Table Name
string
dataset_title
Any of:
string
feature_count
Any of:
integer
filter
Any of:
Array
geometry_type
Any of:
string
id
required
Id
string
label_config
Any of:
object
key
additional properties
any
layer_type
Any of:
string
name
required
Name
string
paint
Any of:
object
key
additional properties
any
sample_values
Any of:
object
key
additional properties
any
style_config
Any of:
object
key
additional properties
any
visible
Visible
boolean
default: true
map_id
required
Map Id
string
message
required
Message
string
>= 1 characters <= 2000 characters

Successful Response

Media type application/json
ChatResponse
object
actions
required
Actions
Array<object>
ChatAction
object
bbox
Any of:
Array<number>
clear_paint
Any of:
Array<string>
columns
Any of:
Array<string>
dataset_id
Any of:
string
dataset_name
Any of:
string
expression
Any of:
Array
geojson
Any of:
GeoJSONFeatureCollection

A GeoJSON FeatureCollection.

object
features
Features
Array<object>
default:
GeoJSONFeature

A single GeoJSON Feature.

object
geometry
Any of:
GeoJSONGeometry

A GeoJSON geometry object (RFC 7946).

object
coordinates
required
Coordinates
Array
type
required
Type
string
id
required
Id
integer
properties
required
Properties
object
key
additional properties
any
type
Type
string
default: Feature
Allowed value: Feature
type
Type
string
default: FeatureCollection
key
additional properties
any
label_config
Any of:
object
key
additional properties
any
layer_id
Any of:
string
opacity
Any of:
number
<= 1
paint
Any of:
object
key
additional properties
any
replace_paint
Any of:
boolean
row_count
Any of:
integer
rows
Any of:
Array<Array>
style_config
Any of:
object
key
additional properties
any
truncated
Any of:
boolean
type
required
Type
string
Allowed values: set_filter set_style set_data_driven_style set_label toggle_visibility add_layer remove_layer show_query_result set_opacity
visible
Any of:
boolean
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
default: about:blank
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
default: about:blank
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
default: about:blank
Example
{
"type": "about:blank"
}

Not found

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Validation error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Internal server error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}