Skip to content
getgeolens.com

Create Layer Endpoint

POST
/layers/
curl --request POST \
--url https://example.com/api/layers/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "title": "Survey Points", "geometry_type": "Point", "summary": "example", "columns": [ { "name": "example", "type": "example" } ] }'

Create a new empty spatial layer.

Creates a PostGIS table with a typed geometry column, runs the full post-processing pipeline (geom_4326, spatial index, reader grants), and registers the layer as a catalog dataset.

Requires editor or admin role.

Media type application/json
CreateLayerRequest
object
title
required
Title

Display name for the new layer

string
>= 1 characters <= 500 characters
Example
Survey Points
geometry_type
required
Geometry Type

OGC geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, or MultiPolygon

string
Example
Point
summary
Any of:
string
<= 5000 characters
columns
Any of:
Array<object>
ColumnDef
object
name
required
Name
string
type
required
Type
string

Successful Response

Media type application/json
CreateLayerResponse
object
id
required
Id

Dataset ID of the created layer

string format: uuid
title
required
Title

Display name

string
table_name
required
Table Name

PostGIS table name in the data schema

string
geometry_type
required
Geometry Type

OGC geometry type

string
feature_count
required
Feature Count

Number of features (0 for new layers)

integer
visibility
required
Visibility

Visibility level: private, internal, or public

string
created_at
required
Created At

Creation timestamp

string format: date-time
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"title": "example",
"table_name": "example",
"geometry_type": "example",
"feature_count": 1,
"visibility": "example",
"created_at": "2026-04-15T12:00:00Z"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}