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.
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. Letters, digits and ._:-, up to 128 characters.
Optional key that makes a retried create safe. Letters, digits and ._:-, up to 128 characters.
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 Body required
Section titled “ Request Body required ”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
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