API and agentsAPI reference
Sketches
Drawing as data: a draw session becomes one ordinary GeoParquet dataset plus one layer on its map. Features carry a stable id and drawn kind; the owning-layer cascade deletes layer and dataset together and is deliberately not undoable.
9 operations on 4 paths.
/api/maps/{id}/sketches
GETList a map's sketch datasets
Sign-in Session cookie or Bearer tokenMCP tool list_map_sketches
A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. The sketch datasets drawn on this map, each with its table, owning layer and per-kind feature counts — what the builder's card copy and cascade confirmation read.
Parameters
idPathrequiredMap id.
string
Responses
200
The map's sketches.
application/jsonarray
(each item)objecteditRevisionstringpattern^[0-9a-f]{32}$Opaque durable revision paired with this document state. Camera and derived writes do not change it.
lastChangedAtstringor nullformatdate-timeTime of the last accepted covered change, independent of camera and cache clocks.
lastChangedByA named actor has display and fixed SQL names. { deleted: true } explicitly identifies a deleted actor and carries no names or profile fields. Null explicitly means unknown. Never inferred from ownership.
One of:
object
namestringrequiredsqlNamestringrequired
No other keys.
object
deletedbooleanalwaystruerequired
No other keys.
or null
tablestringrequiredtableIdstringrequiredmapIdstringrequiredlayerIdstringor nullrowCountintegerrequiredcountsobjectFeature count per drawn kind.
401403404503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
GET, HEAD, OPTIONS, POST
POSTStart a sketch with its first feature
Sign-in Session cookie or Bearer tokenMCP tool create_sketch
At most 16,777,216 wire bytes; a larger body is refused with request_body_too_large before JSON parsing. Created resources belong to the authenticated account. Submitted owner identities cannot assign or transfer ownership. A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. First commit of a draw session: mints the sketch dataset — named from the map's name plus _sketch, advancing a visible numeric suffix on collision — and its owning layer together, provenance recorded, no history step. The feature passes the same structural gate as every later commit: kind one of point, line, polygon, rectangle, circle, freehand; geometry the kind's GeoJSON family (polygon kinds are one closed ring, no holes); at most 10,000 vertices. Anyone who may change the map's content draws on it: the dataset is the drawer's own, filed into the map's project where the drawer may file, and the layer names it in the map's SQL home, qualified with the drawer's SQL name when that home is someone else's.
Parameters
idPathrequiredMap id.
string
X-Edit-RevisionHeaderrequiredRead the document first and send its editRevision. Missing or malformed: 400 invalid_request. Stale: 409 stale_revision, with no changes. Chain accepted results; reload explicitly after refusal.
stringpattern
^[0-9a-f]{32}$Opaque durable revision paired with this document state. Camera and derived writes do not change it.
Request body
At most 16,777,216 bytes (16 MiB); a larger body is refused with request_body_too_large.
application/json
object
featureobjectrequiredkindstringrequiredOne of
point,line,polygon,rectangle,circle,freehandgeometryobjectrequiredGeoJSON Point, LineString or Polygon matching the kind.
Responses
201
The minted sketch and resulting map editRevision.
application/jsonobject
tablestringrequiredtableIdstringlayerIdstringrequiredlayerNamestringfeatureIdstringrequired
All of:
object
editRevisionstringrequiredpattern^[0-9a-f]{32}$Opaque durable revision paired with this document state. Camera and derived writes do not change it.
400401403404409413503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
GET, HEAD, OPTIONS, POST
HEADRead response headers
Sign-in Session cookie or Bearer tokenAnswers 200, 401, 403, 404, 405, 503, defaultAllow
GET, HEAD, OPTIONS, POSTAutomatic HEAD uses GET with no response body.
Also on this path: OPTIONS under System.
/api/sketches/{name}/features
GETRead a sketch's drawn features
Sign-in Session cookie or Bearer tokenMCP tool get_sketch_features
A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. Every drawn feature with its stable id, kind and geometry — the identity the select tool and vertex handles use. The answer, envelope included, is bounded by Bytes drawn per layer (renderCapBytes), counted as it is built; above it the read answers 422 render_bytes_exceeded with no partial result. Changes to the sketch are not held to that limit.
Parameters
namePathrequiredSketch table name.
string
Responses
200
The features.
application/jsonobject
featuresarrayrequired
401403404422503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
GET, HEAD, OPTIONS, POST
POSTAppend one drawn feature
Sign-in Session cookie or Bearer tokenMCP tool append_sketch_feature
At most 16,777,216 wire bytes; a larger body is refused with request_body_too_large before JSON parsing. A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. Commits one more shape into the session's dataset, under the same structural gate and vertex ceiling as the first. The dataset's id and name never change; the artifact is rewritten and every dependent layer's render refreshes. A sketch's features change only by its drawer, whatever the map's role grants; anyone else who reaches it is refused with forbidden.
Parameters
namePathrequiredSketch table name.
string
Request body
At most 16,777,216 bytes (16 MiB); a larger body is refused with request_body_too_large.
application/json
object
featureobjectrequired
Responses
201
The appended feature's id and the new count.
application/jsonobject
featureIdstringrequiredrowCountintegerrequired
400
The feature failed the structural gate.
401403404413503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
GET, HEAD, OPTIONS, POST
409
The sketch vanished mid-flight; nothing written.
HEADRead response headers
Sign-in Session cookie or Bearer tokenAnswers 200, 401, 403, 404, 405, 422, 503, defaultAllow
GET, HEAD, OPTIONS, POSTAutomatic HEAD uses GET with no response body.
Also on this path: OPTIONS under System.
/api/sketches/{name}/features/{featureId}
PATCHMove one vertex of a drawn polygon
Sign-in Session cookie or Bearer tokenMCP tool move_sketch_vertex
At most 16,777,216 wire bytes; a larger body is refused with request_body_too_large before JSON parsing. A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. The one permitted edit: move exactly one vertex of a polygon or freehand feature. Kind and vertex count are preserved; points, lines, rectangles and circles refuse; the moved ring passes the same structural gate as a fresh commit. Only the sketch's drawer moves a vertex.
Parameters
namePathrequiredSketch table name.
string
featureIdPathrequiredDrawn feature id.
string
Request body
At most 16,777,216 bytes (16 MiB); a larger body is refused with request_body_too_large.
application/json
object
vertexIndexintegerrequiredRing index, 0-based, excluding the closing position; moving index 0 moves the closure too.
positionarrayrequired[longitude, latitude], in range.
Responses
200
The remaining row count after the feature change.
application/jsonobject
rowCountintegerrequiredminimum0
400
Bad index or out-of-range position.
401403404413503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
DELETE, OPTIONS, PATCH
409
Not a polygon-kind feature.
DELETEDelete one drawn feature
Sign-in Session cookie or Bearer tokenMCP tool delete_sketch_feature
A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. Removes exactly that row. The dataset keeps its id and name; deleting the last row leaves the empty dataset and its layer in place. Only the sketch's drawer deletes a feature.
Parameters
namePathrequiredSketch table name.
string
featureIdPathrequiredDrawn feature id.
string
Responses
200
The remaining row count after the feature change.
application/jsonobject
rowCountintegerrequiredminimum0
401403404503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
DELETE, OPTIONS, PATCH
Also on this path: OPTIONS under System.
/api/sketches/{name}
DELETEDelete a sketch and its owning layer — the cascade
Sign-in Session cookie or Bearer tokenMCP tool delete_sketch
A dataset is reached by its owner and by the owner and people of every project it is filed in. Lists, schema discovery and counts cover exactly the reached datasets and name each one's owner and the name the caller would type for it: the plain name for the caller's own, <sql name>.<name> for another owner's. Another owner's dataset is shown without connection facts and without links to what the caller cannot reach: a PostGIS snapshot shows its origin kind, with neither its connection nor its remote schema and table. A bare dataset name in a path or parameter is the caller's own dataset. On dataset reads, features, downloads and operation parameters, another owner's dataset the caller reaches is addressed by its qualified name, and in a /api/tables path also by its identifier; changing one by any address answers forbidden. Datasets change, refresh and go only by their owner; administrators reach nothing more. Upload and sketch suffixes ignore other accounts' names. Unreached and missing datasets, maps and project references return not_found before source or artifact access; a refused change leaves resources unchanged. Refresh and geometry changes preserve the dataset's identity and owner and recheck account activity at commit. Only the sketch's drawer deletes it. On the drawer's own map it deletes the provenance-named owning layer, its bound widgets, the dataset, the artifact and the tile artifacts together; on someone else's map the dataset goes and the layer stays, failing by name, since deleting a dataset never changes another person's map. Deliberately not undoable: no history step is written and steps targeting the owner leave the timeline. Copies and other layers over the same table keep ordinary deletion behavior and enter the standing missing-table state.
Parameters
namePathrequiredSketch table name.
string
Responses
200
Layer and dataset are gone. A changed surviving map carries its resulting editRevision.
application/jsonobject
mapIdstringor nullrequiredlayerIdstringor nullrequirededitRevisionstringpattern^[0-9a-f]{32}$Opaque durable revision paired with this document state. Camera and derived writes do not change it.
Any of:
object
mapIdstring
object
mapIdor null
401403404503default
Error with a machine-readable code and human message.
application/json405
method_not_allowed: the method is unsupported for this path.
application/jsonAllowHeaderExactly the documented methods for this path.
stringalways
DELETE, OPTIONS
Also on this path: OPTIONS under System.
7439201b