Skip to content
getgeolens.com

Create Layer Endpoint

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

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
columns
Any of:
Array<object>
ColumnDef
object
name
required
Name
string
type
required
Type
string
geometry_type
required
Geometry Type

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

string
Example
Point
summary
Any of:
string
<= 5000 characters
title
required
Title

Display name for the new layer

string
>= 1 characters <= 500 characters
Example
Survey Points

Successful Response

Media type application/json
CreateLayerResponse
object
created_at
required
Created At

Creation timestamp

string format: date-time
feature_count
required
Feature Count

Number of features (0 for new layers)

integer
geometry_type
required
Geometry Type

OGC geometry type

string
id
required
Id

Dataset ID of the created layer

string format: uuid
table_name
required
Table Name

PostGIS table name in the data schema

string
title
required
Title

Display name

string
visibility
required
Visibility

Visibility level: private, internal, or public

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

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}