Create Feature
const url = 'https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/features/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"geometry":{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":["example"]}]},"properties":{}}'};
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/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/features/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "geometry": { "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [ "example" ] } ] }, "properties": {} }'Insert a new GeoJSON feature into a dataset.
Send the same Idempotency-Key on every attempt to create one feature, and
Idempotency-Attempt numbering the attempts 1, 2, 3 and so on. A repeat
from the same user on the same dataset never inserts a second feature. It
answers with the feature as stored, with the same 201 status and body
shape. If its attempt number is higher than any applied so far, it first
applies its geometry and the properties it names to that feature, with the
validation a create gets, unless anyone else has written the feature since
the last attempt was applied: then it is refused with 409, the stored
feature in detail.feature, and nothing is overwritten. If it is equal or
lower, the stored feature comes back unchanged, so a request that arrives
late cannot undo a later one. Two requests with one key never both insert. A key is honored for 24 hours. If
the feature it created has been deleted since, or the dataset’s data has
been replaced by a reupload or an overwrite, the repeat is refused with 409
rather than creating another. Without the key every request inserts, and
an attempt number sent without one is ignored.
Through an append-only dataset key, every created feature, single or in a
FeatureCollection, is answered with its id, a null geometry, empty
properties, and null table_id and tile_cache_version, since the
stored row can hold values the key didn’t send and the others move with
other writers. A repeat through one matches only that key’s own creates,
applies nothing and answers the same way. If the feature was deleted or
the dataset’s data replaced, the repeat gets 409 feature_gone with no
tile_cache_version.
A GeoJSON FeatureCollection body inserts up to 1,000 features in one
transaction: all of them or none. A feature the schema refuses is named
by its position under features in the 422. One refused while writing
gets the status a single create would, with detail.code
feature_refused, detail.index (counting from 0) and
detail.message. The 201 answer is a FeatureCollection of the stored
features in request order, each as a single create returns it, with
table_id and tile_cache_version also on the collection. It has no
Location header since there is no single new resource.
Idempotency-Key is refused with 422 for a FeatureCollection.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Header Parameters
Section titled “ Header Parameters ”Optional key that makes a retried create safe. Any visible ASCII character (! to ~, no spaces), 1 to 128 characters. The key is compared exactly as sent, so a quoted key and the same key unquoted are different keys. For example device-42:2026-10-17T16:09:33.123000+00:00.
Optional key that makes a retried create safe. Any visible ASCII character (! to ~, no spaces), 1 to 128 characters. The key is compared exactly as sent, so a quoted key and the same key unquoted are different keys. For example device-42:2026-10-17T16:09:33.123000+00:00.
Attempt number sent with Idempotency-Key, counting up by one each time the body is sent again. Counts as 1 when omitted.
Attempt number sent with Idempotency-Key, counting up by one each time the body is sent again. Counts as 1 when omitted.
Request Bodyrequired
Section titled “ Request Bodyrequired ”GeoJSON-style feature for insertion.
object
A GeoJSON GeometryCollection (RFC 7946 §3.1.8).
Geometry collections carry geometries instead of coordinates.
Only generic-geometry datasets accept them on write.
Nested collections are rejected because PostGIS cannot round-trip them through the GeoJSON boundary.
object
A GeoJSON geometry object (RFC 7946).
object
A GeoJSON geometry object (RFC 7946).
object
A GeoJSON FeatureCollection whose features are inserted together.
object
Features to insert in one transaction, at most 1000. If any is refused, none is inserted.
GeoJSON-style feature for insertion.
object
A GeoJSON GeometryCollection (RFC 7946 §3.1.8).
Geometry collections carry geometries instead of coordinates.
Only generic-geometry datasets accept them on write.
Nested collections are rejected because PostGIS cannot round-trip them through the GeoJSON boundary.
object
A GeoJSON geometry object (RFC 7946).
object
A GeoJSON geometry object (RFC 7946).
object
Responses
Section titled “ Responses ”Successful Response
A written GeoJSON Feature, plus the dataset’s committed tile version.
object
A GeoJSON GeometryCollection (RFC 7946 §3.1.8).
Geometry collections carry geometries instead of coordinates.
Only generic-geometry datasets accept them on write.
Nested collections are rejected because PostGIS cannot round-trip them through the GeoJSON boundary.
object
A GeoJSON geometry object (RFC 7946).
object
A GeoJSON geometry object (RFC 7946).
object
object
The features a FeatureCollection create inserted, in request order.
object
A written GeoJSON Feature, plus the dataset’s committed tile version.
object
A GeoJSON GeometryCollection (RFC 7946 §3.1.8).
Geometry collections carry geometries instead of coordinates.
Only generic-geometry datasets accept them on write.
Nested collections are rejected because PostGIS cannot round-trip them through the GeoJSON boundary.
object
A GeoJSON geometry object (RFC 7946).
object
A GeoJSON geometry object (RFC 7946).
object
object
Example
{ "type": "Feature", "geometry": { "type": "GeometryCollection", "geometries": [ { "type": "Point" } ] }}Example generated
exampleBad request — invalid payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks write access
Not found
Conflict — resource state prevents the operation
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request