🔐 Token-Based Access All API requests require a valid Bearer token. Generate tokens via the Dashboard or OAuth2 flow. Tokens expire after 24 hours and support fine-grained scopes.

Authorization Header

HTTP Request
GET /v2/layers HTTP/1.1 Host: api.geoserver.dev Authorization: Bearer eyJhbGciOiJSUzI1NiIs... Accept: application/json

Token Scopes

ScopeDescription
layers:readAccess layer metadata and render tiles
layers:writeCreate, update, or delete vector/raster layers
styles:manageUpload or modify SLD/SE style definitions
admin:fullWorkspace, database, and user management
GET /v2/workspaces/{workspace}/layers

Retrieve a paginated list of all layers within a specified workspace. Supports filtering by type, bbox, and last modified date.

r>
ParameterTypeRequiredDescription
workspacestringYESWorkspace identifier (e.g., nasa_earth)
limitintegerMax results per page (default: 50, max: 200)
offsetintegerPage offset for pagination
typeenumFilter by vector, raster, or tile
Response (200 OK)
{ "data": [ { "id": "lyr_9x8k2m4p", "name": "global_coastlines", "type": "vector", "crs": "EPSG:4326", "features_count": 14829, "updated_at": "2025-08-12T14:30:00Z" } ], "pagination": { "total": 142, "page": 1, "has_next": true } }
POST /v2/features/{layer_id}/upload

Batch ingest spatial features. Supports GeoJSON, Shapefile, and GPKG formats. Auto-detects CRS and creates spatial indexes.

Request Body (Multipart)
--boundary_7a9f2 Content-Disposition: form-data; name="file"; filename="buildings.geojson" { "type": "FeatureCollection", "features": [...] } --boundary_7a9f2--

GeoJSON Feature Schema

All vector layers conform to RFC 7946. Custom properties are stored in the properties object and indexed for fast filtering.

Feature Template
{ "type": "Feature", "id": "feat_uuid_v4", "geometry": { "type": "Polygon", "coordinates": [[...]] }, "properties": { "land_use": "residential", "area_sqm": 4520.5, "verified": true } }

Supported CRS Authorities

AuthorityFormatNotes
EPSGStandardPrimary coordinate system reference
ESRIProprietaryAuto-translated to EPSG equivalents
OGC:CRS84Lat/LonRecommended for web mapping

HTTP & Application Errors

GeoServer uses standard HTTP status codes alongside structured JSON error payloads for programmatic handling.

CodeMessageResolution
400Invalid CRS or malformed geometryValidate GeoJSON structure
401Missing or expired tokenRefresh authentication
403Insufficient scope for resourceCheck workspace permissions
422SRID mismatch during ingestExplicitly set crs param
429Rate limit exceededImplement exponential backoff
503Spatial index rebuildingRetry after Retry-After header
Error Response Example
{ "error": { "code": 422, "message": "Invalid coordinate reference system: EPSG:9999", "details": { "field": "crs", "suggestion": "Use EPSG:4326 or EPSG:3857" }, "trace_id": "tr_88a92b1c" } }