Datasets & Features
Base URL (local): https://api.gis.ph
All endpoints below are mounted under /v1.
Authentication
Section titled “Authentication”All /v1/* endpoints require an Authorization header:
Authorization: Bearer <token>Supported token types:
- Master token (legacy/admin): the value of
APIKEYin your server env. This bypasses per-user scoping. - User API key (recommended for data access):
gis_sk_<env>_<prefix>_<secret> - Dashboard Supabase JWT: a regular Supabase access token (JWT) from a logged-in dashboard session.
When authenticated as a user (API key or Supabase JWT), dataset/feature reads are scoped to the current user.
Response Shape
Section titled “Response Shape”Most endpoints respond with:
{ "data": ..., "error": null}On upstream/validation errors, you may receive:
{ "message": "..." }Datasets
Section titled “Datasets”List Datasets
Section titled “List Datasets”GET /v1/datasets
Returns a list of datasets.
Query params
includeFeatures(optional):true | 1 | yesto includefeaturesper dataset.
Example (no features)
curl -s "https://api.gis.ph/v1/datasets"Example (include features)
curl -s "https://api.gis.ph/v1/datasets?includeFeatures=true"Create Dataset
Section titled “Create Dataset”POST /v1/datasets
Creates a dataset. You can optionally create features in the same request by providing features.
Minimal payload
{ "name": "Custom School Locations"}More complete payload
{ "name": "Manila Flood Zones 2025", "description": "Flood hazard polygons from 2025 survey", "data_type": "vector", "srid": 4326, "geometry_type": "POLYGON", "status": "ready", "metadata": { "source": "survey", "tags": ["flood", "hazard", "manila"], "original_format": "GeoJSON" }, "storage_ref": null}Create dataset + features in one call
{ "name": "Custom School Locations", "description": "Points for schools", "data_type": "vector", "srid": 4326, "features": [ { "geometry": { "type": "Point", "coordinates": [121.05, 14.58] }, "properties": { "name": "St. Scholastica's", "students": 1200 } }, { "geom": { "type": "Point", "coordinates": [121.06, 14.59] }, "properties": { "name": "Another School" } } ]}curl example
curl -s -X POST "https://api.gis.ph/v1/datasets" \ -H "Content-Type: application/json" \ -d '{ "name": "Custom School Locations", "data_type": "vector", "srid": 4326 }'Notes:
user_idis optional in the API schema, but your database/RLS rules may reject client-supplied owners.- Nested feature creation is best-effort: if feature insert fails, the server attempts to delete the newly-created dataset.
Get Dataset
Section titled “Get Dataset”GET /v1/datasets/{id}
Returns a single dataset by id.
curl -s "https://api.gis.ph/v1/datasets/b2c3d4e5-f6g7-8901-bcde-fg2345678901"Update Dataset
Section titled “Update Dataset”PATCH /v1/datasets/{id}
Updates a dataset. Allows partial updates of fields like name, description, etc.
Payload
{ "name": "Updated Dataset Name", "description": "New description"}curl example
curl -s -X PATCH "https://api.gis.ph/v1/datasets/b2c3d4e5-f6g7-8901-bcde-fg2345678901" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Dataset Name" }'Features
Section titled “Features”List Features
Section titled “List Features”GET /v1/features
Returns all features.
curl -s "https://api.gis.ph/v1/features"Get Feature
Section titled “Get Feature”GET /v1/features/{id}
Returns a single feature by id.
curl -s "https://api.gis.ph/v1/features/1"Get Features by Dataset
Section titled “Get Features by Dataset”GET /v1/features/dataset/{datasetId}
Returns all features belonging to a dataset.
curl -s "https://api.gis.ph/v1/features/dataset/b2c3d4e5-f6g7-8901-bcde-fg2345678901"Create Feature
Section titled “Create Feature”POST /v1/features
Creates a single feature.
Payload (GeoJSON-style geometry)
{ "dataset_id": "b2c3d4e5-f6g7-8901-bcde-fg2345678901", "geometry": { "type": "Point", "coordinates": [121.05, 14.58] }, "properties": { "name": "St. Scholastica's", "students": 1200, "level": "secondary" }}Payload (using geom)
{ "dataset_id": "b2c3d4e5-f6g7-8901-bcde-fg2345678901", "geom": { "type": "Polygon", "coordinates": [ [ [121.04, 14.6], [121.05, 14.6], [121.05, 14.61], [121.04, 14.61], [121.04, 14.6] ] ] }, "properties": { "risk_level": "high" }}curl example
curl -s -X POST "https://api.gis.ph/v1/features" \ -H "Content-Type: application/json" \ -d '{ "dataset_id": "b2c3d4e5-f6g7-8901-bcde-fg2345678901", "geometry": {"type":"Point","coordinates":[121.05,14.58]}, "properties": {"name":"Test"} }'Notes:
dataset_idis required.- Provide either
geomorgeometry. The server mapsgeometry→geombefore inserting.